Click here to learn
about this Sponsor:
Home  |  News  |  Articles  |  Polls  |  Forum  |  Directory

Keywords: Match:
Using Windows NT Embedded's serial console administration with Windows XP Embedded
by Sean Liming (Mar. 21, 2005)

Foreword -- When Windows XP Embedded (XPe) first started shipping, it was "leaps and bounds" better than the original Windows NT Embedded (NTe), according to Microsoft embedded-MVP Sean Liming. But, says Liming, one popular NTe feature was notably lacking in XPe: Serial Console Administration (SCA), which provides the ability to remotely manage a system through a serial port. To work around that limitation, Liming has written this extensive whitepaper that shows how to incorporate NTe's SCA component into XPe.


Part 1 -- Background: A Feature from the Past


When Windows XP Embedded first started shipping, it was leaps and bounds better then original Windows NT Embedded. All the new PC technologies such as USB, IEEE 1394, multimedia, plug-n-play technologies, and ACPI were supported. The tools and database were improved. Many Embedded Enabling Features (EEF) were carried over and improved: the new Enhanced Write Filter could be disabled, system message interception and error reporting were enabled with a few registry keys, headless support was improved so a monitor, keyboard, and mouse could be added, CD-ROM boot support was carried over, a new cloning method was integrated to address the new First Boot Agent (FBA), and the various TCP/IP remote management solutions were brought over.

Noticed I said TCP/IP remote management features. There was one popular Windows NT Embedded feature that was left behind. A recent newsgroup poster reminded me that Serial Console Administration (SCA) was not part of XP Embedded. I first noticed this missing feature when I received my first copy of XP Embedded. I made a feeble attempt to take NT Embedded's SCA and run it on XP Embedded. The results were not encouraging. Seeking wise council, I talked with my good friend Jon Fincher at Microsoft. Telnet server was updated for functional and possible security fixes, but we didn’t come-up with a quick solution or answer for SCA. There were other new features of XPe I wanted to explore first, so I shelved SCA as a task to perform later. Later turned into a couple years.

The recent newsgroup poster brought the issue back to life. The newsgroup poster had a headless system that requires a static TCP/IP address to be set. SCA would serve as a nice solution to access the system and change the TCP/IP address at the command prompt. My suggestion to the newsgroup poster was to try taking the old NTe Serial Consol Administration and getting it working with XPe. The newsgroup poster took the advice. They built an XPe image and got SCA working by copying over the SCA files and replacing XPe’s Telnet Server with NTe’s telnet support. As a result, their system supported both Telnet and SCA.

I had to attempt this solution myself, so I can have some closure on my early attempt. My extreme embedded thinking wants to go to the simplest solution and support systems that don’t even have a network card, which is an ideal solution for anyone wanting a method to administrate their stand alone XPe system.

CAUTION
Before we proceed, please note: Using serial remote administration is not technically supported by Microsoft. Use this solution at your own risk!


Part 2 -- Developing the Solution


First, I verified what the newsgroup poster found by replacing telnet server and copying over SCA, and the solution worked. Replacing the telnet files and adding cmdrmt.exe post FBA is an okay method, but I prefer to just simply add an XPe component whenever possible. The following sections discuss the method and process I used to create an SLD and component for NTe’s SCA.

Test Setup -- Null Modem and HyperTerminal

First, I needed to make sure my test setup for SCA was working, which meant I had to build an NTe image with SCA. I dusted off my old copy of NT Embedded, took my Windows NT Embedded Step-B-Step book off the shelf, found Windows NT Workstation 4.0, and was lucky to find the latest Service Pack for NT 4.0 at msdn.microsoft.com. After setting up an NT 4.0 development system and building an NTe image, the test setup was up and running. HyperTerminal was used to establish a serial connection over a NULL-modem cable to the NTe target.

File and Registry Resources

Like XPe, NTe's components consisted of files, registry keys, and dependencies. The files for Serial Console Administrations components consisted of the following:
  • Cmdrmt.exe -- is the serial remote administration application
  • Rz.exe -- is a Z-modem receive file transfer application. (See Appendix A for more information)
  • Sz.exe -- is a Z-modem send file transfer application. (See Appendix A for more information)

Files View for the Serial Consol Administration in NT Embedded’s Target Designer

