TOCBACKFORWARD

Troubleshooting and Configuring the Windows NT/95 Registry

-13-

Windows NT and the HAL

Windows NT uses a Hardware Abstraction Layer (HAL) to allow NT to communicate correctly with the hardware on the system. The HAL is actually a .DLL (dynamically linked library) file that creates "hooks" so the operating system and the drivers do not have to know anything about the processor, the BIOS, or the system board. When NT wants to send something to the processor, it uses a driver, Registry information, and an API (application programming interface) built into NT, and loaded during installation.

By using the HAL, Windows NT is scalable, meaning that the same operating system can be used on different platforms. There are two HALs for each of the following platforms listed, one for single processor systems and one for multiple processor systems (up to four processors). If you will be using more than four processors, you can get an alternative HAL from the manufacturers for up to 32 processors.

Intel

COMPAQ

DEC Alpha

PowerPC (Motorola and/or IBM)

MIPS (to be discontinued after NT 4.0)

Not only can Windows NT install on any of those platforms, it can also be transported between them. Because the kernel of the operating system only talks to the HAL, you simply need to change the HAL. For example, if you had a current Windows NT Server running as a Domain Controller (holding all the security information) and it had several applications installed, you wouldn't want to start from scratch and start over again. If you started over, you would have to recreate all your usernames, security information, and applications. Instead of doing that, you could simply move all the files to the new machine by restoring a backup there, and then change the HAL.


SOLUTIONS: Why does COMPAQ have its own HAL? Why doesn't it just use the same Intel HAL that everybody else does? The HAL is designed to allow processor and system board independence from Windows NT. NT only talks to a virtual processor, as an example. As long as the hardware presents itself to the HAL in the same way, then you could easily use the same HAL. COMPAQ chooses to use a BIOS that is not compatible with other Intel system boards, and its system board circuitry is also different. Rather than change its systems, COMPAQ simply created a new HAL. A HAL is similar to a language translator. Imagine that you know how to speak only English. If someone who spoke only Spanish needed to talk to you, you would need a translator. He could translate your words into Spanish, and your friend's words into English. That is equivalent to the role of the HAL. If your friend spoke only Latin American Spanish, and your translator spoke European Spanish, most of the words would work just fine, but there might be some words that would not be understood. That is why COMPAQ chose to create its own HAL. Most things are the same, but there is enough difference that a new HAL was the best answer. If your friend spoke only Russian, you would need a completely different translator. That is the reason for so many types of HALs.

The other benefit directly related to the HAL is stability. If the hardware and applications have to go through the HAL, there is an extra layer of protection. It is not that NT cannot crash--it is just extremely rare.

A byproduct of the use of the HAL is the inability of NT to use some Windows 95 drivers, and all 16-bit real-mode drivers. Normally, in Windows 3.x or Windows 95, those real-mode drivers get loaded through CONFIG.SYS. Because the drivers are not written to use NT APIs, they will not work in NT at all. Only 32-bit drivers that are written to conform to NT specifications will work. Some drivers that are written for Windows 95 will work, and others won't.

Changing the HAL

If you will be moving NT from one type of system to another, and you need to change the HAL, you can do that quite simply with the installation diskettes and CD-ROM. Start the system with the diskettes. When the system finds a copy of Windows NT on the hard disk drive, it will ask you whether you would like to install a new instance of NT, upgrade the current one, or repair the system. Tell NT you want to repair the system. When it examines the HAL, and compares it to the one it loaded during startup, it will ask you if you would like to change the HAL. Confirm the change, and your HAL will be changed, and the rest of the NT files for the new system will be copied, if necessary.

The HAL and the Registry

Information about the HAL is stored in the Registry in HKEY_LOCAL_MACHINE\RESOURCEMAP\
Hardware Abstraction Layer
. Below that key is a key that shows the actual HAL that is installed. Figure 13.1 shows the location of the HAL in the Registry.

The Registry supplies the information necessary for uninterrupted usage, and can be changed when necessary.

Figure 13.1. HAL information and settings are stored in the Registry.

Summary

Though not like HAL from 2001: A Space Odyssey, the HAL in NT can also make your work easier. Using a HAL means that NT will be able to work across multiple platforms, protect the hardware from accidental or malicious interference from rogue applications or drivers, and be able to use standardized driver models. The challenge comes with DOS and 16-bit applications that normally communicate directly with the hardware. In many cases, they do not work at all, and, in other cases, the performance and stability are compromised.

TOCBACKFORWARD

© Copyright, Macmillan Computer Publishing. All rights reserved.