|A geeks guide to Windows XP HAL Replacement|
By: Johan Arwidmark
Posted On: 10/15/2008
Here is an article (step-by-step guide) on how to keep a single image for Windows XP deployment, across HAL types, also known as HAL Replacement. Sample scripts for detecting the HAL type from WinPE and update sysprep.inf with the correct info is provided with this article (provided AS IS).
The scripts are now (2008-10-01) updated with support for both WinPE 2005 and WinPE 2.1 as well as Windows XP SP3 (which works with HAL slightly different than XP SP2). Support for SCCM 2007 was also added.
Download sample scripts
This script updates sysprep.inf with correct HAL Type
The Reference (master) image should have an Advanced ACPI HAL type.
This script assumes the following files are being present in C:\Drivers\UniProcHAL
hal.dll (Rename from halaacpi.dll to hal.dll)
Some background info:
Windows XP typically uses one of the below three HAL types on current hardware. Even if you have an older computer that is not ACPI compliant, it can most time be BIOS upgraded (flashed) for ACPI support.
- Advanced Configuration and Power Interface (ACPI) PC - ACPIPIC_UP
- ACPI Uniprocessor PC - ACPIAPIC_UP
- ACPI Multiprocessor PC - ACPIAPIC_MP
Note: If you built an image on an acpiapic_up or acpiapic_mp machine, you can use UpdateUPHAL to switch between those and still be fully supported. It's only changing from Advanced Configuration and Power Interface (ACPI) PC to one of the others that is unsupported by Microsoft. For more info on these limitations see http://support.microsoft.com/?id=309283 .
Now, different HAL types are using different files (controlled by hal.inf). Sysprep has builtin support for changing the HAL type, the trick is to dynamically update sysprep.inf during the deployment with the correct HAL type. The HAL type can be deteced from WinPE by query the HKLM\SYSTEM\CurrentControlSet\Enum\Root\ACPI_HAL\0000\HardwareID registry value. Below is a list of files used by different HALs.
Advanced Configuration and Power Interface (ACPI) PC
- halacpi.dll (renamed to hal.dll)
ACPI Uniprocessor PC
- halaacpi.dll (renamed to hal.dll)
ACPI Multiprocessor PC
- halmacpi.dll (renamed to hal.dll)
- ntkrpamp.exe (renamed to ntkrnlpa.exe)
- ntkrnlmp.exe (renamed to ntoskrnl.exe)¨
Step-by-step guide - Creating the image
1. Build you reference computer on a machine with Advanced Configuration and Power Interface (ACPI) PC HAL type (or change to that HAL type before sealing the image).
2. Sysprep (Seal) the reference computer (don't forget to build mass storage device drivers)
3. Boot from WinPE, connect to the deployment server and create (capture) an image of it using LiteTouch or ZeroTouch
Step-by-step guide - Deploying the image
What to do at deployment time,
1. Download the sample scripts from this article and store it on your \Distribution\Scripts folder or in your MDT Files package, scripts folder.
2. Add the script to the Postinstall in the Task Sequencer
The HAL type is read from WinPE by quering the HKLM\SYSTEM\CurrentControlSet\Enum\Root\ACPI_HAL\0000\HardwareID registry key.
If the target computer has a ACPI Uniprocessor PC HAL Type - the script adds the following line to the [Unattended] section of sysprep.inf
"UpdateUPHAL = "ACPIAPIC_UP,%WINDIR%\Inf\Hal.inf"
If the target computer has a ACPI Multiprocessor PC HAL Type - the script adds the following line to the [Unattended] section of sysprep.inf
"UpdateHAL = "ACPIAPIC_MP,%WINDIR%\Inf\Hal.inf"
Note: If the target computer has a Advanced Configuration and Power Interface (ACPI) PC HAL Type we don't need to update sysprep.inf since the master image has that HAL type already.
Microsoft MVP - Setup / Deployment