The files needed from NTe's Telnet are: login.cmd, termcap, tlntsess.exe, tlntsvr.exe, and tlntsvrps.exe. When you use the SLD, you will need to extract the component from the NTe CD. NTe is still available from Microsoft distributors.

One good thing from the old NTe days, as you can see in the picture below, viewing the registry in NTe is much simpler than XPe. Unfortunately, you cannot copy and paste the registry key paths text as easily.


Registry view for Serial Console Administration in NT Embedded

The challenge was to capture the NTe keys to put into an XPe component. The NTe image I built included REGEDIT.exe. Using NTe's SCA and Telnet components as a guide, I exported the different registry branches for SCA and Telnet from within my running NTe image to several .REG files. I had to change the header in each of the .REG files to reflect Regedit version 5.00, so XPe’s Component Designer would import the .REG file appropriately.

The SCA component in NTe had a properties dialog that allowed you to change the setup or registry keys via a dialog interface. These setup dialogs were known as Target Designer Extensions (TDX) in NTe. You could create your own TDX in NTe, but in XPe we are not so fortunate. We can only change the registry key values when the component has been added to a configuration within Target Designer. Of course you can preset the values in the component before the component is added to the database. The pictures below show the different tabs of the SCA properties page. The following table relates the properties to the registry key:


Serial Console Administration's Property Settings
(Click image for larger view)


Table: Serial Console Administration Parameters
Tab
Parameter
Selectable
Options
Corresponding Registry Key
Serial Port
Settings
Port number 1 thru 255 HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\
Services\cmdrmt\Parameters\CommandParameters

COM1: Baud=115200 PARITY=n DATA=8 STOP=1
Baud rate 9600
14400
19200
38400
57600
115200
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\
Services\cmdrmt\Parameters\CommandParameters

COM1: Baud=115200 PARITY=n DATA=8 STOP=1
Data bits 7 or 8 HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\
Services\cmdrmt\Parameters\CommandParameters

COM1: Baud=115200 PARITY=n DATA=8 STOP=1
Parity Even
Odd
None
Mark
Space
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\
Services\cmdrmt\Parameters\CommandParameters

COM1: Baud=115200 PARITY=n DATA=8 STOP=1
Stop bits 1 or 2 HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\
Services\cmdrmt\Parameters\CommandParameters

COM1: Baud=115200 PARITY=n DATA=8 STOP=1
Auto
Login
Settings
Use Default
Domain
NA HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\
Services\cmdrmt\Parameters\Domain
Use Default
User Name
NA HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\
Services\cmdrmt\Parameters\UserName
Use Default
Password
NA HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\
Services\cmdrmt\Parameters\Password
Number of failed
logons
NA HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\
Services\cmdrmt\Parameters\MaxLogons
Session
Settings
Default ShellNA HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\
TelnetServer\1.0\DefaultShell
Login ScriptNA HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\
TelnetServer\1.0\LoginScript
Terminal
Emulation
ANSI
Custom
VT100
VT52
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\
TelnetServer\1.0\TerminalEmulation
Terminal Size
Columns
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\
TelnetServer\1.0\Columns
Terminal Size
Rows
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\
TelnetServer\1.0\Rows
Alt Key
Mappings
1 or 2 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\
TelnetServer\1.0\AltKeyMapping


Component Dependencies

I knew that the XPe SCA component was going to require some dependencies on other components. Using NTe as a first step, what were SCA’s dependencies in NTe? When the SCA component is added in NTe, three components are automatically added to the configuration:
  • Console Administration Common, which includes the files login.cmd, termcap, tlntsess.exe.
  • Event Logging -- The registry keys point to the event logs.
  • Windows NT Command Prompt -- CMD.EXE or in XPe this is known as CMD Windows Command Processor component.

Adding the Serial Console Administration component in NT Embedded

Based on NTe’s component relationships, what are the dependencies for the XPe SCA component? We know that the SCA component is going to have dependencies on CMD Windows Command Processor and Event Log components. Because this is serial port administration, the Communications Port component is a logical dependency. If you have a unique serial card that requires a special driver, you will have to add the component separately and extablish the dependency. XPe's Telnet Server component is going to be a "conflict" with this component since the XPe and NTe Telnet component files are going to conflict with each other. Finally running Dependency Walker on cmdrmt.exe yields four component dependencies: Microsoft Visual C++ Primitive: Ntdll, Primitive: Ntlsapi, and Primitive Rundll32.

