定製自己的Windows CE 5.0 ARM中文模擬器

來源:互聯網
上載者:User

一、產生OS

1. 安裝Windows CE 5.0(記得CPU類型裡把ARMV4I選上)裝完之後裝DeviceEmulatorBSP.msi,這是ARMV4I模擬器的BSP。

2. 運行Platform Builder,建立一個Platform,給你的新Platform取一個名字,我這裡取為MyCEEmu。BSP選擇Microsoft DeviceEmulator:ARMV4I,Design Template選擇Mobile Handheld,Application & Media隨你選,Networking & Communications只選擇Local Area Network(LAN)->Wired Local Area Network,其餘都去掉。最後完成嚮導。

3. 添加網卡。在Catalog View的Device Drivers->Networking->Local Area Networking (LAN) devices目錄下,把NE2000-compatible(PCMCIA car)添加進來。

4. 如果要開發託管程式,添加Catalog View的Core OS->Windows CE Devices->Applications – End User->CAB File Installer/Uninstaller。

5. 添加ActiveSync(可選),在Catalog View的Core OS->Windows CE Devices->Applications – End User目錄下。

6. 添加快閃記憶體支援。有三個組件:SMFlash,Partition Driver和FAT。
   先轉到Catalog View:
   SMFlash在BSP->Microsoft Device Emulator->Storage Drivers->MSFlash Drivers->SmartMedia NAND Flash Driver (SMFLASH),
   Partition Driver在Core OS->Windows CE Devices->File Systems and Data Store-> Storage Manager->Partition Driver
   FAT在Core OS->Windows CE Devices->File Systems and Data Store->Storage Manager->FAT File System。

7. 開啟菜單Platform->Setting,這裡有三個地方要設定:
1) Build Options選項卡下,去掉Enable CE Target Control Support和Enable KITL;
2) Environment選項卡,添加環境變數CE_MODULES_SERIAL=1,這是用來將DMA添加進來;
3) Locale選項卡,用來添加你想要的語言支援,可改可不改。我這裡先Clear All然後選了中文(中國)和英語(美國)。Default Language選為中文。

8. 視情況添加其他所需的組件。我添加了MSXML的支援。

9. BuildOS->Sysgen。

二、產生SDK

1. 運行SDK Wizard(Platform->SDK->New SDK),填寫必要的資訊之後,把支援的開發工具都勾上,完成。下面是配置SDK(選擇Platform->SDK->Configure SDK),要是覺得沒有什麼好配置的也可以跳過。

2. 開啟ExportSdk.sdkcfg檔案(先做好備份,這個檔案一般在項目根目錄下,就是在New Platform Wizard的第2步中所指定的目錄,預設是%_WINCEROOT%/PBWorkspaces下)。這是一個XML格式的文字檔,找到這兩行:
    <PropertyBag NAME="DeviceEmulation">
    </PropertyBag>
把這兩行替換為如下的片斷:
 <PropertyBag NAME="DeviceEmulation">
        <Property NAME="Default Image">1</Property>
        <PropertyBag NAME="1">
            <Property NAME="ImageName">MyCEEmu</Property>
            <Property NAME="VMID"></Property>
            <Property NAME="Default Skin"/>
            <Property NAME="Height">240</Property>
            <Property NAME="Width">320</Property>
            <Property NAME="BitDepth">16</Property>
            <Property NAME="Memory">128</Property>
            <Property NAME="Bin Dest">Emulation/nk.bin</Property>
            <Property NAME="Fixed Screen">1</Property>
            <Property NAME="CpuName">ARMV4I</Property>
            <Property NAME="DPIX">96</Property>
            <Property NAME="DPIY">96</Property>
            <Property NAME="SupportRotation">0</Property>
            <Property NAME="Enabled">1</Property>
            <Property NAME="Bin Path"></Property>
            <Property NAME="Ethernet">1</Property>
            <Property NAME="Ports">1</Property>
            <Property NAME="AdditionalParameters"></Property>
            <PropertyBag NAME="Skins"/></PropertyBag>
 </PropertyBag>
 <PropertyBag NAME="Added Files">
        <PropertyBag NAME="{3B388597-0924-4102-ADFA-2519D2C3E11B}">
            <Property NAME="Source">C:/WINCE500/MyCEEmu/ReleaseImage</Property>
            <Property NAME="Destination">Emulation</Property>
            <Property NAME="Subfolders">0</Property>
        </PropertyBag>
 </PropertyBag>

3. 設定變數。上面替換的代碼中有幾個變數需要設定,分別是:
1) ImageName:這是程式員在Visual Studio IDE裡所看到的名字;
2) VMID:一個GUID,可以用GuidGen.exe來產生一個;
3) Height/Width:模擬器螢幕的寬高;
4) BitDepth:色彩深度;
5) Memory:分配給模擬器的RAM大小;
6) DPIX/DPIY:螢幕DPI;
7) Source:這是一個目錄,包含編譯產生的NK.bin。建議最好在%_WINCEROOT%下建立一個目錄,專門用於存放NK.bin。

這裡我設為C:/WINCE500/MyCEEmu/ReleaseImage。
修改完成後儲存。

3. 產生SDK。Platform->SDK->Build SDK。一切順利的話應該可以在當前工程目錄的SDK目錄下找到打包成msi檔案的SDK安裝包。

三、配置Visual Studio 2005
1. 先安裝產生好的SDK。運行Visual Studio 2005,選擇菜單“工具->選項”,開啟選項設定對話方塊,從左邊的樹型列表中選擇“裝置工具->裝置”,右邊的下拉式清單方塊拉到底可以看到“MyCEEmu”,這就是我們剛剛產生的那個Platform。下面的裝置列表裡有兩項,雙擊MyCEEmu,設定傳輸為DMA傳輸,再點擊“模擬器選項”,在“顯示”選項卡裡設定好模擬器螢幕尺寸,色彩深度等,全部儲存。

2. 建立一個智慧型裝置項目,嚮導第2步選擇平台的時候用我們的MyCEEmu替換Pocket PC 2003,完成。然後按F5運行程式,不出意外的話模擬器應該就出來了。 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.