编译运行device emulator
最近几天一直在分析device emulator的源代码(采用Share Source发布)。为了看一下其运行的效果,因此打算编译运行device emulator。
首先下载device emulator。 下载地址
在device emulator的doc中给出了编译的方法。
首先需要下载 zlib-1.2.3,解压后放到features\zlib中,然后下载 libpng 1.2.8,解压到 features\libpng中。
推荐的编译环境是vs2005。编译的过程很简单,图形化的用户界面。编译完成后会在release中生成DeviceEmulator.exe。
下载 Windows Mobile 5.0 Emulator Images for Smartphone,用MSI文件提取器提出其中的BIN文件。文件在目录 Windows Mobile 5_EXT\Windows Mobile 5.0 Emulator Images for Smartphone - CHS\Deviceemulation\0804下。分别为 SP_CHS_GSM_QVGA_VR.bin和SP_CHS_GSM_VR.bin。搞不清楚这个两个文件有什么区别。
拷贝上面的BIN文件到根目录下,比如D盘下面。然后用命令行运行device emulator。
cd
E:\DeviceEmulator.exe d:\SP_CHS_GSM_QVGA_VR.bin /memsize 256 /s d:\sp.dess
稍等稍等,出错了......
Google,根据http://blog.mcuol.com/User/aawolf/Article/3767_1.htm的提示,注释掉boards/wininterface.cpp中行492和493
重新编译运行。
没有找到如何使用 触摸屏和键盘输入。 整体运行的速度一般。应该和 Virutalmips 对于LCD模拟的速度差不多。
虽然说device emulator采用了JIT的技术,但实际上其和dynamips差不多,都是直接写汇编。当然device emulator有一些简单的优化。
不过 device emulator 有一个简单但是比较好的internal文档。可以学习学习。


