SetKernelCommDev

This function reconfigures the debug settings, such as which debug services are available and which port is used for debugging.

  BOOL SetKernelCommDev(
UCHAR 
  Service
  ,
UCHAR 
  CommDevice 
  );

Parameters

  • Service
    Specifies which one of the debug services is affected by the call. The following table shows its possible values.

    Value Description
    KERNEL_SVC_DBGMSG Debug message service is to be routed to CommDevice
    KERNEL_SVC_PPSH¤ Windows CE console debug shell (Cesh.exe) service is to be routed to CommDevice
    KERNEL_SVC_KDBG Kernel debugger service is to be routed to CommDevice
  • CommDevice
    Specifies which one of the transports to use. The following table shows its possible values.

    Value Description
    KERNEL_COMM_SERIAL Serial port
    KERNEL_COMM_PARALLEL Parallel port
    KERNEL_COMM_ETHER Ethernet

Return Values

TRUE indicates success; FALSE indicates failure.

Remarks

If this function is not called, the kernel defaults to the same behavior as previous versions of the operating system: that is, debug messages and kernel debugging use the debug serial port, and the Windows CE Console Debug Shell tool (Cesh.exe) uses the parallel port.

If you want nondefault settings, you must configure your debug services early in the OEM boot sequence. Microsoft recommends that you call SetKernelCommDev from OEMInit or OEMInitDebugSerial.

Some combinations of services are not supported. For example, the Kernel Debugger (KERNEL_SVC_KDBG) and Cesh.exe (KERNEL_SVC_PPSH) cannot share a parallel (KERNEL_COMM_PARALLEL) or serial (KERNEL_COMM_SERIAL) interface.

The following table shows the combinations of Service and CommDevice that are not supported.

Service CommDevice Description
KERNEL_SVC_KDBG KERNEL_COMM_PARALLEL Cannot run debugger over parallel port.
KERNEL_SVC_PPSH and KERNEL_SVC_KDBG KERNEL_COMM_SERIAL or KERNEL_COMM_SERIAL Cannot run both Cesh.exe and debugger over serial port.
KERNEL_SVC_DBGMSG and KERNEL_SVC_PPSH KERNEL_COMM_PARALLEL, KERNEL_COMM_SERIAL, or KERNEL_COMM_ETHER Cannot run debug messages service over parallel in conjunction with Cesh.exe running over either serial port or Ethernet.

That is, if debug messages service are run over parallel port, Cesh.exe must run over parallel port.

Note that platforms that take advantage of redirecting debug output should call through the global variable lpWriteDebugStringFunc, which points to OEMWriteDebugString by default, to write debug messages. This ensures that the debug output is routed and formatted correctly for transports that require it. If your target device supports an alternate transport for debug messages, Microsoft recommends that you initialize lpWriteDebugStringFunc to point to your alternate function for writing debug strings.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.10 and later Nkintr.h