45
Windows CE 操操操 操操 5 Windows CE 操操 操操

Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Embed Size (px)

Citation preview

Page 1: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

5 Windows CE 操作系统实验

Page 2: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

内容

• 1 、安装 Windows CE BSP

• 2 、 Windows CE 内核定制• 3 、 WINCE 和桌面系统通讯 • 4 、 Windows CE 应用程序编写 • 5 、 Windows CE 驱动程序编写

Page 3: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

安装 Windows CE BSP

• 1 、安装 Windows CE

按照提示进行设置,并选择安装路径,

安装过程请使用“ Custom Setup” ,并在“ Custom Setup” 对话框中按照下

图进行设置。 安装过程中请将系统中安装的杀毒软件关

Page 4: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

安装 WINDOWS CE 4.2 BSP

• 1 、只读属性一定要去掉,而且包括 SMDK2410 及其下所有目录和文件。

• 2 、在 WINDWOS 2000 或者 WINDOWS XP 中请点击 SMDK2410 的右键菜单属性,如下图对话框中,去掉“只读”,并点击“确定”按钮。并在新弹出的对话框中选择“将更改应用于文件夹、子文件夹和文件”,并点击“确定”按钮。

Page 5: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

Windows CE 内核定制实验

• 1 、特性安装( Catalog Installation )

• 2 、创建和编译新项目

• 3 、运行 image 文件

Page 6: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

特性安装( Catalog Installation )

Page 7: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

特性安装( Catalog Installation )

点击 Remove 点击 Import

新增加的特性

Page 8: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

创建和编译新项目

Page 9: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

创建和编译新项目

定制应用程序支持

Page 10: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

创建和编译新项目

定制网络和通讯连接

Page 11: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

创建和编译新项目

Page 12: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

创建和编译新项目点击” Build”->”Build Platform” 菜单开

始编译

编译成功

Page 13: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

创建和编译新项目

• 1 、如果编译成功 WINCE420\PUBLIC\SMDK2410\RelDir\SAMSUNG_SMDK2410_ARMV4Release 目录下将生成 nk.bin 、 nk.nb0 等文件。

Page 14: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

运行 image 文件 • 1 、设置并建立 tftp 服务器

设置之前请将您的注意的 IP 地址修改为 192.168.1.180 。

下载和运行 image 文件需要首先在主机端建立 tftp 服务器,在 Windows 环境中建立 tftp 服务器请使用光盘中 tools\tftpd32j\tftpd32.exe 文件。运行后请点击“ Browse” 按钮选择 tftp 服务器目录,如图所示,设置 d:\tftpboot\ 目录为 tftp 服务器根目录。

Page 15: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

通过 uboot 下载 nk.nb0

• 1 、首先将 nk.nb0 拷贝到 tftp 服务器目录 d:\tftpboot

Page 16: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

WINCE 端设置

• 1 、运行 WINCE

• 2 、按照如下提示在 WINCE 中进行设置:打开【我的电脑】 -> 【控制面板】 -> 【网络和拨号连接】 -> 【新建连接】,并在“新建连接”设置对话框中,选择连接类型为“直接连接”,并点击“下一步”按钮。

系统将弹出一个“设备对话框”,在该对话框的“选择设备”下拉列表中选择“ S3C2410 USB CABLE:” ,然后点击“完成”按钮。这时将在“连接”中添加“我的连接”图标。

Page 17: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

WINCE 端设置 回到“控制面板”,点击【 PC 连接】图标,进入“ PC连接属性”设置对话框,选中“启用与桌面计算机的直接连接”的复选框,然后再点击“更改连接”按钮,在“更改连接”设置对话框的下拉列表框中选择刚才建立的连接“我的连接”,然后按“ OK” 按钮退出。

• 注意:• (1) 如果此时触摸屏出现校准不正确的情况,请参考附录 G 进行触摸屏的校准工作。

• (2) 请使用光盘中的 WINCE 映象文件或者 2.4 节编译出来的映象文件,不能使用 2.2 节章中的映象文件, 2.2 中生成的映象文件有许多特性不支持,需要添加进去才可以。

Page 18: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

activeSync 安装

• 1 、首先在主机端安装 activeSync 程序。该安装程序在 WINCE420\tools 目录下的MSASYNC.exe 。双击该文件开始安装。

Page 19: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

通讯

• 1 、在我的电脑中双击“移动设备”将打开 WINCE 同步目录,可以和操作 WINDOWS 其它目录一样操作该目录,包括拷贝文件到该目录已经将文件从该目录拷贝到 PC 机。

Page 20: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

下载并安装 Microsoft eMbedded Visual C++ 4.0

• 1 、下载 Microsoft eMbedded Visual C++ 4.0 :下载 Microsoft eMbedded Visual C++ 4.0 :http://download.microsoft.com/download/

WindowsCENETPlatformBuilder/Install/4.0/NT5XP/EN-US/eVC4.exe

