Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


meofcourse

Increase Hardware Compatibility for Windows XP WIM

Recommended Posts

I didn't know you could do it from boot.ini either. It might be a very good way actually since some computers won't boot on the more generic haltypes.

We sav this problem and used acpi_pc hal wich boots anything we got so far :) but being able to set the hal up front may be even better

Share this post


Link to post
Share on other sites

I didn't know you could do it from boot.ini either. It might be a very good way actually since some computers won't boot on the more generic haltypes.

We sav this problem and used acpi_pc hal wich boots anything we got so far :) but being able to set the hal up front may be even better

We did the exact same thing as you described - the acpi_pc HAL would boot everything...while until we got the latest Lenovo T400's in. The processor in that model doesn't support the ACPI_PC HAL - apparently Intel decided to remove some instruction sets that were outdated in favor of newer ones (don't quote me on that). I've now decided to 'fork' the image since alot of the older computers are too old now and not being used as much. The dual core's really do pack a good punch compared to the P4's.

Share this post


Link to post
Share on other sites

Thanks for the info. :hello:

Now i know that the current soloution won't last much longer. Time to start thinking about something new then, win 7 maybee? :thumbup

Share this post


Link to post
Share on other sites

I have used this solution for a while and it works pretty well for all systems.

Build an image for acpi single processor, and let sysprep handle the switch to multicore hal if required (I use wmi to get the number of cores on the chip).

Oh and btw this switch is actually supported by MS, the switch from the old advanced acpi to acpi single- or multiprocessor is not supported.

This will work for most current systems, but if you have any older systems that requires the old Advanced ACPI thing, you can hack the correct HAL files onto the c: drive after deploying the image and before starting minisetup, I do this as part of the process where I add the correct drivers for the model identified from the SMBIOS data.

I also kick out any references to Intelppm in the registry.

Using this principle I avoid having multiple images for a single OS, it does however require a fair amount of scripting for it to work as described.

Share this post


Link to post
Share on other sites

I would like to add Johan Arwidmark's latest Z-HalDetect script into my WinPe 2.01 process without having to use MDT2008 or BDD 2007. Currently I deliver our XP image from a USB drive. I'm guessing that after the image is applied and before restarting the PC I need to call a script that will check the HAL type and modify the sysprep file. What modifications are necessary to run this script after imagex has applied the image to the C partition? I would really appreciate any help.

<job id="ZeroTouchInstallation">
<script language="VBScript" src="ZTIUtility.vbs"/>
<script language="VBScript">

'//////////////////////////////////////////////////
'//
'// Script File:
'//
'// Z-HalDetect_standalone_version.wsf
'//
'// This script updates sysprep.inf with correct HAL Type
'// The Reference (master) image should have an Advanced ACPI HAL type.
'//
'// This version does not require the MDT 2008 environement being present,
'// E.g. can be used with Intel LANDesk or Altiris (Note: ZTIUtility.vbs from
'// MDT 2008 must be added to the same folder)
'//
'// This script assumes the following files are being present in C:\Drivers\UniProcHAL
'// hal.dll (Renamed from halaacpi.dll to hal.dll)
'// ntkrnlpa.exe
'// ntoskrnl.exe
'//
'// Author: Johan Arwidmark
'// URL: [url="http://www.deployvista.com"]http://www.deployvista.com[/url]
'//
'// Disclaimer
'// This script is provided "AS IS" without express
'// or implied warranty of any kind.
'//
'//////////////////////////////////////////////////


' Customize the local sysprep.inf file based on the HAL type

Call UpdateSysprepinf ()

' Done, quit.

WScript.Quit

Sub UpdateSysprepinf ()

' Set Sysprep Path

If oFSO.FileExists("C:\sysprep\Sysprep.inf") then

sSysprepInf = "C:\sysprep\Sysprep.inf"
oLogging.CreateEntry "Found sysprep in " & sSysprepInf, LogTypeInfo

Else

oLogging.CreateEntry "Could not locate Sysprep", LogTypeWarning

End if

' Find out the HAL type

sHalType = oShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Enum\Root\ACPI_HAL\0000\HardwareID")

If sHalType(0) = "acpiapic" Then

if oShell.Environment.item("NUMBER_OF_PROCESSORS") = 1 then

WriteIni sSysprepInf, "Unattended", "UpdateUPHAL", "ACPIAPIC_UP,C:\Windows\Inf\Hal.inf"
oLogging.CreateEntry "HAL Type is ACPIAPIC_UP, updating sysprep.inf", LogTypeInfo

Call CopyHalFiles()

else
writeini sSysprepInf, "Unattended", "UpdateHAL", "ACPIAPIC_MP,C:\Windows\Inf\Hal.inf"
oLogging.CreateEntry "HAL Type is ACPIAPIC_MP, updating sysprep.inf", LogTypeInfo

Call CopyHalFiles()

end if

ElseIf sHalType(0) = "acpiapic_up" Then

WriteIni sSysprepInf, "Unattended", "UpdateUPHAL", "ACPIAPIC_UP,C:\Windows\Inf\Hal.inf"
oLogging.CreateEntry "HAL Type is ACPIAPIC_UP, updating sysprep.inf", LogTypeInfo

Call CopyHalFiles()


ElseIf sHalType(0) = "acpiapic_mp" Then

writeini sSysprepInf, "Unattended", "UpdateHAL", "ACPIAPIC_MP,C:\Windows\Inf\Hal.inf"
oLogging.CreateEntry "HAL Type is ACPIAPIC_MP, updating sysprep.inf", LogTypeInfo

Call CopyHalFiles()

Else

oLogging.CreateEntry "HAL Type is ACPIPIC, Do nothing", LogTypeInfo

End if


End Sub

Sub CopyHalFiles()


sSourceFolder = "C:\Drivers\UniProcHAL"
sDestinationFolder = "C:\Windows\System32"

oLogging.CreateEntry "Checking for" & sSourceFolder, LogTypeInfo

If oFSO.FolderExists(sSourceFolder) then

oLogging.CreateEntry "Folder " & sSourceFolder & " Found", LogTypeInfo
oLogging.CreateEntry "Copying HAL files for UniProc and MultiProc Comatibility", LogTypeInfo

For Each sFile In oFSO.GetFolder(sSourceFolder).Files

oFSO.GetFile(sFile).Copy sDestinationFolder & "\" & oFSO.GetFileName(sFile),True
oLogging.CreateEntry "Copying " & oFSO.GetFileName(sFile) & " to " & sDestinationFolder, LogTypeInfo

Next

Else
oLogging.CreateEntry "Error - Folder " & sSourceFolder & " Not Found", LogTypeError
oLogging.CreateEntry "Error - Copying HAL files for UniProc and MultiProc Comatibility Failed ", LogTypeError

CopyHalFiles = Failure
Exit Sub
End If


End Sub


Function ReadIni(file, section, item)

ReadIni = ""
file = Trim(file)
item = Trim(item)
Set ini = oFSO.OpenTextFile( file, 1, True)

Do While ini.AtEndOfStream = False
line = ini.ReadLine
line = Trim(line)
If LCase(line) = "[" & LCase(section) & "]" Then
line = ini.ReadLine
line = Trim(line)
Do While Left( line, 1) <> "["
'If InStr( 1, line, item & "=", 1) = 1 Then
equalpos = InStr(1, line, "=", 1 )
If equalpos > 0 Then
leftstring = Left(line, equalpos - 1 )
leftstring = Trim(leftstring)
If LCase(leftstring) = LCase(item) Then
ReadIni = Mid( line, equalpos + 1 )
ReadIni = Trim(ReadIni)
Exit Do
End If
End If

If ini.AtEndOfStream Then Exit Do
line = ini.ReadLine
line = Trim(line)
Loop
Exit Do
End If
Loop
ini.Close

End Function

Sub WriteIni( file, section, item, myvalue )

in_section = False
section_exists = False
item_exists = ( ReadIni( file, section, item ) <> "" )
wrote = False
file = Trim(file)
itemtrimmed = Trim(item)
myvalue = Trim(myvalue)

temp_ini = oFSO.GetParentFolderName(file) & "\" & oFSO.GetTempName

Set read_ini = oFSO.OpenTextFile( file, 1, True, TristateFalse )
Set write_ini = oFSO.CreateTextFile( temp_ini, False)

While read_ini.AtEndOfStream = False
line = read_ini.ReadLine
linetrimmed = Trim(line)
If wrote = False Then
If LCase(line) = "[" & LCase(section) & "]" Then
section_exists = True
in_section = True
ElseIf InStr( line, "[" ) = 1 Then
in_section = False
End If
End If

If in_section Then
If item_exists = False Then
write_ini.WriteLine line
write_ini.WriteLine item & "=" & myvalue
wrote = True
in_section = False
Else
equalpos = InStr(1, line, "=", 1 )
If equalpos > 0 Then
leftstring = Left(line, equalpos - 1 )
leftstring = Trim(leftstring)
If LCase(leftstring) = LCase(item) Then
write_ini.WriteLine itemtrimmed & "=" & myvalue
wrote = True
in_section = False
End If
End If
If Not wrote Then
write_ini.WriteLine line
End If
End If
Else
write_ini.WriteLine line
End If
Wend

If section_exists = False Then ' section doesn't exist
write_ini.WriteLine
write_ini.WriteLine "[" & section & "]"
write_ini.WriteLine itemtrimmed & "=" & myvalue
End If

read_ini.Close
write_ini.Close
If oFSO.FileExists(file) then
oFSO.DeleteFile file, True
End if
oFSO.CopyFile temp_ini, file, true
oFSO.DeleteFile temp_ini, True

End Sub

</script>
</job>

Share this post


Link to post
Share on other sites
I didn't know you could do it from boot.ini either. It might be a very good way actually since some computers won't boot on the more generic haltypes.

We sav this problem and used acpi_pc hal wich boots anything we got so far :) but being able to set the hal up front may be even better

We did the exact same thing as you described - the acpi_pc HAL would boot everything...while until we got the latest Lenovo T400's in. The processor in that model doesn't support the ACPI_PC HAL - apparently Intel decided to remove some instruction sets that were outdated in favor of newer ones (don't quote me on that). I've now decided to 'fork' the image since alot of the older computers are too old now and not being used as much. The dual core's really do pack a good punch compared to the P4's.

Sometimes the world can be pretty funny. Guess what. I got a T400 on my hand's now :).

Did a quick patch for it.

hal=objWSHShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Enum\Root\ACPI_HAL\0000\HardwareID")

If hal(0)="acpiapic_mp" Then

set objfile=fso.getfile("C:\boot.ini")

objfile.attributes=0

line= objini.Readstring("operating systems","multi(0)disk(0)rdisk(0)partition(1)\WINNT","C:\boot.ini") & " \kernel=ntkrnlmp.exe \hal=halmacpi.dll"

objini.writestring "operating systems","multi(0)disk(0)rdisk(0)partition(1)\WINNT",line,"C:\boot.ini"

objfile.attributes=39

end if

The Objini object is just a simple ini read/write class in an activeX dll we write to stop bloat every script with it.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...