The Command Processor functionality in Microsoft® Windows® CE includes a command processor shell (Cmd.exe) that is similar to Command.com in Windows 95 and Cmd.exe in Microsoft Windows NT®. The command processor shell is a command-line-driven shell that provides a limited number of commands. The Console Window is available on display-based systems to provide a window through which the Command Processor can provide output and accept input.
OS Design Information
The following table shows operating system design information for the Command Processor and Console Window.
Concept
|
Description
|
Dependencies
|
The Command Processor requires the Standard IO (STDIO) Catalog item. For headless OS designs, the Command Processor also requires the FormatMessage API and Full C Run-Time Catalog items and either the National Language Support (NLS) Catalog item or the English (US) National Language Support only Catalog item. The Console Window requires the Command Processor Catalog item.
|
Hardware considerations
|
None.
|
Modules and Components
The following table shows the components and modules that implement the Command Processor and Console Window.
Item
|
Module
|
Component
|
Command Processor
|
cmd
|
None
|
Console
|
console
|
None
|
Command Processor Implementation Considerations
You can include the Command Processor and Console Window in your OS design by adding these Catalog items. Adding one of these Catalog items sets the appropriate environmental variable, which enables the functionality in your OS design.
The following table shows the Sysgen variables that enable the Command Processor and Console Window.
Sysgen variable
|
Description
|
SYSGEN_CMD
|
When this variable is set, the Command Processor Catalog item is included in the OS design.
When this variable is not set, the Command Processor Catalog item is excluded from the OS design.
|
SYSGEN_CONSOLE
|
When this variable is set, the Console Window Catalog item is included in the OS design.
When this variable is not set, the Console Window Catalog item is excluded from the OS design.
|
To use the Command Processor shell as a command-line interface for target devices with no displays, configure the Command Processor to operate over a serial port. The following example shows how to set the registry values to allow the Command Processor to operate over a serial port.
[HKEY_LOCAL_MACHINE/Drivers/Console]
“OutputTo” = dword:1 // Redirects CMD to COM1
“COMSpeed” = dword:9600 // Speed of serial connection
These registry settings redirect input and output for all console applications to the serial port, unless explicitly redirected to a file or other target device.
注意,上面的COMSpeed=dword:9600。这个9600是十六进制的数,因此在实际PC机上串口的波特率应选择38400。因为十六进制的9600等于十进制38400。这样,当启动Windows CE操作系统后,再运行CMD.exe,则命今行将串口一作为输入输入设备。
设置OutPutTo = dword : -1 (HEX(FFFFFFFF) 从定位CMD到调试端口.
2006年11月3日星期五
周群威