• 2 、下载 Microsoft eMbedded Visual C++ 4.0 SP4 :请从如下地址下载 Microsoft eMbedded Visual C++ 4.0

SP4 : http://download.microsoft

.com/download/a/7/3/a735c7fb-dcbd-429f-9090-d09b3b15d3fa/evc4sp4.exe

Page 21: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

下载并安装 Microsoft eMbedded Visual C++ 4.0

• 3 、安装 Microsoft eMbedded Visual C++ 4.0先将 eVC4.exe 解压缩。然后执行解压后目录的 setup.exe 文件开始安装 Mic

rosoft eMbedded Visual C++ 4.0 。安装之前必须已经正确安装 PB4.2 ,且关闭了所有的 PB 程序。另外,请关闭 norton 等杀毒工具。安装过程建议使用缺省设置。安装过程请使用 cdkey.txt 文件中的 cdkey 。

执行 sdk 目录下的 setup.exe 文件开始安装 Platform SDK 。安装过程建议使用缺省设置。

Page 22: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

下载并安装 Microsoft eMbedded Visual C++ 4.0

• 4 、安装 Microsoft eMbedded Visual C++ 4.0 SP4 :先将 eVC4SP4.exe 解压缩。然后执行解压后目录的 setup.exe 文件开始安装 Micros

oft eMbedded Visual C++ 4.0 SP4 。安装之前必须已经正确安装 PB4.2 以及 Microsoft eMbedded Visual C++ 4.0 ,且关闭了所有的 PB 程序。另外,请关闭 norton 等杀毒工具。安装过程建议使用缺省设置。

•  5 、检查安装:如果安装正确,如图所示执行开始菜单下的 eMbedde

d Visual C++ 4.0

Page 23: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

建立 HelloWorld 工程

• 1 、创建 HelloWorld 工程选择 File 菜单的 New 菜单项,出现如下图所示对话框

选择 WCE Application

Page 24: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

建立 HelloWorld 工程 选择 Build 菜单下的Rebuild All 菜单项对

工程进行编译

Page 25: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

建立 HelloWorld 工程

Page 26: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

下载并运行 HelloWorld • 1 、首先检查硬件连接,要求:

▲ JXARM9-2410 的 UART0 连接至计算机串口;▲ JXARM9-2410 与计算机连接至局域网并建立 tftp服务器。

▲ 将 JXARM9-2410 实验箱左上角的 JP3 和 JP4跳线分别跳到右边(核心板一侧)。

▲ 用 USB线将 JXARM9-2410 实验箱的 SLAVE USB插座与计算机 USB 接口相连。

• 2 、按照第二章的内容通过 uboot 下载 nk.nb0 ,并运行 WinCE image 文件。运行的结果将在 LCD 上出现 WINCE 启动界面。

Page 27: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

下载并运行 HelloWorld

• 3 、按照“第 3 章”的内容实现 WINCE和桌面系统之间的连接并正确安装 activeSync 。

• 4 、如果连接正确,将上节生成的 HelloWorld.exe 文件拷贝到“移动设备”下的“ My Documents” 目录。如下面两图所示。

Page 28: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

下载并运行 HelloWorld

Page 29: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

• 5 、此时 HelloWorld.exe 文件已经被拷贝到 WINCE 中,在 WINCE 中,点击“我的电脑”中的“ My Documents” 目录,如果已经存在 HelloWorld.exe 程序请双击该文件,将开始运行 HelloWorld 程序。注意: (1) 如果此时触摸屏出现校准不正确的情况,请参考附

录 G 进行触摸屏的校准工作。 (2) 请使用光盘中的 WINCE 映象文件或者 2.4 节编译出

来的映象文件,不能使用 2.2 节章中的映象文件, 2.2中生成的映象文件有许多特性不支持,需要添加进去才可以。

下载并运行 HelloWorld

Page 30: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

• 1 、 WINCE 驱动程序模型 • 2 、本机设备驱动程序的系统结构 • 3 、流接口驱动程序的系统结构 • 4 、设备文件名 • 5 、流接口驱动程序入口函数 • 6 、流接口驱动程序开发 • 7 、流接口驱动程序调用实例 • 8 、运行

Windows CE 驱动程序实验

Page 31: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

• 1 、本机设备驱动程序WINCE是可移植的,将它移植到目标平台上,必须

为在平台上已建立的设备提供驱动程序。一些类型的设备,如键盘、显示器等,对操作系统都有一定的接口。因为这些接口是专门用于 WINCE 的,所以这类设备的驱动程序称作本机设备驱动程序。

•2 、流接口驱动程序 流接口驱动程序是一般类型的设备驱动程序。流接口

驱动程序表现为在用户一级的动态链接库 DLL ,用来实现一组固定的函数称为流接口函数,这些流接口函数使得应用程序可以通过文件系统访问这些驱动程序。

Windows CE 驱动程序实验

Page 32: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

• 1 、单片驱动程序和分层的驱动程序

本机设备驱动程序的系统结构