I found the files, registry, and resource. The next step was to create and test the component. The SLD that is separate from this document is the result. You can download the SLD from my website. Now, all I needed to do was test the component in an XPe image.


Part 3 -- Testing the Component


As I mentioned earlier, I want to test the extreme case, so the SCA component will work with almost any configuration. The XPe test image will have Minlogon, Command Shell, and a serial port. Networking and multimedia components will not be in the image. A target PC and a host will be connected via a Null modem cable.

Note: the following was tested with Windows XP Embedded SP2.

Building and Deploying the Image
  1. Make sure that you have the NTe files for Cmdrmt.exe, Rz.exe, Sz.exe, login.cmd, termcap, tlntsess.exe, tlntsvr.exe, and tlntsvrps.exe. You can get NTe from a Microsoft distributor.
  2. The SLD is setup so the SLD is a directory level above a subdirectory called “Files”. This subdirectory must contain the files listed in step 1 in order to successfully import and test the component. Create the "Files" subdirectory and copy the files in step 1 into the subdirectory.
  3. Using Component Database Manager, import the SLD into the database.
  4. Close Component Database manager.
  5. Open Target Designer.
  6. Create a new Configuration called XPESCA.
  7. Add the following components to the configuration:
    • MinLogon Sample Macro
      • Make sure all selections under settings are checked.
    • Serial Console Administration
    • PnP (User-mode) -- required to access the COM port.
  8. Run a Dependency Check.
  9. A password is needed for SCA to login. Modify the Administrator Account component, and add password as the password for the Administrator account


    Advanced Settings for Administrator Account component

  10. Using the SCA Parameter table in section 2.2, modify or note the connection settings for baud, parity, data bits, etc. for the SCA component.
  11. Run Dependency Check again.
  12. Build the image. The image should be around 55MB in size.
  13. Download the image to your target system.
  14. Boot the target system so the image runs through FBA.
Testing the Connection
  1. Connect a Null modem cable between your target machine and a machine that runs HyperTerminal.
  2. Once FBA completes on the target, start a HyperTerminal session on the host machine.
  3. Create a new connection for you development machines COM port. If you have not done so already.
  4. In Windows XP, the terminal setup is defaulted to ANSIW and VT100 terminal. By Default SCA is set for ANSI. Change the setting from ANSIW to ANSI. This should change the terminal from VT100 to ANSI.
  5. Make sure that the baud, parity, etc. are correct, and make a connection.
  6. You may have to hit return a couple times to get a sign-on prompt.
  7. Enter the Administrator for the User and password for the Password. The Domain is left blank, just hit Enter.


    Logging into Serial Console Administration

    Note: Scroll Lock must be disabled to use HyperTerminal or the screen will not scroll up to present a log-on banner.

  8. A sign-on banner appears, you can now perform basic command line operations such as setting and checking the TCP/IP address.


    Signed in

  9. Now, let's use RZ and SZ to send files back and forth. In the SCA console, create a new directory called test. (c:\>cd test)
  10. Start the RZ.EXE program, to receive a file from the host and place the file in the new test directory:
    C:\>rz /dtest
  11. In HyperTerminal, select Transfer->Send from the menu.
  12. In the Send File dialog, Browse to a file to send, and send the file. A transfer dialog appears indicating the status of the transfer. When the transfer completes, the c:> prompt will re-appear.


    Sending a File

  13. Now let’s send a file from the target to the host. Using SZ.EXE send the same file back to the host:
    C:\>sz /sc:\test\filename
  14. The transfer operation and dialog in HyperTerminal automatically starts. The file gets downloaded to your user account under c:\Documents and Settings.


    Receiving a File

  15. Disconnect when finished
  16. Close HyperTerminal
Since a Telnet server is also in the image, you can also connect to the target via a TCP/IP Telnet session. There might be some security issues since the Telnet server is an older version. You can use XPe’s security setups to prevent access to the Telnet server if you don’t need Telnet access.


Appendix -- File Transfer Utilities


