|
October 13, 2000
VersaLogic Application Notes
Installing and Running Windows NT Embedded
on an Embedded System
by
Anthony Chisholm
Overview
This document is intended to be a quick-start guide to Windows NT Embedded, with special consideration given to VersaLogic products. It will help you to familiarize yourself with this increasingly popular operating system, take advantage of its capabilities, and sidestep some frequently encountered difficulties.
Windows NT Embedded is an operating system targeted at embedded systems. Its primary strength is its small footprint combined with its ability to run all Windows NT software. It is important to notice that although Windows NT Embedded (NTE) is marketed as a separate product, NTE is Windows NT. Anything that runs on NT can also run on NTE, as it implements the full Win32 API, and uses the same files as an NT installation. NTE runs on the same X86-based platform that NT runs on. What really differentiates the two is not the final image, but the way in which they are set up and installed. NT setup is a sequential process that is designed to auto-detect hardware and set up the file system, the registry, and software with minimal intervention from the user. This install process inspects the target hardware to make decisions, so the installation must be performed on the target machine. NT Embedded has no such installation procedure, and the image needn't be created on the target machine. The NTE image (the file structure often located in the c:\winnt directory) is created by Target Designer (TD), which is configured manually on a component-by-component basis. It is up to you to find bootable media, make sure it has the NT Master Boot Record, and then copy the NTE image to the media.
So TD is essentially a tool that allows you to strip away functionality from a standard NT installation without breaking the operating system. There are a few components available for TD that add functionality (detailed below), but as a general rule, "NTE = NT - unneeded components." Minimum requirements for the target device are 8 MB RAM and 12 MB of persistent storage.
NTE has been verified to work, with network installed, on the following boards offered by VersaLogic:
· VSBC-6 - Pentium/K6 EBX Single Board Computer
· Panther - Pentium/K6 PC/104-Plus Single Board Computer
· VL-586-1 - 586 STD 32 Bus CPU
· VL-686-2 - Pentium/K6 STD 32 Bus CPU with video, Ethernet
Cost Considerations
Most of the cost of using NT Embedded will be licensing the individual images.
Target Designer itself is available from VenturCom, Inc. It has the full complement
of NT software available for incorporation into the final NTE image, from NT
Workstation to NT Server. Images are categorized into four licensing tiers depending
on what has been added to the image:
NTE Headless Workstation
This configuration has the full functionality of Windows NT Workstation minus display, standard keyboard, and mouse.
NTE Workstation
This configuration has the full functionality of Windows NT Workstation.
NTE Headless Server
This configuration has the full functionality of Windows NT Server minus display, standard keyboard, and mouse.
NTE Server
This configuration has the full functionality of Windows NT Server.
It is important to keep this categorization in mind if you are configuring an image for deployment into the field. These licenses can be purchased from VenturCom, Inc. (www.vci.com) in 10, 100, and 1000-packs.
Using Target Designer
Target Designer (TD) is the premier authoring tool for building NTE images. You run TD on the development system, and the system you are building the image for is called the target system. Requirements for the development system are 300 MHz Pentium-class machine with 64 MB of RAM and 90 MB of free disk space.
TD presents you with a tree of functionality. Navigate throughout the tree to add, remove, and configure the components that you want to have available on the target machine. The icon next to the component tells you if it has been added to the current configuration, and if there are component properties you can change. You cannot change the properties of a component unless it has been added. When you add or remove a component, TD goes through a recursive dependency/conflict test to see if your change affects the rest of the installation. For each component, there are associated files and registry entries that you can customize. Change the right pane between "components view", "files view", or "registry view" with the toolbar buttons.
When you are finished configuring the tree, select the "build and install" option, and TD will build the registry and copy files from the repository (often just a Windows NT CD) to the installation directory.
Adding components to Target Designer
The standard installation of Target Designer comes with a limited number of drivers, applications, and NT utilities. To add a component to the TD tree of functionality, you need a KDF (Component Definition File) file. The KDF defines where in the TD tree to add the component, what it depends on, what it conflicts with, what registry and file additions need to be made, and where to locate the files to be added. If you don't have a KDF file for the hardware or application you want to add, it can be generated using Component Designer, a separate program that comes with the Target Designer. Designing a KDF can be a very simple or very complicated process.
An alternative to designing a KDF for TD is to simply install the hardware or software by hand after you have installed NTE onto the target system. This method can be cumbersome, and the TD documentation suggests that it may not be possible if you are using the minimal kernel, but it has been verified to work with some NT installation packages.
Prominent components that add functionality
Windows NT was not originally intended for an embedded environment. It was intended for desktop systems with large hard drives, a full complement of peripherals, and a user at hand to provide input and monitor output. These design assumptions are no longer valid in an embedded environment. To account for this, there are some components available for NTE that are not on a Windows NT CD.
Message Interception - In NT, if an error message pops up, then you have to be there to press OK and deal with it. NTE provides this component that will intercept the message and forward it to application software that can either initiate corrective action or just ignore it, so that processing can continue without user intervention.
Real-time Component (RTX) - Sold separately by VenturCom Inc.,
this component will allow real-time and non-real-time processing at the same
time on the same computer. For more information on this component, see http://www.vci.com/products/vci_products/rtx/rtx_nt_overview.html.
Remote System Management - Allows you to log into and control the NTE station. This control can be text-based (i.e. telnet to a cmd.exe shell) or graphics-based, which uses Microsoft NetMeeting so that you can interact at the GUI-interface level with the target machine, even though it may have no video card installed.
Write Filter - This configurable component allows NTE to boot and run from read-only media. When an application tries to write to the disk, Write Filter will capture the request and write to memory instead of the disk. If an application were to try to read the newly written data later, Write Filter would again intercept the request and supply the information. Two obvious issues arise when this component is running: First, if you fill the memory cache then you'll lose subsequent disk writes. Second, disk writes will vanish when you reboot the computer.
Also, NTE allows you to bypass the logon step and is able to run without a display driver, without a keyboard, and without a swapfile. While it may not seem like "additional" functionality, this extra flexibility is often very useful in embedded systems.
Technical Notes
Gotchas
1. There is a serious networking issue in Target Designer 4.0 builds 60 and 79. On all boards tested, there was an incompatibility between the installed kernel and net.exe, so that when Windows tries to initialize the network, the system will completely freeze up.
A fix for this (verified for the VL-586-1, VL-686-2, and the VSBC-6) is to copy an NT kernel (4.0 SP3 has been verified) over the NTE kernel. For both NT and NTE, the kernel is located at %NTROOT%\winnt\system32\ntoskrnl.exe.
2. The readme.txt that comes with the PCnet KDF instructs you to change the "slotnumber" registry entry. They describe this entry as the "PCI slot number used by the AMD PCnet card". "Slotnumber" is a misnomer and the readme file gives a misleading description of what this value is. This value needs to be set to the PCI Device number for the Ethernet controller. This value is displayed at bootup by our General Software BIOS. It is typically 4 or 5 on our boards. If it is not set correctly, then the driver will not be able to find the Ethernet hardware.
3. In Target Designer, "Standard HAL" refers to a Pentium-class HAL (Hardware Abstraction Layer). It has been known to crash 486-based systems such as the VL-586-1. Use the "486c HAL" instead for these systems.
4. NT Embedded is able to boot from a DiskOnChip, though we recommend you use
DOC firmware version 1.21. Other versions (notably 1.23) may not work under
NT. When downgrading the firmware, your DUPDATE
version must match the firmware version currently on your DOC. A mismatched
version of DUPDATE may complain
about the image file size.
5. One detail that can be easy to overlook is clock synchronization. When you are building test images (that use test PIDs), the system clocks of your development system and your target system need to be synchronized. If the dates are far enough apart, then when you go to boot your target system, the boot process will be blocked shortly after it changes to VGA mode. It has not crashed and you can still move your mouse cursor around, but no message pops up to inform you what has gone wrong.
Helpful Tips
1. When you have finished configuring Target Designer and you build your NTE
image, TD will just copy files from the repository to a predefined directory.
It is up to you to move these files to the target boot media, make sure the
boot media has the NT Master Boot Record and the proper entry in the boot.ini
file that points to your new image. If you do not have NT already installed
on the target system, then you can put the NT MBR on the drive using the "mungeboot"
utility that comes with TD. The MSDN
Online Library offers more detail on preparing the boot device.
2. With the minimal kernel, you will just have an NT command window sitting on a blank desktop. The Start Menu and Control Panel functionality will be gone. The documentation suggests that software and hardware cannot be installed using this minimal kernel, but this is not entirely accurate. PCnet drivers for NT 4.0 have been installed into a minimal configuration. Standard kernel will add about 50 MB to your image size, and the resulting image will be much closer to NT. Be sure to add the System/Desktop Settings/Application Links component if you want to have the control panel available from the Start Menu.
3. Often the only way to make a configuration change in NTE is to go in and edit the registry yourself. If you added the registry editor to the image (or have it handy by other means), then you can do this. Run regedt32, and make sure the HKEY_LOCAL_MACHINE window is selected. Most useful parameters are located in /System/ControlSet001/Services. Here you can change some hardware and network settings. See the PCNTN4M and PCNTN4M1 keys in this location to change PCnet network settings. Slotnumber (see Gotcha #2) can be modified here as well.
If you modify the NTE registry so that NTE can no longer boot, then you can go back and fix your mistake if you have a working version of NT or NTE installed separately on the same system. Boot to the working version, run regedt32, select the HKEY_LOCAL_MACHINE window, select Load Hive
from the file menu, load winnt\system32\config\system from the non-working NTE installation, and give it some string to assign to the root key name. The registry from the non-working installation will show up at the root as the string you just entered, and now you can navigate through this tree to fix your mistakes.
4. Without Windows NT's fancy device and service managers, it can be difficult to change startup modes for devices and services under NTE. These changes can still be made in the registry by changing the "Start" entry for the appropriate device key. Change this value to (3) for manual mode, and (2) for automatic mode. To change the PCnet driver startup mode, go to the "Start" entry of the PCNTN4M registry key.
5. With the PCnet device driver in manual mode, it will not start automatically at boot time, so you must start it yourself at the command prompt. This can be done by typing:
net start <driver name>
For example, if a PCnet-based Ethernet controller is onboard, type:
net start PCNTN4M
Contact VersaLogic's Technical Support Department at info@versalogic.com for more information.
Note: Pricing and company information was deemed accurate at the time of writing of this article. VersaLogic makes no claim or warranty that the information contained in this article will not become outdated.
|