GWES 设备管理器

硬件

DDI 函数 DDI 函数 流接口函数

单片设备驱动程序

设备驱动程序

MDD 层

PDD 层

设备驱动程序

MDD 层

PDD 层

DDSI 函数 DDSI 函数

Page 33: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

• 1 、流接口驱动程序是以动态链接库形式存在的,由设备管理器统一加载、管理和卸载。

•2 、为了与外围设备进行交互,流接口驱动程序通常使用本机设备驱动程序所提供的 DDSI函数来使用本机设备驱动程序。

•3 、流接口驱动程序的主要任务就是把外设的使用传递给应用程序,这是通过把设备表示为文件系统的一个特殊文件实现的。对于串口 1在用户级别的程序里面通常被描述为 COM1 。

流接口驱动程序的系统结构

Page 34: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

• 1 、在 WINCE 中应用程序通过文件系统里的特殊入口访问外围设备。 WINCE 中的文件系统代码包括那些识别特殊文件名并重定向 IO 操作到适当的流接口驱动程序的代码。

•2 、 WINCE 的设备文件名是由三个大写字母、一个数字和冒号组成的,例如“ COM1:” 。 WINCE使用前面三个字母来识别与特殊流接口驱动程序相对应的特殊设备。文件名前缀存储在称作“ Prefix” 的注册表键值中,一般来说如果用户想生成自己的流接口驱动程序,就要指定这三个字母的前缀。它可以是任意三个字母。

设备文件名

Page 35: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

•3 、 WINCE 设备文件名中的数字是用来区分由同一个流接口驱动程序管理的所有设备。设备管理器对索引的编号默认是从 1 到 9 , 1 用于第一个设备文件名,如果需要 10 个文件名可以把 0也用上。

设备文件名

Page 36: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

•1 、每个流接口驱动程序必须实现一组标准的函数,用来完成标准的文件 IO函数和电源管理函数,这些函数提供给WINCE 内核使用。这些函数通常叫做流接口驱动程序的 DLL 接口。

流接口驱动程序入口函数

Page 37: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

•1 、 XXX_Open •2 、 XXX_Close •3 、 XXX_Init •4 、 XXX_Deinit •5 、 XXX_Read •6 、 XXX_Write •7 、 XXX_IOControl

流接口驱动程序入口函数

Page 38: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

•1 、在 EVC 中新建一个工程

流接口驱动程序开发

Page 39: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

流接口驱动程序开发

Page 40: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

•1 、编辑 TestDRV.cpp •2 、新建并编辑 TestDRV.def 文件 •3 、编译工程 •4 、打开 PB ,并点击“ Open Workspace” ,选择第 1 章中的 SMDK2410 工程。目录为 E:\WINCE420\PUBLIC\SMDK2410 。

•5 、修改 platform.bib 文件 •6 、修改 platform.reg 文件 •7 、编译

流接口驱动程序开发

Page 41: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

void CTestDRVDlg::OnBtnOpen() {// Open the device filehStr=CreateFile(TEXT("TST1"), GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,0);if(INVALID_HANDLE_VALUE==hStr){

::MessageBox(NULL, _T("Cannot open TST1:"),_T("TestDRV"), MB_OK);}else{

::MessageBox(NULL, _T("Open TEST1: Succed"),_T("TestDRV"), MB_OK);}

}

流接口驱动程序调用实例

Page 42: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

void CTestDRVDlg::OnBtnClose() {

if(hStr!=NULL){

CloseHandle(hStr);hStr=NULL;

}}

流接口驱动程序调用实例

Page 43: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

void CTestDRVDlg::OnBtnRead() {

WCHAR wch[256];DWORD dwBytesRead=256;memset(&wch, '\0', 256*sizeof(WCHAR));::ReadFile(hStr, wch, sizeof(wch), &dwBytesRead, NULL);::MessageBox(NULL, wch, TEXT("TestDRV"), MB_OK);

}

流接口驱动程序调用实例

Page 44: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

void CTestDRVDlg::OnBtnWrite() {

DWORD dwWritten=0;WCHAR* pString = TEXT("This is a test of WINCE device driver. This is only a test");::WriteFile(hStr, pString, (_tcslen(pString) + 1), &dwWritten, NULL);

} void CTestDRVDlg::OnBTNIOControl() {

::DeviceIoControl(hStr, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

}

流接口驱动程序调用实例

Page 45: Windows CE 操作系统实验 5 Windows CE 操作 系统实验. Windows CE 操作系统实验 内容 1 、安装 Windows CE BSP 2 、 Windows CE 内核定制 3 、 WINCE 和桌面系统通讯

Windows CE 操作系统实验

•1 、将 6.3 节编译生成的 nk.nb0 下载到教学系统中运行。

•2 、拷贝 6.4 节编译生成的 TestDRV.exe 文件到 WINCE 的 My Documents 目录下,在 WINCE420\image 目录下有该文件,可以拷贝该文件到 WINCE 中。

运行