Author: arm-WinCE
At the early stage of BSP development in wince, we may not have a display driver, keyboard, mouse, or USB driver. At this time, if there is a Console Based on the serial port, it will feel very happy.
It is easy to redirect the console to the serial port. First, the serial port driver must be good. Then add the following configuration in platform. Reg:
[HKEY_LOCAL_MACHINE/Drivers/console]
"Outputto" = DWORD: 1
"Comspeed" = DWORD: 9600; 38400
"Outputto" indicates the serial port to which the redirection is made. For example, to redirect to COM1, set it to 1. If it is defined as 0xffffffff, it indicates that it is output to the debug port. It is said that there is a problem in wince6.0 and it has not been tried.
"Comspeed" is to set the baud rate of the serial port. Note that 9600 means 0x9600, that is, 38400. Do not make a mistake.
Next, I want to run cmd.exe automatically after winceboot, so that we can see the prompt at the serial port. How can we achieve this?
In this example, autolaunch.exe is used, and autolaunch is a program used to automatically load programs. The autolaunch project can be found online. Here is a Reference URL:
Http://www.learningce.com/Downloads/796.aspx
It can be used as a sub project to be merged to the wince6.0project. After that, open autolaunch.regin the autolaunchproject and add the cmd.exe file. For details, refer:
[HKEY_LOCAL_MACHINE/init]
"Depend99" = HEX: 0a, 14, 00, 1e, 00
[HKEY_LOCAL_MACHINE/init]
"Launch99" = "autolaunch.exe"
[HKEY_LOCAL_MACHINE/startup]
"Process1" = "cmd"
"Process1delay" = DWORD: 000003e8
In this example, autolaunch.exewill be automatically run after wincestart, and then autolaunchwill launch the configuration in autolaunch.regto start cmd.exe, so that you can see the command line prompt in the Super Terminal.
I used this function below wince6.0. I feel that there are some problems after redirecting to the serial port:
1. The input character does not return. I must use the Super Terminal's return function in the Super Terminal, instead of the console's return function in wince.
2. If there are too few commands, You can execute commands such as CD and Dir. If you run commands such as ipconfig, you will not be able to execute them without any printed information. Of course, other programs cannot be run.
After being redirected to the serial port, the cmd.exe has limited functions and can only run some basic commands. Find the source code in/wince600/private/winceos/utils/cmd2.
My personal opinion is that this method may be useful when we first develop BSP. When we have an Ethernet driver, we can use Telnet, this method can be abandoned.