7.19.2010

VFP in CE 6.0

有關 CE 6 的 ARM VFP 支援

這一篇 google groupe討論
The VS2005 compiler used by PB for CE6.0 emits no VFP instructions and
unless you implement FPCRT.DLL for an ARM then all CE implementations
are integer (default MS implementation of FPCRT uses software
emulation), even if you have a hardware VFP in your core (e.g. ARM11
or Cortex-A8). To actually use the VFP you must do the following:

1. Use SYSGEN_OEM_FPCRT - catalog item "OEM Floating Point CRT (ARM
only)
2. Download the VFPv2 library support from the ARM website and
incorporate it into your build:
www.arm.com/products/os/windowsce_vfp_dl.html

Instructions are included with the download from ARM.

My tests show a 4x increase in performance on floating point
operations on a release build on an ARM1136JF-S core.

Andrew.

也就是說,CE 6 的 VFP driver(?) library f是由 ARM 提供的。

還有這一篇 MSDN 討論,說
The current version of Windows CE supports the ARMV4I architecture. Cortex A8 it's ARMv7 (ARM's naming can be even more confusing than ms one...) and currently the compiler does not use its specific features (NEON, VFP3 etc.).

The new release of Windows CE (named Windows Embedded Compact 7) will support the ARMv7 architecture.

Here you can find some information about the new features of this release:

http://www.microsoft.com/windowsembedded/en-us/products/windowsce/compact7.mspx

You can download a public beta from connect.microsoft.com.

If your project has not a very short time frame (you plan to release your device Q2 next year, for example), you may consider using this new release for your development to be able to "unleash" all the power of your CPU core.


Valter Minute
Windows Embedded MVP
http://geekswithblogs.net/WindowsEmbeddedCookbook

所以你藥用 CE 6 寫 VFP 或是 NEON 的 code 是不可能的,要等 Windows Embedded 7.

總合起來,可以要看一下 msdn :
Including a Replacement Floating Point C Run-Time Library in a Run-Time Image
還有這一篇的實做 copy 下來,免得不見:

Download and install the "ARM® VFPv2 Floating Point Support Library" from ARM.


If building with Platform Builder to build your OS image

simply add the FPCRT project to your solution, and set the following catalog feature

EVM_3530\Core OS\CEBASE\Applications and Services Development\C Libraries and Runtimes\OEM Floating Point CRT (ARM only)

A SYSGEN is required.


If building without Platform Builder, ensure the SYSGEN variable is set. I added the following to my "tinykernel DEBUG.bat" file.

set SYSGEN_OEM_FPCRT=1

Add entries to platform.bib

fpcrt.dll            $(_FLATRELEASEDIR)\fpcrt.dll               NK  SH
k.fpcrt.dll $(_FLATRELEASEDIR)\fpcrt.dll NK SHMK

I copied the contents of %WINCEROOT%\OTHERS\ARM\VFPv2\src\ARMVFPv2\obj to my prebuilt directory.
Then copied the DLL project to my %WINCEROOT%\OTHERS\ARM\VFPv2\src\FPCRT to my %PLATFORMROOT%\%_TGTPLAT%\src\drivers directory.
Modified dirs, and updated sources to point to new library location.

A SYSGEN is required.

Visual Studio 2008 VFP Support

VS2008 ARM compiler supports emulated and hardware floating point. To enable hardware based Vector Floating point you need to use this option

/QRfpe-

This means not floating point emulation.

If you use

/QRfpe

it will generate software floating point, as it means floating point emulation.

Microsoft KB 947894


Note: This is not related to NEON support



有關 multimedia (video/audio/graphic) 部份,ARM 有提供 OpenMax 的實做 (實際用 ARM11, Cortex A8 feature optimize) 的 library
Khronos Standards
...但是依照慣例,ARM的網頁連結 半年後一定又會改 >_<

要註冊才能download..
喔?是以 library 的方式提供,用 realview compile (當然不是 VS...)

7.12.2010

取得 4 種 size/範圍 的 DC (Device Context)
  • BeginPaint(hwnd, &ps) : 這個範圍最小,只有視窗中,client 的 "invalide" 區域,可以畫。
  • GetDC(hwnd) : 整個 Client area (也就是不含 menu, toolbar, statusbar,...)
  • GetWindowDC(hwnd) : 整個視窗 (含 client area, menu, toolbar , statusbar..)
  • CreateDC("DISPLAY",NULL,NULL,NULL) : 整個螢幕

7.08.2010

Speed up Windows CE boot time

以第一個 application 畫面顯示出來為準...

首先是,,改用 XIP。
XIP 的話,NK 被切成 tiny 和 BINFS 兩部份, bootloader 只要load binfs 就可以開始啟動 os 了,不用把整個 OS bin 都 load 進來 才動作,所以可以比較快。

用 msdn 的 delay load driver - busenum2
一些不急的 driver 等 gwes , ap load 完後再load。這樣 就可以比較快進入 ap.

