Partager via


I/O Controller Handling

Because switching ports for a mode is best accomplished by rebooting, the first step in implementing the DEV_PORT is to provide an area to store the requested mode that is preserved when you reboot, such as the driver global or other reserved area of memory. Three bytes are required for storage — one byte for each kernel service. Each byte contains the port identifier of the port that is used by that service.

Once the data structure has been defined, modify the OEMIoControl function in the OEM adaptation layer (OAL) to handle this I/O controller. An example of this can be found in %_WINCEROOT%\Platform\Cepc\Kernel\Oal\Oemioctl.c. Model your code after this example, substituting the appropriate port identifiers. If a request is made to associate a service with an inappropriate port, use a return with ERROR_INVALID_PARAMETER. The Windows CE Console Debug Shell tool (Cesh.exe) cannot be associated with serial ports, and multiple services cannot share a single serial port. It is legitimate to make multiple calls to IOCTL_SET_KERNEL_DEV_PORT. For example, you can associate the debugger with COM1: and associate ppsh with LPT1:. A KERNEL_PORT_NONE identifier instructs you to disable any service associations for the specified port.

See Also

Kernel Debugging Using Standard Ports

 Last updated on Friday, October 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.