Wince5.0 provides a standard stream driver format, which greatly facilitates device drivers.Program. However, traditional development methods are often inefficient. The method is as follows:
1. Create a flow-driven DLL project under platform builder.
2. Add a registry key for the stream driver. For example:
[HKEY_LOCAL_MACHINE \ drivers \ builtin \ ircontrol]
"Prefix" = "irc"
"DLL" = "irc. dll"
"Order" = DWORD: 66
"Index" = DWORD: 1
3. Modify the platform. bib file and package the DLL file of the stream driver to NK. Bin.
4. makeimg: generate the NK. Bin containing the stream driver.
The entire process is cumbersome and requires only a slight modification. makeimg is a waste of 3-5 minutes. This development efficiency is very low.
The following two methods are used to quickly develop the wince stream driver in EVC. I have my own experience and share my experience with you. I also hope to learn from each other and discuss with you.
The driver of Wince is not as cumbersome as the development of the desktop Windows Driver. There are several types of windows driver development, such as WDM and VxD. dedicated development environments and tools are required to develop these drivers, it brings a relatively high technical threshold to developers. fortunately, there are not so many restrictions and thresholds for wince driver development. in addition, applications can directly deal with underlying hardware (Note: despite this, I still do not recommend that you directly access the underlying hardware using applications, which is not safe ), even interrupt initialization, interrupt threads can be completed in user-level applications. therefore, it brings a lot of convenience to driver development. in my own experience, there are two methods as follows.
1. Use EVC to generate the driver DLL.
1) Create an evc dll project, andCodeTo the EVC code.
2 ). write the exported file *. def: exports 10 Standard Functions of the stream driver. and mark it in project ---> setting ---> link ---> project options, such as:/DEF: "IR. def ". (If this step is not done, the generated driver will be unavailable)
3 ). compile the code. Some errors may occur at this time. For example, you cannot find the header file or library file. Find the corresponding header file and library file in the installation directory of wince, in tools ---> options ---> directories, specify the path of the header file and library file. In Project ---> setting ---> link, specify the *. OBJ file.Source codeWhich drivers and libraries are called? Go to the wince directory and find the OBJ file link)
4 ). compile an application to debug the driver. use registerdevice/deregisterdevice to dynamically load/uninstall the stream driver and simulate the functions of the wince device management program. (I wrote a stream driver debugging tool based on MIPS CPU. please download trial http://files.cnblogs.com/Jade2009/CE_Driver_Assist.exe.rar
The above method is completely out of the development environment of platform builder, making the development and debugging of the driver as easy and fast as developing an application. you can use the retailmsg function in the driver to output debugging information from the UART port.
Next we will introduce another method, that is, to use EVC to write the driver into EXE and debug the driver just like debugging the application. finally, transplant the source code to the DLL project of the driver. the specific method is similar to the first method. The difference is that the former is to create a pure DLL Project (with an export function), and the latter is to create an mfc exe project. the compiled header file is the same as the library file method 2. the advantage of this method is that it can be directly compiled into the EVC debug project. You can perform single-step tracing debugging and set breakpoints in the source code, greatly improving the debugging efficiency of the driver.