Receive File -- RZ.EXE

Rz.exe has many options. A brief description follows ([] indicates default values):

Parameter
Description
/fFileName [ReceivedFileName] Receive file name (can include a full path).
No Space between the 'f' and the file name.
/dDirectory [Current Directory] Directory to send the file too
/xEscapeControlCodes : + or [-] Specify whether binary chars will
be sent within the ZMODEM stream
/oOverWrite :
    NEVER
    NEWER
    APPEND
    [ALWAYS]
    REN_DATE
    REN_SEQ
Specify the file overwrite behavior for RZ to use:
/tUseDateTime : [+] or - If FileName is specified then UseDateTime is [-] by defualt
/pSavePartial : [+] or -
/uUseDirectory : + or [-] If FileName or CreateDirectory are specified
then UseDirectory is [+] by defualt
/cCreateDirectory : [+] or -

Send File -- SZ.EXE

Sz.exe has many options. A brief description follows ([] indicates default values):

Parameter
Description
/sSourceFileName Source file name (can include a full path).
No Space between the 's' and the file name.
/tTargetFileName
[SourceFileName]
Name of the sent file on host
(HyperTerminal will ignore the path)
/xEscapeControlCodes : + or [-] Specify whether binary chars will be
sent within the ZMODEM stream
/cCrcType: [32] or 16] Specify the type of CRC used for transfer
(32 bit or 16 bit CRC)
/oOverWrite Specify the file overwrite behavior
for HyperTerminal to use
/iIncludePath : [+] or – Specify if path is to be sent to HyperTerminal
(HyperTerminal will ignore path information)
/eEolConvert: + or [-] Specify if Eol characters are to be
converted before being sent.
/mXferMethod :
WINDOW or [STREAMING]
Specify the transfer method of data packets
(STREAMING has better throughput
but WINDOW is better for noisy lines)


Resources

Windows NT Embedded Step-By-Step, Sean D. Liming, Annabooks, 2000, San Diego, ISBN: 0-929392-68-X


About the author


Sean Liming is a Microsoft eMVP and is the author of three books on Windows Embedded including Windows XP Embedded Advanced and Window XP Embedded Supplemental Toolkit. Liming is currently the Managing Director of SJJ Embedded Micro Solutions, which offers books, toolkits, training courses, and consulting services covering all aspects of embedded design hardware, software, manufacturing, and life-cycle management.


(Click here for further information)


7 Advantages of D2D Backup
For decades, tape has been the backup medium of choice. But, now, disk-to-disk (D2D) backup is gaining in favor. Learn why you should make the move in this whitepaper.

4 Legal Reasons to Control Internet Access
The Internet is obviously a valuable resource for many organizations. However, many are exposed to legal liability concerns because they fail to control Internet access. Learn if you're safe in this white paper.

Rapidly Resolve J2EE Application Problems
Whether you are in the process of building J2EE applications or have J2EE applications already running in production, you must ensure that they deliver the expected ROI. Learn how in this white paper.

Load Testing 2.0 for Web 2.0
There are many unknowns in stress testing Web 2.0 applications. Find out how to test the performance of Web 2.0 in this white paper.

Build Better Games Online
For the game infrastructure providers, life is complex. Making money from games has become more complicated. Why? Find out in this white paper.

Building a Virtual Infrastructure from Servers to Storage
This white paper discusses the virtual storage solutions that reduce cost, increase storage utilization, and address the challenges of backing up and restoring Server environments.

Gaining Faster Wireless Connections with WiMAX
Welcome to what is quickly becoming the hyperconnected world where anything that would benefit from being connected to the network will be connected. Learn more in this white paper.

Is Your Desktop a Security Threat?
The new wave of sophisticated crimeware not only targets specific companies, but also targets desktops and laptops as backdoor entryways into those business’ operations and resources. Learn how to stay safe in this white paper.

Increasing SAN Reliability by 100 Percent
Storage area networks (SAN) are a strong part of storage plans. Learn how to increase your reliability and uptime by 100 percent in this case study.

 


Got a HOT tip?   please tell us!
Free weekly newsletter
Enter your email...
Click here for a profile of each sponsor:
PLATINUM SPONSORS
(Become a sponsor)

ADVERTISEMENT
(Advertise here)


