HAL Replacement in BDD

Posted Thursday, August 09, 2007 10:25 AM by jhuston

Many of you folks probably attended the session at TechEd on building a single master image.  There was a sample script in there about replacing the HAL.  Based on that script and other knowledge gleened around the internet, I've created a BDD-compliant script that will replace the HAL.

Please see the script in the attached ZIP file.

To use the script, save it to the Scripts directory in the Distribution$ share, and then add it to the task sequence in the PostInstall phase (I have it nudged between the Configure and Install Drivers tasks).

The script will examine the HAL being used by Windows PE (which indicates if the chipset is PIC or APIC) as well as the number of processors installed (via WMI).  Based on that information (along with whether the target system is 32-bit or 64-bit), it will update the Sysprep.inf file with the appropriate command (UpdateUPHAL or UpdateHAL) as well as copy over the correct HAL.DLL and NTOSKRNL.EXE images (so that mini-setup can boot).

Give it a whack and let me know if you have any issues.

 UPDATE 9/4/2007

I found an error in the script when it is run against a flat-file installation (i.e., when creating an image).  I've posted an updated version of the script that should correct that error.

Attachment: UpdateHALv2.zip

Comments

# re: HAL Replacement in BDD

Saturday, August 11, 2007 5:48 AM by Pelz

Hi Jeff.

Found your HAL replacement tip on google. Sounds interesting so i give it a try. But i cant get it to work the script runs fine and the logs shows that it has updated sysprep.inf but on the testcomputer its the same HAL as in the image i have. I made an image with the Advanced ACPI HAL. Hope you could give me some hint of what it could be wrong.

J Pelz, Sweden Client/server IT-consultant LogicaCMG

# re: HAL Replacement in BDD

Monday, August 13, 2007 7:49 AM by jarwidmark

Great stuff, and thanks for contributing to the community...

Regards

Johan Arwidmark

Microsoft MVP - Setup & Deployment

# re: HAL Replacement in BDD

Tuesday, August 28, 2007 12:09 AM by credg

great idea but I can't get this to run! Please help! I tried adding it as a custom task after post install in SMS OSD but it fails (cscript.exe updatehal.wsf) and tried again running it from BDD task sequence as suggested but still fails with a 0x00000001 error code

# re: HAL Replacement in BDD

Thursday, August 30, 2007 3:27 PM by RAFielder

I can't get the script to run.  I get the following error in the SMSTS.log.

Failed to run the action: UpdateHAL.

Incorrect function. (Error: 00000001; Source: Windows)

# re: HAL Replacement in BDD

Monday, March 17, 2008 9:40 PM by jhodges

This script doesn't work in ZTI. IMAGESIZE and IMAGEBUILD do not exist in a ZTI deployment.

I've removed the If..Then statements and it seems to be working well.

Do you know of a way to detect these in a ZTI deployment?