Deployment Solution Advanced Topic: XP Deployment & Hardware Abstraction Layers
Here's an appendix from my notes on Hardware Abstraction Layers (HALs), and their relevance for imaging XP machines. It covers,
- What a HAL is
- Why they were created
- Which HALs are applicable in modern PC installations
- How sysprep handles HALs
Importantly, it concludes that for modern machines you need not overly worry about your sysprep images and HALs as long as you create them on a computer installed with a Uniprocessor ACPI PC HAL.
Kind Regards,
Ian./
The Hardware Abstraction Layer
One of the cornerstone topics when talking about imaging the Windows NT family of operating systems is the function of Microsoft's Hardware Abstraction Layer (HAL). It is a great shame that most of the documentation on this topic fails to pass on an understanding of why the HAL is there, and why it's so vitally important to get it configured correctly in your deployments. This section therefore serves as an overview of the HAL for those who might be unclear about why they have been so important when imaging the Windows NT family.
The Hardware Abstraction Layer was created for the NT Operating System family to provide the NT kernel extra portability between different processor, memory and bus architectures. In effect, it provided a hardware interface for the NT Kernel which remained static no matter what the underlying platform. This abstraction of the NT codebase from the underlying hardware architecture, allowed the NT codebase to be ported to any hardware where a HAL was made available either by Microsoft directly, or the computer vendor.
The HAL is therefore a layer of translating software -it interacts directly with the hardware on the NT kernel's behalf, hiding hardware-level architectural differences by translating them into the device language which the NT kernel understands.
A Brief History of HAL
If you do a quick google on HALs, you'll probably be daunted as to how many there are. In order to understand why there are so many HALs, let's go back a few years to when Windows NT was being developed and start looking at how the HALs developed as new motherboard and processor architectures arose.
The Standard PC HAL
The predominant motherboard during those early years of Windows NT 3 and NT4 was a simple single-processor board housing an Intel 386/486 processor and without the advanced power management we take for granted today. Microsoft created a hardware abstraction layer for this board architecture and called it the Standard PC HAL. Of course today this is HAL would not work on today's standard off-the-shelf PC, but 20 years ago it did.
The MPS Uniprocessor/Multiprocessor PC HALs
For those who could pay some serious money back then there were the high-end boards -the Multi-Processor System (MPS) boards. These boards also lacked the advanced power management of today's boards, but they were capable of supporting two processors. This motherboard architecture was substantially different from that used in the Standard PC HAL, and so two new HALS had to be created -the MPS Uniprocessor HAL and MPS Multi-Processor HAL.
A good question is why create two HALs? Why isn't a multi-processor HAL for a multi-processor board enough? In short, the answer is nearly. You see when code is executed on a multiple processor board with multiple processors present the job of divvying up memory and creating code execution paths suddenly becomes a lot more complex which increases the overhead in scheduling CPU and memory operations. If you only have a single processor present, you don't really want to take this overhead hit -its unnecessary. This is why have the UniProcessor HAL option for multi-processor capable boards -it simply gives you a more efficient HAL.
The ACPI PC HAL
The above HALs (with a few of the OEM HALs like the DEC Alpha and PowerPC HALs) dominated Windows NT installations for many years. In 1996 however, the Advanced Configuration and Power Interface (ACPI) standard was released to provide platform independent interfaces for device discovery and power management. It is this definition which provided the common standard for getting computers to hibernate, sleep and awake. But more than that, it provided power states for the CPU and other devices too. In order to support the single processor ACPI boards emerging, Microsoft built into Windows 2000 support for a new hardware abstraction layer, the ACPI PC HAL. You can think of this as being the direct successor of the Standard PC HAL.
The ACPI Uniprocessor/Multiprocessor PC HALs
As with the non-ACPI HALs, those could pay serious money could buy the multiple processor ACPI boards. And because a multiple processor board needn't have all the processor slots filled Microsoft had to create two HALs for these boards just as with the non-ACPI boards of the past. Thus the ACPI Uniprocessor PC and ACPI Multiprocessor PC HALs emerged.
The above list isn't complete as it omits the most of the OEM HALs, and others created by Microsoft (such as the HAL catering for a special stepping model of the 486 processor), but it serves to you the idea that as technology evolved new HALs had to be created in order for NT to remain viable. For compatibility, Windows still retains a lot of the legacy non-ACPI HALs though in truth now they are rarely used.
Installing the correct HAL
In general you should always endeavour to install the correct HAL. Installing the wrong HAL will at best result in a system with reduced performance. At worst, the system won't even be able to boot. When you install Windows from your CD media, the HAL is auto-detected in initial stage and the correct one installed. When you take an image of a computer however and push it onto another piece of hardware you'll have a problem if there is an underlying HAL mismatch.
Microsoft's general recommendation to avoid imaging complications due to HAL mismatches is to create an image for each and every HAL variation you have. But what about hardware independent imaging? Can it get around this? Sadly, the answer is no -although hardware independent imaging techniques cater for Plug'n'Play driver inject drivers, HAL injection is specifically not supported by Microsoft.
So, how many HALs are out there for Windows XP. Well, let's take a look.
Windows XP HALs
The Microsoft HALs available for a Windows XP installation are as follows,
- Standard PC
Think of this as the first HAL -it applies to the first PCs which were non-ACPI and without dual-processor capability. The CPU may be a 386, a 486, a Pentium, a Pentium II, or a Pentium III - MPS Uniprocessor PC
Applies to the multiprocessor board variant of the Standard PC HAL above -so non-ACPI computers with multi-processor motherboard but with only a single processor installed - MPS Multiprocessor PC
Applies the non-ACPI multiprocessor computers above, but this time where more than one processor is installed. - Advanced Configuration and Power Interface (ACPI) PC
Applies to a single processor motherboard with single processor ACPI computer - ACPI Uniprocessor PC
Applies to an ACPI multiple-processor board but with a single processor installed - ACPI Multiprocessor PC
Applies to a multiple-processor ACPI computer with more than once processor installed
This seems a little daunting, do we really have to accommodate all these HALs when imaging? Thankfully the answer is no. Remember -there is a lot of legacy stuff in here. Let's take a look at modern 2009 computer estate which has a 5-yr replacement cycle. How many of the above HALs do we have out there...
Using Deployment Server to gauge HAL Distribution
To scavenge the HAL data from Deployment Server open up SQL Studio enterprise console and enter the following SQL,
use express; select count(*), [name] from device where [description] like 'Computer' group by [name]
The results in my case are rather pleasing,
2303 ACPI Multiprocessor PC 80 ACPI Uniprocessor PC 25 Advanced Configuration and Power Interface (ACPI) PC
So the vast majority of computers are ACPI Multiprocessor machines, with a few being ACPI Uniprocessor, and even fewer being of the class ACPI PC. No computers at all fall into the non-ACPI legacy HAL classes. In essence, we can cater for 99% of our computer estate by focusing on just two HALs -the ACPI Multiprocessor and ACPI Uniprocessor HALs.
Imaging and ACPI Uniprocessor/Multiprocessor HALs
To reiterate, as far as Microsoft is concerned, for your Windows OS to be supported, when imaging PCs you need to get the HAL right. That is, you need to make sure the HAL you deploy with is exactly the same as the HAL which would have been installed should you have used the Windows installation media directly. If you get it wrong, you might find system performance compromised, or certain features like Advanced Power Management (APM) might now work. Generally speaking if you get the HAL wrong your system will fail even to boot.
So, what can we do to ensure the HAL right when imaging? It turns out that although Microsoft doesn't in general allow you to inject new HALs into your images, sysprep does allow you to do some limited HAL tweaking. Specifically, sysprep since Windows 20000 will let you switch between HALs of the same motherboard class, allowing your to specify whether you want to use specifically the uniprocessor or multiprocessor HAL.
This is realised by adding a single line to the [unattend] section of the sysprep file,
1. ACPI Uniprocessor to ACPI Multiprocessor
UpdateHal=ACPIAPIC_MP, %windir%\inf\hal.inf
2. ACPI Multiprocessor to ACPI Uniprocessor
UpdateUPHal=ACPIAPIC_UP, %windir%\inf\hal.inf
Further, according to Microsoft KB 309283, Windows XP does not require these [unattend] amendments. The mini-setup process will automatically switch from the ACPI Uniprocessor HAL to a ACPI Mutliprocessor HALs if it determines that multiple processors are installed.
So, as far as Windows XP deployment on ACPI Uniprocessor and ACPI Multiprocessor machines is concerned, we needn't concern ourselves about the HAL as long as our source image is created on a computer with a ACPI Uniprocessor PC HAL. Sysprep will take care of the HAL upgrade for us if it is required.
Summary -Imaging with XP and HALs
Here is what we've found so far,
- Although there are technically 6 HALs available for use when installing Windows XP, we have found that in reality the non-ACPI branch HALs are so old now that you'll be hard pushed to a PC with one of these HALs nowadays.
- Of the three left, perhaps 99% of the modern computer estate are catered for with the ACPI Uniprocessor and ACPI Multiprocessor HALs.
- The Windows XP sysprep mini-setup process is completely two switch automatically from the ACPI Uniprocessor HAL and ACPI Multiprocessor HAL (but not vice-versa).
As a result, if we create our sysprep images a computer with an ACPI Uniprocessor HAL this image should be distributable to ACPI Multiprocessor HAL PCs too.
The ACPI PC HAL
As neither Windows XP sysprep and mini-setup processes will not allow us to accommodate a HAL switch in the image which correspond to a different motherboard category, if we want imaging to cater for that last 1% of computers with the ACPI PC HAL, then the options are,
- Create and maintain a separate sysprep image, created on a computer with an ACPI PC HAL.
- Use a full scripted build process on these computers should they ever require re-imaging. This will take perhaps 3 times longer, but requires no extra work if your master build is already scripted
- Do nothing. You probably have the OEM CD's lying around somewhere to rebuild these computers anyway.
As it's a lot of work manage a separate image, most of us tend to do nothing and just prod these old machines along their hardware replacement cycle.
We use a fully scripted install
We create an image ready for sysprep using a standard scripted build, as we have one machine series that has a non ACPI HAL.
The scripted build is installed on the appropriate hardware and taken to the point where sysprep has run, at which point a WIM image is created using WinPE for later use in imaging.
Let's hope that Microsoft make this process easier in the Windows 7 environment.
If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.
a non-ACPI HAL??
Crikey that's some old kit you've got there! I haven't seen any non-acpi machines for a heck of a long time now....
With Windows7, I think the change in deployment methodology is going to be a bit tough, but the underlying technology is better so we should see life getting easier.
One of my pet hates though is the "XML Revolution", where XML files for everything. Great for XML parsers, not so great for humans.... not to mention most files being tag overhead rather than actual data... grr.....
Kind Regards,
Ian./
Ian Atkin
Senior Developer for the ICT Support Team,
Oxford University, UK
Would you like to reply?
Login or Register to post your comment.