Check out the latest Windows-powered...

mobile phones!

other cool
gadgets

HOT TOPICS
Microsoft targets PNDs with new embedded OS
Microsoft tips .NET MF 3.0 highlights
Microsoft previews Windows Embedded Standard
Microsoft offers free Windows CE 6.0 textbook
Microsoft renames embedded operating systems
Microsoft unveils Windows Mobile 6.1
New Atom models target low-cost PCs
REFERENCE GUIDES
Windows Device Showcase
Intro to Windows Embedded
Intro to Shared Source
Real-time Windows Embedded
Windows Embedded books
Join our Windows Embedded discussion forums:
Windows XP Embedded
Windows CE
Windows Mobile


Windows Embedded developer newsgroups
Windows CE
XP Embedded
PocketPC
Smartphone

Microsoft's Windows Embedded resources
Embedded dev center
Mobile dev center
Windows CE tutorials
XP Embedded tutorials
Windows Embedded seminars
Windows Embedded application categories
3rd-party partners


BREAKING NEWS

• Upated JVM supports Windows CE
• Windows Mobile 6.1 phone has GPS
• Windows CE thin client hides in wall sockets
• Portable spectrum analyzer runs Windows CE
• VoIP client gains add-ons, API
• Windows Mobile phone has dual active SIMs
• Access gives away Windows Mobile utilities
• Intel's Atom powers mini-ITX board
• Microsoft revamps Windows Mobile website
• Low-cost phone bundles IM client
• Pico-ITX board bears twins
• Microsoft details finalists in student competition
• Intrinsyc revs Windows CE-based software platform
• $300 mini-laptop runs Windows CE
• Microsoft releases server virtualization technology


MOST POPULAR (last 90 days)
Windows Mobile 6 SDKs available for download
Guide to HTC's Windows Mobile smartphone platforms
Microsoft unveils Windows Mobile 6.1
HTC announces unlocked Windows Mobile 6.1 phone
UMPC squeezes in optical drive
Running Windows Mobile 6.1 on your desktop computer
Microsoft releases Windows XP Service Pack 3
Mobile Firefox gets speedup, design tweaks
MOST POPULAR (Classics from the vault)
The Windows Mobile Phones Showcase
Windows XP Embedded USB boot
Troubleshooting Windows XPe's blue screen "Stop 0x0000007B" error
Asus reveals $190 mini notebook
HTC adds GPS to Windows Mobile Touch line
Windows Mobile VPN client plays with Cisco
Guide to HTC's Windows Mobile smartphone platforms
Customizing Windows XP Embedded thin clients
The Windows Mobile Pocket PCs Showcase

Also visit our sister sites:


Sign up for WindowsForDevices.com's...

news feed

Home  |  News  |  Articles  |  Polls  |  Forum  |  Directory  |  About  |  Contact
 

Ziff Davis Enterprise Home | Contact Us | Advertise | Link to Us | Reprints | Magazine Subscriptions | Newsletters
Tech RSS Feeds | White Papers | ROI Calculators | Tech Podcasts | Tech Video | VARs | Channel News

Baseline | Careers | Channel Insider | CIO Insight | DesktopLinux | DeviceForge | DevSource | eSeminars |
eWEEK | Enterprise Network Security | LinuxDevices | Linux Watch | Microsoft Watch | Mid-market | Networking | PDF Zone |
Publish | Security IT Hub | Strategic Partner | Web Buyer's Guide | Windows for Devices

Developer Shed | Dev Shed | ASP Free | Dev Articles | Dev Hardware | SEO Chat | Tutorialized | Scripts |
Code Walkers | Web Hosters | Dev Mechanic | Dev Archives | igrep

Use of this site is governed by our Terms of Service and Privacy Policy. Except where otherwise specified, the contents of this site are copyright © 1999-2008 Ziff Davis Enterprise Holdings Inc. All Rights Reserved. Reproduction in whole or in part in any form or medium without express written permission of Ziff Davis Enterprise is prohibited. Windows is a trademark or registered trademark of Microsoft Corporation in the United States and/or other countries and is used by WindowsForDevices under license from owner. All other marks are the property of their respective owners. WindowsForDevices is an independent publication not affiliated with Microsoft Corporation.