In order to complete the CE operation, it is designed to see the driver under CE. Regret to listen to the class when you have a class ...
1 Drivers and operating systems are bound together in the UNIX & Windows 9x series, run in the core state. But in CE, most drivers are just a DLL file, running at the user state.
2 Most drivers are used to control hardware, but some hardware is not required, such as: CPU, Memory ..., there are also some virtual devices, such as file system driver, RAM Disk
3 CE provides logic interrupt sysIntrs, interrupts only as a thread (IST) under the user state
l
4 Hardware OEMS does not provide the drive on CE, but only a hardware specification (Hardware Specification)
Drive classification:
1 native
2 bus
3 stream interface
First, Native Drive
It is also called Built-IN driver, which is required by the hardware, and is done by OEM design hardware. Such as: keyboard, touch screen ...
General equipment driver interface may not be supported. When the new version of the OS comes out, general Native drivers only do little changes.
Second, BUS driver
Manage system bus, such as PCI bus; PCMICA and CompactFlash are also treated as a bus. Responding to the hardware on the bus to decide what hardware is installed and is allocating resources. The Device Manager will also be required to load a suitable driver for online hardware.
Third, Stream Interface Drive
This will be introduced in detail later.
Drive type:
l
Audio Drivers
l
Battery Drivers
l
Block drivers
l
Bluetooth HCI Transport Driver
l
Direct3D Device Driver Interface
l
DirectDraw Display Drivers
l
Display drivers
l
DVD-Video Renderer
l
IEEE 1394 Drivers
l
Keyboard Drivers
l
Notification LED Drivers
l
Parallel Port Drivers
l
PC Card Drivers
l
Printer Drivers
l
Serial Port Drivers
l
Smart Card Drivers
l
Stream Interface Drivers
l
Touch Screen Drivers
l
USB Drivers
Driven loading process: 1 Most of the drivers are loaded by the device management process when the system is started. 2 and some Buit-IN drivers are loaded by gwes.exe. These drivers include display driving (DDI.DLL), keyboard driver, and touch screen (mouse) Driver 3 Device.exe will view a string called rootkey in [HKEY_LOCAL_MACHINE] / Drivers in the registration table, usually Builtin. The driver list in this rootkey is that the device manager must initialize. [图 1] 4 Load the driver DLL, create an ActiveKey for it (under [HKEY_LOCAL_MACHINE / DRIVERS / ACTIVE), and register this DLL as a device.
3.
[Post figure 2]
5 can also be handled by the application, such as the ActiveDeviceEx function; another old load-driven method is to use: RegisterDevice and DeregisterDevice. Stream Interface
A stream interface driver refers to a drive to expose a stream interface function without considering the type of device controlled by the drive. Typical flow interface drive: File System Drive (iostream, FStream), COM, LPT. . . . . Directly use Win32 file system API: HSER = CreateFile (Text ("COM1:"), Generic_Read, 0, NULL, OPEN_EXSITING, 0, NULL); RC = ReadFile (Hser, & Ch, 1, & Cbytes, NULL); Transmitcommchar (HSER) , 'a'); CloseHandle (HSER); Create a stream-driven process: 1 Write a DLL, put the function of the stream interface expose 2 Create a device driver 3 configuration registry
XXX_Close
Closes the device context Identified by HopenContext.
XXX_Deinit
Called by The Device Manager to de-initialize a device.
XXX_INIT
Called by The Device Manager to Initialize A Device.
XXX_IOCONTROL
Sends a command to a device.
XXX_Open
Opens a device forreading, Writing, or Both. An Application Indirectly Invokes this function1 calls
CreateFile to Open Special Device File Names.
XXX_PowerDown
Ends Power to The Device. It is useful only with devices That Can Be Shut Off Under SoftWare Control.
XXX_Powerup
Restores Power to a Device.
XXX_Read
Reads Data from the Device Identified by The Open Context.
XXX_Seek
Moves The Data Pointer in The Device.
XXX_WRITE
Writes Data to the Device. Registry Configuration:
[HKEY_LOCAL_MACHINE / DRIVERS / BUILTIN / SAMPLE]
"DLL" = "MyDriver.dll"
"Prefix" = "DEM"
"Index" = DWORD: 1
"ORDER" = dword: 0
"FriendlyName" = "demo driver"
"Ioctl" = DWORD: 0
The service under CE is not available before CE4.0, and the service management is added after 4.0.
A CE service is also a DLL, structure, and a stream driver similar: 3 characters prefix, 10 entry port functions
Continue ........
Last updated: January 1, 2005 19:29:47