bootloader
直接 load os,不要 作 2 step loading -- load eboot, eboot load os。這樣可以比較快。



但是怎麼作,好像都要 8 sec 以上,要做出 5 sec 開機好像不可能喔...

bootloader load tinybin, binfs 啟動就花 3 sec
load gwes, gmtt_o 又花 1.6 sec 以上

再加一些其他啦里啦鉔的....

7.05.2010

再作 celog.dll - boot time

因為要作 msdn 那個 delay load driver 的測試,所以把 celog 也 enable 起來:

在 os project 勾選
  • enable event tracking during boot
  • flush tracked event to release directory
然後 修改 makexip.js,把 celog.dll 放到 boot region。


參考 http://msdn.microsoft.com/en-us/library/aa450700.aspx
設定

[HKEY_LOCAL_MACHINE\System\CeLog]
"Transport"="LocalFile"
"FileName"="\\celog.clg"
"ZoneCE"=dword:00014040
"FlushTimeout"=dword:1F4

log 到 ram, 每 500ms flush 到 ram file一次 (避免 data loss)
log 的東西:
  • CELZONE_BOOT_TIME 0x00010000 -- 包含 boot event
  • CELZONE_LOADER 0x00004000 -- 包含 load module (dll) 的 event
  • CELZONE_PROCESS 0x00000040 -- 包含 create process (exe) 的 event
重 build 開機後,就可以看到 celog.clg 在 // 下, copy 到 SD。
開啟 build environment:
 readlog celog.clg output.txt
把 clg 轉為文字。

就可以看到 load module 和 create process event 的時間了。

clone public code

大概就是用 sysgen_capture 這個 tool 來作:

首先找到 sysgen 的 targetname。假設是 celogflush 好了
* 在 platform/yourbspname 下 create 一個 folder : celogflush
* 在 celogflush 下: sysgen_capture -p common celogflush
* copy public/common/sdk/samples/celog/flush/celogflush/flush.c 過來
* 因為 celogflush/sources 有列 include path : ..,所以把 ../*.h 也 copy 過來
* rename 剛剛 sysgen_capture 產生的 sources.celogflush 為 sources
* 修改 sources,把 source = 加上 flush.c
* copy Makefile 過來
這樣就可以下 build,產生 celogflush.exe 了

主要大概是用 sysgen_caputre 產生 target 的 source 檔,這樣才知道 target 用的 library 有哪些。

把 source file copy 過來,修改 sources。
雖然 library 中會有同樣的 sample,但是大蓋會以 source = 列出的優先(吧?)

6.29.2010

The master makefile of Windows CE

真是太感謝 Kun-Yi 啦!

從我進來這裡,RBT 就展示他sysgen XXX 的能力,讓我門少build 一些 code,少浪費一些時間。
但是我問他,怎麼知道 改 OOO 時要用 XXX ?
他也說不出個所以然來
不然就是他不願意說...
所以我就不斷的在找這個謎.....(找了好幾年..)

後來,上一篇,偉大而又無私的 資深 Windows CE 專家 Kun-Ki 直接給出答案:
就是 PUBLIC\COMMON\CESYSGEN\makefile

打開來看,果然有所有 target 的 name 和 dependency..

真是令人感動!!

終於看到 CE 的 master makefile ....

6.28.2010

output message on device on/off - sysgen and private

在查 system poweron/off 時,有時要列印出所以 driver 的 on/off message。
一個一個加很麻煩,可以直接在 device manger 加:
C:\WinCE600\PRIVATE\WINCEOS\COREOS\DEVICE\DEVCORE\Devapi.c
裡面的 DevMgrPowerOffHandler:
原來的
                DEBUGMSG(ZONE_PNP,(TEXT("Calling \'%s\' PowerDown at 0x%x\r\n"),
改為強制輸出的 RETAILMSG 就可以。


在該 folder build 完後,下 sysgen -p common devmgr 後,就可以makeimg 了。



-p common 的意思是 "在 wince600\public\common 下"
-p option 好像是指 public 下的 folder。
所以 sysgen -p common devmgr 的意思是要 sysgen public\common\ 下的 devmgr
-- 雖然不知道怎麼看出common folder 里有 devmgr 這個 target @_@..

可以測試一下:
sysgen -p directx 會 build 出 public\direct 下所有的 directx example
如果只要 build mosquito:
sysgen -p directx mosquito



sysgen 也是一個 batch 檔...

只是我一直找不到那些 sysgen 的 "target" 到底在哪裡...

關於 sysgen 的target ..大概可以到 retail folder 去找,, dll 或是 exe。
用 cesysgen_capture,會產生 該 project 的 sources file,然後去找該 target 是由哪些
library build 出來的。
cesysgen_capture -p common devmgr 
會產生一個 sources.devmgr

sysgen_capture device

會產生一堆 (相依?) 的 source 檔:
  • sources.ceddk -- ceddk.lib
  • sources.devmgr -- devmgr.lib
  • sources.pm -- pm.lib
  • sources.udevice -- udevice.exe
  • sources.device -- device.exe