The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,262 other subscribers

Windows XP: changing the HAL to support multiple cores (actually: two CPUs)

Posted by jpluimers on 2010/10/14

A while ago, I moved a single CPU Windows XP VM from VMware Workstation to ESXi 4.1 using the standalone VMware vCenter converter.
In ESXi, I increased the CPU count from 1 to 2, and wanting to to for 4 (since  I had been running Windows on a quadcore CPU before).

Well, that turned out to be harder than I thought…

Trying to get XP to run on 4 cores in a VM

The conversion went all right, except for one thing:
the VM would recognize 2 CPUs in the Device Manager, but only 1 in the Task Manager.

While researching this, sometimes during a boot, I was getting a “STOP 0x0000007f (0x00000000, 0x00000000, 0x00000000, 0x00000000)“.
Fixing that was easy:

  1. Shut down the VM
  2. Switch the CPU count of the VM in ESXi to 1
  3. Boot the VM in safe mode
  4. Reboot the VM in normal mode
  5. Shutdown the VM
  6. Switch the CPU count of the VM in ESXi to 2
  7. Boot the VM in safe mode
  8. Reboot the VM in normal mode

Most of the times, you can skip the “safe mode” reboot, but irregularly it is needed.
Better “safe” than sorry :-)

Lets have XP use the 2 cores

Having XP now booting with 2 CPU cores is promising.
The Device Manager correctly showed the 2 CPU cores.
But the Task Manager only showed one.

I went through the usual hoopla of making sure I have this ‘show 1 graph per CPU‘, but I already had that setting right.

The problem was the HAL.
The Device Manager showed the wrong HAL type:
it was “Advanced Configuration and Power Interface (ACPI) PC”  in stead of “ACPI Multiprocessor PC”.
This is because the machine started as a single CPU machine, for which the standard ACPI HAL is sufficient.

Though

For changing the HAL, Microsoft recommends an in-place reinstall of Windows.
I have done that before because of broken drivers, usually with bad results.

So I looked for a way to do this from within the Device Manager, which turns out to be impossible.
That page however, is the best I could find on changing the HAL, and points to “Problems updating to a dualcore CPU Not anymore“, which is an invalid URL because  www.hardware.info just reorganized their site and broke the existing links.

Google to the rescue:  the cache of that page, had a link to HALu-0.2.0.zip. That link was invalid too, but searching for HALu-0.2.0.zip revealed a few download locations, for instance in this virtual box forum thread.

HALu is a wrapper around devcon.exe, which is a command-line interface to the same underlying layer as the Device Manager is a GUI interface to.
You can download the complete devcon package from the Microsoft site.
After having found out about devcon, it appears that HALu is doing the same as this HAL_update.bat batch file on Mike Laverick’s RTFM Education site.
Mike explains this in much more detail (including upgrading from non ACPI systems) in this PDF.

Back to HALu: it is dead easy to use:

  1. Run it
  2. Select the “ACPI Multiprocessor PC” HAL
  3. Let it install
  4. Reboot (sometimes it needs to reboot twice)
  5. Check if Task Manager shows 2 CPUs
  6. Done

Having all the right keywords (devcon, ACPI, etc), I found other posts explaining how to do the multi-core HAL switch: there are many of them if you know what to search for :-)

If HALu doesn’t cut it, you can use this batch file from the “updating the HAL for multiprocessor support” message:

devcon sethwid @ROOT\ACPI_HAL\0000 := +acpiapic_mp !acpiapic_up
devcon update c:\windows\inf\hal.inf acpiapic_mp

Make sure you have devcon.exe and he above batchfile in the same directory.

Now I had a 2 core system, but wanted a 4 core system.

So I shut down the VM, bumped up the CPU count in the ESXi management interface to 4, then rebooted.
Device Manager showed 4 cores, but task manager only 2.

After a long search most of the results were forum postings.

A more official document is the Microsoft Windows XP Professional EULA. It indicates the maximum number of (apparently physical processors) is 2.
Similar for the Microsoft Windows XP Home EULA: it indicates a maximum of 1 processor.
There are similar documents for other versions and editions of Windows

Since VMware cannot simulate hyperthreaded cores or multi-core processors, you are stuck with a maximum of 2 virtual CPUs, each having one core.

Conclusion

  • Non-sever versions of Windows only support 2 physical CPUs.
    There are not many places to find this, the Windows XP EULA section “Installation and use” hints this.
  • Virtualization tools provide CPUs, not cores.
    So the maximum core count inside such non-server version of Windows is 2.
  • In order for Windows XP to support multiple CPUs, you will need a

–jeroen

6 Responses to “Windows XP: changing the HAL to support multiple cores (actually: two CPUs)”

  1. thank you!! running some legacy apps on winxp so your info was very helpful..

  2. Brian Allen said

    Batch file worked great for me also. Thanks alot

  3. Grzegorz said

    The batchfile method worked for me, big thank you! :)

  4. Lansett said

    Great! You made my day.
    Thanks a lot.

  5. […] solved!Change your ESXi machine's network hostname, DNS information (and SSL certificate)Windows XP: changing the HAL to support multiple cores (actually: two CPUs)Delphi operator overloading: table of operators, names, and some notes on usage and 'glitches'VMware […]

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.