DD-WRT Printer Sharing 路由器打印机共享设置
DD-WRT allows for clientless printer sharing making it easy to install printers directly into the router without the need for a seperate computer. You must have installed USB support (usb_storage, sd_mod etc. can be left out if no need for external storage).
Some of the information below is outdated. I made a guide for how to get USB printing working on the Asus WL-520gU. It should also apply to other routers with USB. http://wl520gu.googlepages.com/
The following must be done via telnet or SSH:
Contents[hide] |
Printer driver
Install printer driver:
ipkg -force-depends install kmod-usb-printer
Edit /jffs/etc/config/usb.startup and add
insmod /jffs/lib/modules/2.4.30/printer.o
Connect printers and reboot your router
See if any printers have been found:
dmesg | grep usb
It should show something like this (I have 2 printers connected)
<6>printer.c: usblp0: USB Bidirectional printer dev 5 if 0 alt 0 proto 2 vid 0x04F9 pid 0x000D <6>printer.c: usblp1: USB Bidirectional printer dev 6 if 0 alt 0 proto 2 vid 0x04A9 pid 0x108C
usblp0 means that the found printer is accessible at /dev/usb/lp0 etc.
Note: The 'USB Support' link above refers to installing several modules. On my WRT350N, I had to install these additional modules (usb-uhci.o and usb-ohci.o) to get my router to detect that my printer was plugged in.
comments from wmd1942:
I found the command "insmod /jffs/lib/modules/2.4.30/printer.o" is unnecessary if you have Core USB Support, USB 2.0 Support and USB Printer Support enabled in the 'Services' section of the router web page.
Notes For v24 Stable
The new v24 stable (i.e. not the release candidate versions) contains support for printer sharing and usb support in the web UI. I just got my printer server working and I figured I'd share my experience and maybe save somebody and hour or two.
Here's what I had to do to get my LaserJet 3020 to work with DDWRT on an Asus WL-500g Premium with the "DD-WRT v24 (05/24/08) mega - build 9526" version of the firmware:
1. Enable "JFFS2 Support" on the Administration tab.
(Note from another user: I had to enable "Clean JFFS2" as well, and reboot. After reboot, I ran "ipkg update", then installed the package mentioned in the first step of the "Printer Driver" section above.)
2. Enable SSH on the Services tab
3. Enable "Core USB Support", "USB 1.1 Support (UHCI)", "USB 1.1 Support (OHCI)", "USB 2.0 Support", "USB Printer Support" on the Services tab (all items under "USB Support" except for "USB Storage Support"). Note that the router did not recognize my printer if I left the USB 1.1 drivers unselected. This even though the printer supports USB 2.0.
4. Connect your printer to the router
5. Reboot your router
6. Log in with SSH to your router. And check if your printer was recognized:
root@my-ddwrt-router:/jffs/etc/default# ls -la /dev/usb/ drwxr-xr-x 1 root root 0 Jan 1 1970 . drwxr-xr-x 1 root root 0 Jan 1 1970 .. crw-rw---- 1 root root 180, 0 Jan 1 1970 lp0
if there is nothing in /dev/usb/ you need to change something, probably involving installing some other driver for your printer.
7. Look at the following files:
/jffs/etc/default/p910nd /jffs/etc/init.d/p910nd
To do so, type: vi /jffs/etc/default/p910nd. vi is a text editor. You start in "command mode". Press 'a' to switch to editing mode, where you can edit the file. Press 'Esc' to get to command mode. Press :w[enter] to write (save) and :q[enter] to quit without saving, or :wq[enter] to save and quit.
At least on my version of v24, the third line in the startup script had the following line:
DEFAULT=/etc/default/p910nd
this was invalid on my router (people more familiar with the router, please correct me here or explain the intricacies involved) and I had to edit this file and change the line to say:
DEFAULT=/jffs/etc/default/p910nd
there are two commands that you can run to check if the server is running:
root@my-ddwrt-router:/jffs/etc/init.d# netstat -an Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:9100 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
root@ddwrt-se-office:/jffs/etc/init.d# ps | grep p9100d 561 root 680 S p9100d -b -f /dev/usb/lp0 0
If you see a 91xx port listening in netstat and you see the p9100d running in ps, your server is probably up and running properly. Check that the server is not running yet. If not, test starting the the server by issuing:
/jffs/etc/init.d/p910nd
For v24_TNG (sp2) versions, the command should be:
/jffs/etc/init.d/p910nd start
and check that it came up. You should be able to print now (see bottom of this page for instructions on how to set up your workstation for IP printing via ddwrt).
8. Add the above command to the Administration->Commands edit box and click "Save Startup". This makes sure that the printer server comes up the next time you reboot your router.
Hope that helps. --Mbjarland 07:33, 27 June 2008 (CEST)
Note: On my DD-WRT v24-sp2 (10/10/09) mini-usb-ftp the command: '/jffs/etc/init.d/p910nd start' works on the ssh shell, but not on the Administration->Commands edit box
This commands works on the Administration->Commands edit box:
/jffs/usr/sbin/p910nd -b -f /dev/usb/lp0 0
Print server
Now Install printserver daemon:
ipkg install p910nd
Edit /jffs/etc/config/usb.startup and add
#brother laser /jffs/usr/sbin/p910nd -b -f /dev/usb/lp0 0 #canon inkjet /jffs/usr/sbin/p910nd -b -f /dev/usb/lp1 1
(correct the above to match your setup)
Eliminating the -b flag may resolve failure to print for some printers.
NOTE from another user: I needed go without the -b flag on my Canon MX310 printer for it to work.
-b means bidirectional, -f specifices device name, and the last number can be 0,1 or 2, making the print server listen at port 9100, 9101 and 9102 respectively.
Reboot your router
Now, you router works as a print server over TCP/IP
Note: You may have to remove the '-b' option for p910nd. I couldn't print with that option included.
comments from wmd1942:
In order to load the printer server in startup, the execution permission has to be added to this "usb.startup" file:
root@DD-WRT:chmod +x /jffs/etc/config/usb.startup
After reboot, use command:
ps | grep p910
The screen should be something like:
root@DD-WRT:~# ps | grep p910 306 root 356 S /jffs/usr/sbin/p9100d -f /dev/usb/lp0 0 n
NOTE:
Multifunction printers which have fax machines attached to them may also be made to work. Ie: A CANON MF4150 with VendorID=0x04A9 and ProductID=0x26A3 will have lp0 and lp1 available. Running two instances of p9100 on different ports (9100 and 9101) and creating the respective port in windows will allow fax functions to work in conjunction with print functions as long as proper drivers are used to access the proper port. Most printers have print functions listed as lp0 and fax functions list as lp1.
EXAMPLE:
#canon printer /jffs/usr/sbin/p910nd -b -f /dev/usb/lp0 0 #canon fax /jffs/usr/sbin/p910nd -b -f /dev/usb/lp1 1
Workstation setup
Ubuntu Linux
- Go to System, Administration, Printing.
- Click New Printer
- Choose AppSocket/HP JetDirect
- Hostname: IP address of the wireless printer (normally 192.168.1.1)
- Port: 9100 for first printer, 9101 for second printer, etc
- Click Forward and go on with the printer wizard to select brand, model and settings as you would do for a local printer
Windows XP
- Find your printer in Control Panel - Printers etc. and open the properties page for it.
- Select the Ports tab.
- Click Add Port and choose Standard TCP/IP printer port and click New Port
- Enter you router's IP address (normally 192.168.1.1) and click Next
- Set Device type to custom and click settings.
- Make sure RAW is selected and specify the necessary port number (normally 9100, 9101 for second printer, etc) and click OK
- Click Next and Finish and Close
- Make sure the newly created port is selected for your printer and click OK
Mac OS X 10.5 (Leopard)
- Open System Preferences
- Open Print & Fax
- Click the + button below the list of installed printers
- Select the toolbar button called 'IP'
- Set protocol to: HP Jetdirect - Socket
- Enter the address of your router followed by : and the port - ie. normally 192.168.1.1:9100
- Leave 'Queue' blank
- Set a friendly name for your printer (whatever you like)
- And a friendly location (again, up to you)
- Print Using: choose 'Select a driver to use'
- A list will pop up of all installed printer drivers - choose the one that works for you (see Note below)
- Add your printer
Note (Mac only): the driver must be compatible with the CUPS printing system, which is one of the two printing systems included in OS X. Certain printers e.g. Canon Pixma series and Epson Inkjet include OSX drivers which do not use CUPS. You may find compatible printer drivers from Gutenprint (free) orPrintFab ($). OS X Leopard appears to include certain Gutenprint drivers, but the quality may vary and it may be worth checking their website for updated versions, or try PrintFab.
Printing from WAN
If you want to be able to print from the WAN side of your router do the following:
In the web interface go to Administration - Commands and hit the "Command shell" field and type in
/usr/sbin/iptables -I INPUT 1 -p tcp --dport 9100:9102 -j logaccept
And click Save Firewall
Your router reboots and you can now print from WAN side
NOTE: This is not recommended if your WAN is directly accessible from internet, but useful at private subnets of companies, colleges etc.
Installing on Asus WL500G Deluxe, with DD-WRT v24-sp2
Install dd-wrt.v24_usb_generic.bin firmware Enable JFFS, and clear JFFS Enable SSH reboot router Enable All USB options - set mount point to /opt Since ipkg update seems broken, Download http://downloads.openwrt.org/backports/rc5/p910nd_0.7-2_mipsel.ipk to a USB stick formatted with FAT32 Insert USB into router and reboot router SSH to router cd /opt ipkg -d root install p910nd_0.7-2_mipsel.ipk
p910nd is now installled and you have the configuration files in /jffs/etc/ and you can continue at the guide above.
Notes for K26
With the new kernel 2.6 the kernel doesn't create the device file /dev/usb/lp0 anymore. You have to do that manually once. Just issue
mknod -m 660 /dev/usb/lp0 c 180 0
once and everything is going to work. This should probably be done before starting the p910nd server.
Note from another user: I had to add this mknod command to /jffs/etc/config/usb.startup.
定制自己的Windows CE 5.0 ARM中文模拟器(转)
一、生成OS
1. 安装Windows CE 5.0(记得CPU类型里把ARMV4I选上)装完之后装DeviceEmulatorBSP.msi,这是ARMV4I模拟器的BSP。
我补充个DeviceEmulatorBSP.msi的下载地址:
http://www.microsoft.com/downloads/details.aspx?FamilyID=474b03a6-e87d-455d-bc16-b8cf18ef39b4&displaylang=en
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">Emulationnk.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:WINCE500MyCEEmuReleaseImage</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:WINCE500MyCEEmuReleaseImage。
修改完成后保存。
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运行程序,不出意外的话模拟器应该就出来了。
移植linux2.6.29内核+yaffs2文件系统过程[转贴]
软件平台:vm(fodera 9)+arm-linux-gcc 4.3.2
硬件平台:友善之臂出的mini2440开发板友善之臂
参考资料:网上n多资料,在这里先谢谢这些无私贡献自己经验的前辈们。
<<嵌入式Linux应用开发完全手册>>作者:韦东山,书完全是根据作者的经验写的,
和2410 2440的板子比较配套,我觉得这是一本非常好的参考书,特别是用2410或者是2440的初学者.
现在开始移植了,bootloader我还是用的mini2440的supervivi,这个比较方便,功能十
分强大,u-boot就留给以后吧.2440的板子移植内核还是比较简单的,因为内核里面已经有了2410的配置文件,
简单的改一下,基本就可以了,再就是外设驱动的修改了.
1.修改顶层Makefile文件
直接将Makefile文件里面的 ln193
ARCH ?= $(SUBARCH)
CROSS_COMPILE ?=
改为:
ARCH ?= arm
CROSS_COMPILE ?=arm-linux-
然后用S3C2410的默认配置文件
#make s3c2410_defconfig //此命令 configuration written to .config
//要先按上面方法修改完成Makefile文件才能执行这一步
#make menuconfig //只需修改下面几项
[*] Enable loadable module support --->
[*] Module unloading
[*] Automatic kernel module loading
选择这两个,剩下的可以去掉
System Type ---->
[*] S3C2410 DMA support
[*] Support ARM920T processor
S3C2410 Machines --->
[*] SMDK2410/A9M2410
S3C2440 Machines --->
[*] SMDK2440
[*] SMDK2440 with S3C2440 CPU module
**************************************************************************************************************
2.修改时钟,不修改超级终端中会出现乱码
修改Arch/arm/mach-s3c2440/mach-smdk2440.c ln163
S3c24xx_init_clocks(16934400);
改为:
S3c24xx_init_clocks(12000000);
3.修改mach-type
方法1:修改vivi的启动参数
从nandflash启动后,迅速按住SPACE键进入supervivi
Supervivi> menu,进入菜单vivi
##### FriendlyARM BIOS for 2440 #####
[v] Download vivi
[k] Download linux kernel
[y] Download root_yaffs image
[c] Download root_cramfs image
[n] Download Nboot
[e] Download Eboot
[i] Download WinCE NK.nb0
[w] Download WinCE NK.bin
[d] Download & Run
[f] Format the nand flash
[p] Partition for Linux
[b] Boot the system
[s] Set the boot parameters
[t] Print the TOC struct of wince
[q] Goto shell of vivi
Enter your selection: s
##### Parameter Menu #####
[r] Reset parameter table to default table
[s] Set parameter
[v] View the parameter table
[w] Write the parameter table to flash memeory
[q] Quit
Enter your selection: s
Enter the parameter's name(mach_type, media_type, linux_cmd_line, etc): mach_type
Enter the parameter's value(if the value contains space, enclose it with "): 362
Change 'mach_type' value. 0x0000030e(782) to 0x0000016a(362)
这一步有时候会卡很长时间,多试几遍就好了,不知道什么原因。
##### Parameter Menu #####
[r] Reset parameter table to default table
[s] Set parameter
[v] View the parameter table
[w] Write the parameter table to flash memeory
[q] Quit
Enter your selection: w
Found block size = 0x0000c000
Erasing... ... done
Writing... ... done
Written 49152 bytes
Saved vivi private data
##### Parameter Menu #####
[r] Reset parameter table to default table
[s] Set parameter
[v] View the parameter table
[w] Write the parameter table to flash memeory
[q] Quit
Enter your selection: v
Number of parameters: 9
name : hex integer
-------------------------------------------------------------
mach_type : 0000016a 362
media_type : 00000003 3
boot_mem_base : 30000000 805306368
baudrate : 0001c200 115200
xmodem : 00000001 1
xmodem_one_nak : 00000000 0
xmodem_initial_timeout : 000493e0 300000
xmodem_timeout : 000f4240 1000000
boot_delay : 01000000 16777216
Linux command line: noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0,115200
##### Parameter Menu #####
[r] Reset parameter table to default table
[s] Set parameter
[v] View the parameter table
[w] Write the parameter table to flash memeory
[q] Quit
Enter your selection: q
方法2:修改内核文件
修改cpu ID,不修改将会出现无法进入内核由于CPU mach_type 不对应找不到对应的CPU。
arch/arm/tools/mach-types 这个文件打开修改 对应CPU 的ID
比如我修改 S3C2410 对应为 782(我的VIVI的ID)。这样就可以找到S3C2410了
***********************************************************************************************************************
4.修改MTD分区
MTD分区信息在arch/arm/plat-s3c24xx/common-smdk.c文件中修改. ln109
这个也比较简单,我是根据supervivi里面的分区信息来的,我的分区信息如下:
static struct mtd_partition smdk_default_nand_part[] = {
[0] = {
.name = "vivi",
.size = 0x00030000,
.offset = 0X00000000,
},
[1] = {
.name = "kernel",
.offset = 0x00050000,
.size = 0x00200000,
},
[2] = {
.name = "root",
.offset =0x00250000,
.size =0x03dac000,
}
};
有的文章介绍说这个文件还要修改smdk_nand_info如下:
static struct s3c2410_platform_nand smdk_nand_info = {
.tacls = 0, //default is 20
.twrph0 = 30, //default is 60
.twrph1 = 0, //defualt is 20 changed by yangdk
.nr_sets = ARRAY_SIZE(smdk_nand_sets),
.sets = smdk_nand_sets,
};
但查看友善之臂的内核发现并没有改,因此我也没有修改,最终也没出现问题
启动之后还是会现panci信息因为还没有写入文件系统.
5.内核增加yaffs2支持
到网上下载ysffs2源代码,解压之后进行如下修改:
./patch-ker.sh c /2440/linux-2.6.29
上面命令完成下面三件事情
(1)修改内核fs/Kconfig
增加一行:source "fs/yaffs2/Kconfig"
(2)修改内核fs/Kconfig
增加一行:ojb-$(CONFIG_YAFFS_FS) +=yaffs2/
(3)在内核fs/目录下创建yaffs2目录
将yaffs2源码目录下面的Makefile.kernel文件复制为内核fs/yaffs2/Makefie;
将yaffs2 源码目录的Kconfig文件复制到内核fs/yaffs2目录下;
将yaffs2源码目录下的*.c *.h文件复制到内核fs/yaffs2目录下.
在内核根目录下执行:
#make menuconfig 配置yaffs2文件支持
File systems --->
Miscellaneous filesystems --->
<*>YAFFS2 file system support
这里留着默认配置不知道可不可以,我在移植yaffs文件系统中由于出现问题一直找不到原因
后来将这里完全按照友善之臂的配置改了一下,但是并没有解决我的问题。
6.#make uImage 生成zImage
**********************************************************************************************************************
7.创建yaffs文件系统
具体移植过程如下:
1. 创建必须的文件夹及设备文件
# mkdir rootfs
# cd rootfs
# mkdir bin dev etc lib mnt proc sbin sys root
# mkdir /etc/var
# mkdir /etc/tmp
# ln -s /etc/var /var
# ln -s /etc/tmp /tmp
2. 创建设备文件系统
从 Linux-2.6.18开始,负责旧版本的设备管理系统devfs已被废除,但新
版本的udev是一个基于用户空间的设备管理系统。在内核启动时并不能
自动创建设备节点,固需手动创建console和null两个启动过程必须的设
备节点。我们将采用busybox中内置的mdev,一个简化的udev版本.
# mknod -m 660 dev/console c 5 1
# mknod -m 660 dev/null c 1 3
3. 建立动态运行库
由于linux只安装上了arm-linux-gcc 4.3.2没有glibc的库文件,只好把友善之臂提供的
yaffs2文件系统下的lib文件拷贝过来。
# cp -rfd /2440/root_qtopia/lib/* /2440/rootfs/lib/
拷贝经过交叉编译的库文件,参数-d,保持库文件的链接关系。
4. 交叉编译busybox
解压缩tar -zxf busybox1.13.3.tar
解压后修改Makefile,指明交叉编译器:
ARCH ?= arm
CROSS_COMPILE ?= arm-linux-
5.执行make CONFIG_PREFIX=/2440/rootfs install
在/2440/rootfs目录下生成sbin,usr目录和linuxrc文件
6.创建etc目录下文件
在rootfs/etc目录下创建一个inittab文件
内容如下:
# /etc/inittab
::sysinit:/etc/init.d/rcS
s3c2410_serial0::askfirst:-/bin/sh
::ctrlaltdel:/sbin/reboot
::shutdown:/bin/umount -a -r
创建etc/init.d/rcS文件
#!/bin/sh
ifconfig eth0 192.168.1.17
mount -a
mkdir /dev/pts
mount -t devpts devpts /dev/pts
echo /sbin/mdev > /proc/sys/kernel/hotplug
mdev -s
最后还要改变它的属性使它能够执行。
chmod +x etc/init.d/rcS
创建etc/fstab文件
#device mount-point type options dump fack order
proc /proc proc defaults 0 0
tmpfs /tmp tmpfs defaults 0 0
sysfs /sys sysfs defaults 0 0
tmpfs /dev tmpfs defaults 0 0
7.构建其他目录
mkdir proc mnt tmp sys root
8.使用mkyaffsimgae命令生成yaffs映像文件
mkyaffsimage rootfs rootfs.yaffs
9.通过supervivi将内核映像zImage和rootfs.yaffs下载到开发板上
启动内核出现
USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver ftdi_sio
ftdi_sio: v1.4.3:USB FTDI Serial Converters Driver
USB Serial support registered for pl2303
usbcore: registered new interface driver pl2303
pl2303: Prolific PL2303 USB to serial adaptor driver
mice: PS/2 mouse device common for all mice
s3c2440-i2c s3c2440-i2c: slave address 0x10
s3c2440-i2c s3c2440-i2c: bus frequency set to 98 KHz
s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled
TCP cubic registered
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
yaffs: dev is 32505858 name is "mtdblock2"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
yaffs_read_super: isCheckpointed 0
VFS: Mounted root (yaffs filesystem) on device 31:2.
Freeing init memory: 132K
Kernel panic - not syncing: Attempted to kill init!
后来对比友善之臂的menuconfig把Kernel Features改为
Kernel Features --->
Memory split...--->
[ ]preemptible Kernel...
[*]Use the ARM EABI to compile the kernel
[*] Allow old ABI binaries to run ......
Memory model (flatMemory)--->
[ ]Add lru list to tarck non-evictable pages
解决问题
以下为启动信息,可能还有点小问题以后解决
VIVI version 0.1.4 (root@capcross) (gcc version 2.95.3 20010315 (release)) #0.1.4 Mon Oct 27 10:18:15 CST 2008
MMU table base address = 0x33DFC000
Succeed memory mapping.
DIVN_UPLL0
MPLLVal [M:7fh,P:2h,S:1h]
CLKDIVN:5h
+---------------------------------------------+
| S3C2440A USB Downloader ver R0.03 2004 Jan |
+---------------------------------------------+
USB: IN_ENDPOINT:1 OUT_ENDPOINT:3
FORMAT: +++
NOTE: Power off/on or press the reset button for 1 sec
in order to get a valid USB device address.
NAND device: Manufacture ID: 0xec, Chip ID: 0x76 (Samsung K9D1208V0M)
Found saved vivi parameters.
Press Return to start the LINUX/Wince now, any other key for vivi
Copy linux kernel from 0x00050000 to 0x30008000, size = 0x00200000 ... done
zImage magic = 0x016f2818
Setup linux parameters at 0x30000100
linux command line is: "noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0"
MACH_TYPE = 362
NOW, Booting Linux......
Uncompressing Linux.......................................................................................................... done, booting the kernel.
Linux version 2.6.29 (root@LINUX) (gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72) ) #4 Wed Apr 15 10:29:11 HKT 2009
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
CPU: VIVT data cache, VIVT instruction cache
Machine: SMDK2440
ATAG_INITRD is deprecated; please update your bootloader.
Memory policy: ECC disabled, Data cache writeback
CPU S3C2440A (id 0x32440001)
S3C24XX Clocks, (c) 2004 Simtec Electronics
S3C244X: core 405.000 MHz, memory 101.250 MHz, peripheral 50.625 MHz
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0
irq: clearing pending status 02000000
irq: clearing subpending status 00000002
PID hash table entries: 256 (order: 8, 1024 bytes)
Console: colour dummy device 80x30
console [ttySAC0] enabled
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 61420KB available (3024K code, 270K data, 132K init)
Calibrating delay loop... 201.93 BogoMIPS (lpj=504832)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 716 bytes
NET: Registered protocol family 16
S3C2410 Power Management, (c) 2004 Simtec Electronics
S3C2440: Initialising architecture
S3C2440: IRQ Support
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
DMA channel 0 at c4808000, irq 33
DMA channel 1 at c4808040, irq 34
DMA channel 2 at c4808080, irq 35
DMA channel 3 at c48080c0, irq 36
S3C244X: Clock Support, DVS off
bio: create slab at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
NetWinder Floating Point Emulator V0.97 (extended precision)
yaffs Apr 15 2009 10:21:24 Installing.
msgmni has been set to 120
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
Console: switching to colour frame buffer device 30x40
fb0: s3c2410fb frame buffer device
lp: driver loaded but no devices found
ppdev: user-space parallel port driver
Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440
brd: module loaded
loop: module loaded
dm9000 Ethernet Driver, V1.31
Uniform Multi-Platform E-IDE driver
ide-gd driver 1.18
ide-cd driver 5.00
Driver 'sd' needs updating - please use bus_type methods
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c2440-nand s3c2440-nand: Tacls=3, 29ns Twrph0=7 69ns, Twrph1=3 29ns
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)
Scanning device for bad blocks
Creating 3 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x000000000000-0x000000050000 : "vivi"
0x000000050000-0x000000250000 : "kernel"
0x000000250000-0x000003ffc000 : "rootfs"
usbmon: debugfs is not available
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
usbcore: registered new interface driver libusual
usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver ftdi_sio
ftdi_sio: v1.4.3:USB FTDI Serial Converters Driver
USB Serial support registered for pl2303
usbcore: registered new interface driver pl2303
pl2303: Prolific PL2303 USB to serial adaptor driver
mice: PS/2 mouse device common for all mice
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
s3c2440-i2c s3c2440-i2c: slave address 0x10
s3c2440-i2c s3c2440-i2c: bus frequency set to 98 KHz
s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled
TCP cubic registered
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
yaffs: dev is 32505858 name is "mtdblock2"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
yaffs_read_super: isCheckpointed 0
VFS: Mounted root (yaffs filesystem) on device 31:2.
Freeing init memory: 132K
ifconfig: SIOCSIFADDR: No such device
Please press Enter to activate this console.
定制mini2440 wince启动界面
定制mini2440 wince启动界面过程
我的显示屏是3.5寸的,所以应该按照分辨率制作一张240*320像素的图片。
详细步骤如下:
1、我用photoshop的制作的,如下图:

