Windows CE driver development learning notes

Source: Internet
Author: User

The first problem is the classification of the wince driver. According to the book, the driver under CE is divided into a single driver and a layer-based driver, and another saying is that the local driver and the streaming driver. The two types of classification are separated by the guidance of microsun's eldest brother. Here we reference:
"Monomer and layering are just classification from the code form. hierarchical driver code can be divided into PDD and mdd. Generally, Microsoft has implemented MDD and may also implement PDD. We only need to make some modifications to the PDD, such as the audio driver, driver displayed. A single-layer driver writes PDD and MDD together without a strict distinction. Generally, such drivers are relatively simple, such as atadisk.
Local drivers and streaming drivers are classified by interfaces between drivers and other modules (callers) of the system. in fact, the name of the local driver is not appropriate. It may be called a dedicated driver or another name. it refers to the call of its module to give it specific interfaces, such as power drivers and general LED Drivers. The serial port and NIC are the stream interface driver.
Therefore, a driver can be a single stream driver, for example, atadisk. It can also be a hierarchical stream, such as OHCI"
According to my understanding, monomer and layering are driving implementation methods, while local and streaming are driving models. The so-called local driver is that the operating system has reserved special interfaces, streaming refers to the ability to export various streaming interface functions in DLL files.
Second: the driver's functional attributes. A device driver is an interface of the kernel and hardware of the operating system. The operating system defines a set of standard interfaces. The process of writing a driver is to implement these interfaces. From applications to specific hardware, these steps work: Applications-call OS functions-operating systems-driver interfaces-drivers-hardware operation functions-hardware. Drivers in wince all exist in user-mode DLL and need to be loaded into the slot through the process. There are three types of system processes used to load: device.exe, gwes.exe, and filesys.exe.. All the device drivers are loaded through device.exe. Note that the device driver interfaces retained by different operating systems are different, such as Windows and wince on the desktop.
Third, device initialization in wince is divided into two phases: initialization of device.exe; enumeration and loading of peripherals. The process is: power-on-start bootloader-start nk-start Registration Table init key (device.exe start)-Initialize data structure, I/O, power management, etc.-load busenum. DLL (bus enumerator)-enumerate all the sub-keys of driver/buildin in the registry. The enumeration process here is the process of repeatedly calling the ActivateDeviceEx () function to load the driver. After the OS is started, we can use the Pb Remote Registry tool to check the sub keys contained in h_l_m/Drivers/active to see which drivers are loaded with startup.
Fourth: the concept of Stream interface driver. The driver that exposes the stream interface function is the stream driver, which abstracts peripherals into a file. The process is as follows: the application uses the API file to update the device, osreceives the API call filesys.exe, transfers it to device.exe, calls the stream interface, and interacts with the hardware. There are ten stream interface functions, including xxx_init, xxx_deinit, xxx_open, xxx_close, xxx_read, xxx_write, xxx_powerup, xxx_powerdown, xxx_seek, and xxx_iocontrol. xxx_preclose and closed are added to wince5.0. the corresponding file APIs in the application include createfile, deviceiocontrol, readfile, writefile, closehandle, and setfilepointer.
Fifth: Write the flow-driven step. There are two ways to achieve this: 1. Write the DLL into a project and add it to the OS. 2. Change the BSP, write the driver in the BSP, and then select the BSP as the OS. The first step is to create a DLL project in Pb, write some input functions, registers, and peripheral declarations, write the dllentry function, implement the stream interface function, and write the DLL export function file. def; write the registry key for the driver and modify the bib file. The second method is to create a directory under platform/bsp/drivers and add the new directory name to the dirs file in the DRIVERS directory. In the new directory, create your source code file and implement the DLL function. Create a file named sources, makefile, and ***. DEF respectively. Modify the platform. Reg and platform. bib files.

 

 

Create a new project in Pb and select geode. After the Wizard is complete, select File and manage catalog

 

Item to add the CER file. Then the catalog item displays intel 8255xer fast

 

Ethernet driver entry, right-click to add it to OS design.

 

Modify config. bib and add epktbuf 801dc000 00020000 reserved in the memory segment

 

Modify platform. bib and add e100ce. dll in the modules section.

 

$ (_ Flatreleasedir)/e100ce. dll NK sh

 

Modify platform. reg to add the modified reg file in the NIC Driver.

 

Copy e100ce. DLL to D:/wince500/platform/geode/files.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.