2、用bmp2T.exe转换这个图片,在命令符下输入bmp2T空格图片名称,如
>bmp2T forhibaidu.bmp
很快就能转换好,生成同名的forhibaidu.H文件
内容格式如:
static const unsigned short FORHIBAIDU[]={
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000还有很多字符
3、修改*:WINCE500PLATFORMsmdk2440KERNELHAL下 的samsung_n35.c内容
*代表你装pb的盘符。
只要修改const unsigned short ScreenBitmap_A70[]={以下内容即可,可以直接从forhibaidu.H里复制的。
保存后,打开PB编译你的OS。
然后在烧录到你的开发版即可。
其他尺寸的显示屏,只要制作相符的图片,修改*:WINCE500PLATFORM smdk2440KERNELHAL下相应的.c文件即可,samsung_a70.c(7寸屏) samsung_n35.c(3.5寸) samsung_vga1024x768.c(VGA)
goodluck :)
WINCE启动桌面的定制(转贴)
Windows CE.NET的桌面确实漂亮,但是如果我们的嵌入式系统使用微软的桌面,总让我感觉不伦不类。因此,要想个办法,让我们的程序开机启动,把微软的那个桌面 给替换掉。
其中使用startup的快捷方式再加上隐藏任务栏的方法,效果非常的好,但是每次启动的时候,总是微软的桌面先出来,再启动我们的程序,感觉还是不爽。
最近发现一种方法,
1) 首先新建工程,把你的应用程序放到内核里面去(前面介绍了如何做);
2) 编译平台;
3) 修改shell.reg的文件 :
在文件中有这样一行:
[HKEY_LOCAL_MACHINEinit]
"Launch50"="explorer.exe"
"Depend50"=hex:14,00, 1e,00
把这个explorer.exe改成你的应用程序(比如:MyApp.exe)就可以了;
4) Platform Builder IDE:【Build】->【Make Image】(记得千万不要Build或者Rebuild)
5) 成功后,得到的NK.bin(或NK.nb0)就包含了应用程序MyApp.exe和MyApp.lnk,当把相应的内核烧入开发板MyApp程序就会在 系统启动时自动运行。
至此,随心所欲的让自己的程序在Windows CE系统启动时自动运行了,一个字,爽!
注意:如果自己的程序有关闭退出之类的按钮,切忌不要点击,最后做到让其消失!!!
详解WINCE的控制面板(转)
//========================================================================
//TITLE:
// 详解WINCE的控制面板
//AUTHOR:
// norains
//DATE:
// Tuesday 29-August-2006
//========================================================================
曾经在我的一篇《控制面板的创建》中介绍过WinCE控制面板的结构,不过由于那篇文章其目的只在于控制面板如何调用EXE程序,故对控制面板也仅是泛泛 而谈.不过在这篇文章中,我们将对WinCE的使用方法来个整体的详解.
1.控制面板的结构
控制面板其实也是个动态链接库,区别只在于后缀名为.cpl,以及对外接口为CPlApplet().
接口的原型为:
LONG CALLBACK CPlApplet(HWND hwndCPL,UINT message, LPARAM lParam1, LPARAM lParam2)
在接口函数中我们需要实现特定几个消息的响应,控制面板才能正常运作.为方便观察,在这里直接贴出消息的响应结构:
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// The entry point to the Control Panel application.
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
extern "C" LONG CALLBACK CPlApplet(HWND hwndCPL,UINT message, LPARAM lParam1, LPARAM lParam2)
{
switch (message)
{
case CPL_INIT:
// Perform global initializations, especially memory
// allocations, here.
// Return 1 for success or 0 for failure.
// Control Panel does not load if failure is returned.
return 1;
case CPL_GETCOUNT:
// The number of actions supported by this Control
// Panel application.
return 1;
case CPL_NEWINQUIRE:
{
// This message is sent once for each dialog box, as
// determined by the value returned from CPL_GETCOUNT.
// lParam1 is the 0-based index of the dialog box.
// lParam2 is a pointer to the NEWCPLINFO structure.
return 0; //means CPLApplet succeed
return 1; // Nonzero value means CPlApplet failed.
}
case CPL_DBLCLK:
{
// The user has double-clicked the icon for the
// dialog box in lParam1 (zero-based).
return 0; // CPlApplet succeed.
return 1; // CPlApplet failed.
}
case CPL_STOP:
// Called once for each dialog box. Used for cleanup.
case CPL_EXIT:
// Called only once for the application. Used for cleanup.
default:
return 0;
}
return 1; // CPlApplet failed.
} // CPlApplet
这几个消息的作用分别是:
CPL_INIT:初始化,可以在这分配内存等等.
CPL_GETCOUNT:返回控制面板程序的个数.因为一个.cpl文件中,可能包含多个Applets.
CPL_NEWINQUIRE:返回包含程序名和图标信息的NEWCPLINFO结构
CPL_DBLCLK:双击时响应
CPL_STOP:单个组件退出时响应,用来清除资源内存等
CPL_EXIT:退出整个cpl程序时响应
这些消息的定义可以在cpl.h中找到
2.在explorer中使用
如果定制的系统中带有explorer UI,只要把编译好的文件放进"windows",然后再打开"控制面板"就可以看到.
3.如何调用.cpl
就像PC机中.dll文件不能直接运行,需要借助rundll32.exe来运行一样,WinCE下的.cpl也需要相应的程序来调用,这个程序就 是:"ctlpnl.exe".
比如我们需要调用系统自带的cplmain.cpl的"电源管理",只要在开始菜单的运行中输入:"ctlpnl.exe windowscplmain.cpl,5".在路径后面紧跟的"5"只是因为"电源管理"在cplmain.cpl中输入第五个Applet而已.
由此我们不难得出在程序中运用ShellExecuteEx()函数调用控制面板的Applet的方法.以下这段代码,效果和在命令行中输入命令一样,也 是调用"电源管理".
SHELLEXECUTEINFO info;
TCHAR szControlPanelCmdLine[ 200 ];
swprintf( szControlPanelCmdLine, L"\windows\cplmain.cpl,5");
info.cbSize = sizeof( info );
info.fMask = SEE_MASK_NOCLOSEPROCESS | SEE_MASK_FLAG_NO_UI;
info.lpVerb = NULL;
info.lpFile = TEXT("ctlpnl.exe");
info.lpParameters = szControlPanelCmdLine;
info.lpDirectory = NULL;
info.nShow = SW_SHOW;
info.hInstApp = NULL;
ShellExecuteEx( &info );
如果想调用cplmain.cpl的其它Applet,只要把数字改为相对应的即可.
以下所列的第一项序号为0,接下的为1,其后的继续递增.
0 CPL_Comm
1 CPL_Dialing
2 CPL_Keyboard
3 CPL_Password
4 CPL_Owner
5 CPL_Power
6 CPL_System
7 CPL_Screen
8 CPL_Mouse
9 CPL_Stylus
10 CPL_Sounds
11 CPL_SIP
12 CPL_Remove
13 CPL_DateTime
14 CPL_Certs
15 CPL_Accessib
4.系统自带控制面板的代码
微软对控制面板的代码是完全公开的,如果安装的是PB4.2,代码可以在"PUBLICWCESHELLFEOAKCTLPNL"中找到.
CTLPNL文件夹中有九个文件夹,分别对应不同的CPL文件:
ADVBACKLIGHT:高级背光灯管理
BTHPNL:蓝牙
CONNPNL:拨号网络
CONTROL:主控制台,我们在explorer中看到的"控制面板"应该就是这个
CPLMAIN:会生成cplmain.cpl,控制面板的大多数选项均源自于此
CTLPNL:和CONTROL相关联的
DMPNL:没使用过,不太清楚.不过查看rc文件应该是设置上网的.
INTL2:区域和语言设置
STGUI:存储器管理
PPC winform 程序 如何 全屏(C#)(转)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Text;
namespace Hello_World
{
public partial class StartForm : Form
{
private Timer timer;
public StartForm()
{
InitializeComponent();
IntPtr hWnd = API.FindWindow(this.Text);
if (hWnd != IntPtr.Zero)
{
System.Diagnostics.Debug.WriteLine("hWnd ist nicht null");
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Focus();
SHAPI.SetForegroundWindow(hWnd);
SHAPI.FullScreen(hWnd);
}
}
}
public class API
{
[DllImport("coredll.dll", EntryPoint = "FindWindow")]
private extern static IntPtr FindWindow(string lpClassName, string lpWindowName);
public static IntPtr FindWindow(string windowName)
{
return FindWindow(null, windowName);
}
}
public class SHAPI
{
public const int SHFS_SHOWTASKBAR = 1;
public const int SHFS_HIDETASKBAR = 2;
public const int SHFS_SHOWSIPBUTTON = 4;
public const int SHFS_HIDESIPBUTTON = 8;
public const int SHFS_SHOWSTARTICON = 16;
public const int SHFS_HIDESTARTICON = 32;
[DllImport("aygshell.dll")]
private extern static bool SHFullScreen(IntPtr hWnd, int dwState);
public static bool FullScreen(IntPtr hWnd)
{
return SHFullScreen(hWnd, SHFS_HIDESTARTICON | SHFS_HIDETASKBAR);
}
[DllImport("coredll.dll")]
internal static extern int SetForegroundWindow(IntPtr hWnd);
}
}
下面的代码仅仅隐藏开始菜单但程序退出后会重现:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Text;
namespace Wm5ppc
{
public partial class Form1 : Form
{
public Form1 ()
{
InitializeComponent ();
this.MinimizeBox = false;
}
private void Form1_Activated (object sender, EventArgs e)
{
IntPtr hWnd = this.Handle;
SHAPI.FullScreen (hWnd);
}
}
public class SHAPI
{
public const int SHFS_SHOWTASKBAR = 1;
public const int SHFS_HIDETASKBAR = 2;
public const int SHFS_SHOWSIPBUTTON = 4;
public const int SHFS_HIDESIPBUTTON = 8;
public const int SHFS_SHOWSTARTICON = 16;
public const int SHFS_HIDESTARTICON = 32;
[DllImport ("aygshell.dll")]
private extern static bool SHFullScreen (IntPtr hWnd, int dwState);
public static bool FullScreen (IntPtr hWnd)
{
return SHFullScreen (hWnd, SHFS_HIDESTARTICON);
}
}
}
以上代码本人经过测试,好像不是很稳定,试过几次是可以全屏的,连开始菜单也没有了,现在一直都没办法全屏,我测试的系统是WINCE5,不知道是 不是漏了哪个步骤没做好。
Platform builder5.0(PB5.0) 如何安装在Win 2003 操作系统上
Windows CE 5.0 Platform Builder 安装环境如下:
Windows 2000 SP4 或 XP SP1
无法安装在2003操作系统下。
解决方法:
修改 Microsoft Windows CE 5.0.msi 文件 。
步骤:
1、下载 Orca, 并安装运行
2、用Orca打开Microsoft Windows CE 5.0.msi
3、在左边一列中可以找到一个叫做 LaunchCondition 的项
(MsiNTProductType=1 OR BYPASSSERVERCHECK="Yes") AND ((VersionNT=500 AND
ServicePackLevel>=4) OR (VersionNT=501 AND ServicePackLevel>=1) OR
(VersionNT>501))
删除该项
4、保存
5、重新运行
基于Armv4I WINCE 5.0 应用程序开发环境搭建(C# VS2005或者VS2008)
这里说的开发环境是指:VS2005或者2008这样的IDE,开发语言C#,也就是在WINCE上进行.NET CF开发
主要分为两步:
a.准备必要的目标平台SDK;针对目标硬件平台通过Platform生成的SDK或者是厂商提供SDK(本文主要针对 Armv4i 平台,因此SDK是定制生成的)
b.安装该SDK,在VS2005等进行一些设置即可.
1.这里先提下目标平台SDK的生成(通过PB5.0),作为备忘吧.WINCE 应用程序开发可以并不需要了解SDK的生成,只需要知道用现成的SDK(由平台开发人员通过PB生成或者厂商提供的SDK)配合vs2005或者2008 进行一些配置即可.这个步骤主要是供给PB DEVELOPER 参考用,说不定哪天俺也开发这个哈
前提条件是wince5.0相关开发环境的要安装好.这里主要只PB5.0,安装wince5.0过程中会自带安装好pb5.0,这一步很简单,可 以直接看wince5.0的安装文档说明或者网上资源;安装的时候勾选arm 和x86两个平台就足够了.
有了wince5.0的开发环境后.就需要安装相应的 Device Emulator BSP(这里主要指 ARM平台)Device Emulator BSP 下载;
安装好这个BSP后,在%winceroot%/PLATFORMDeviceemulator 这个目录下有这个文件Using the CE DeviceEmulator.rtf.如图:
按照这个文件的操作一步步执行即可完成相应的SDK的制作,按照 这个文件制作出来的只是一个演示SDK,实际的SDK要根据相应的开发版进行OS定制.其中需要注意的是:
为了支持托管代码.net cf和ActiveSync需要
1.For supporting the managed app development experience in VS 2005, SYSGEN_WCELOAD is required
Catalog View: Core OS->Windows CE Devices->Applications – End User->CAB File Installer/Uninstaller
2.Adding ActiveSync is optional (SYSGEN_AS_BASE)
另外作为演示俺也是选择默认的Microsoft DeviceEmulator:Armv4i,而不是开发版对应的SamSung SMDK2410 :ArmV4i
其他就是配置 Configure your Device Emulation device settings文件,俺会提供一 个俺修改的文件,里面有注释更加好找.
配置这个文件ExportSdk.sdkcfg的时候需要用到Guid生成工具.MS的开发工具一般都有带guidgen.exe,搜索一下就有. 或者直接这边找一个http://www.guidgen.com/Index.aspx
另外参考文档中作者说不能选择Enterprise Web Pad这样的模板工程,俺就是选择这样的工程生成俺的SDK,没有发现任何问题,呵呵看来很多都是都是要实践啊~~~~ 啊~~~~-_-!!!
最后就是按照Using the CE DeviceEmulator.rtf 这个文档生成SDK即可.
2.有了SDK就可以开始配置应用程序开发环境了.For App developer
a.首先安装SDK(这里俺生成的为"mytest_SDK.msi")
在选择Features项目时候,可以不选择'Embedded VC++'毕竟这个是用C++进行开发.如下图所示:
b.安装好SDK后.就可以开始配置VS2005了(说明这里以2005为例,2008类似设置,俺测试通过)
1.运行vs2005,Goto Tools->Options. Expand the “Device Tools” node on left and select “Devices”,选择你对应的平台,这里俺的是"mytest",同时选择相应的设备,俺这里是"airwolf2026Test"如下图所示:
2.选择上图中的"属性",并保证"传输"选择"DMA传输",如下图:
这里有个问题,就是俺如果把"传输"选择 TCP/IP,VS2005就无法启动模拟器了....会提示说'设备未就绪'等.这个不知道该怎么解决...有知道的麻烦告诉俺下哈.谢谢.
3.在"仿真器选项"中设置颜色和屏幕分辨率等,如下:
其他几个选项比如'网络',外网设备'等俺还没有研究...初学...
然后就可以关闭这个相应的对话框了,ok接下来可以写一个Demo程序跑一下,看看环境是否搭好了.
4.从vs2005 '文件'菜单->>新建项目,选择'智能设备'-->WINCE 5.0,选择项目类型:设备应用程序,名字这里叫'DEMOTest",如下图:
然后和普通Winform开发类似,放置一个Button,在它的单击事件出show出一句话.顺便测试下俺这个添加了中文支持的SDK是否可以正 常显示中文哈.然后就是启动调试,程序编译好,会弹出对 话框要求选择'部署位置',俺这边就选择airwolf2026Test,如下:
看看相应的模拟器和程序有没有起来.如果有起来,那么恭喜,环境搭建成功
最后看看效果吧:
呃,看来俺添加的中文支持没有效果....这 个...
最后附上参考文档:
How to locate core operating system fixes for Microsoft Windows CE Platform Builder products这 个KB说明了WinCE更新包相关的一些策略,比如它发布年更新包的时候,会把该年份之前的月更新包移除下载站点,因此为了给PB5.0添加.NET CF2.0或者3.5支持.只需要安装2007年全年更新包,或者另加2008,01月更新包即可.原来在一些论坛上很多人说要先安装之前的更新包... 找的半死都没有找到....
修改后的ExportSDK.sdkcfg在默认皮肤这节可能重复了.呵呵












