Kernel Hack Brings Windows XP To The 486

The venerable Intel 486 was released in 1989 as the successor to the extremely popular Intel 386. It was the minimum recommended processor for Windows 98.  (Surprisingly, the Windows 95 minimum was a 386!)  But by the time XP rolled around, you needed at least a 233 MHz Pentium to install. Or at least that was the case until recently when an extremely dedicated user on MSFN named [Dietmar] showed how he hacked the XP kernel so it could run on the classic chip!

The biggest issue preventing XP from working on earlier processors is an instruction introduced on the Pentium: CMPXCHG8B. This instruction compares two 8-byte values and takes different actions depending on an equality test. It either copies the 8 bytes to a destination address or loads it into a 64-bit register. Essentially, it does what it says on the tin: it CoMPares and eXCHanGes some values. If you want to dig into the nitty-gritty details, you can check out this info on the instruction taken from the x86 datasheet.

Without getting too technical, know that this instruction is vital for performance when working with large data structures. This is because one instruction moves 8 bytes at a time, unlike the older CMPXCHG instruction, which only moves a single byte. Essentially, [Dietmar] had to find every usage of CMPXCHG8B and replace it with an equivalent series of CMPXCHG instructions.

On a side note, the once well-known and devastating Pentium F00F bug was caused by a faulty encoding of the CMPXCHG8B instruction. This allowed any user, even unprivileged users, to completely lock up a system, requiring a full reset cycle!

So [Dietmar] was successful, and now you can run the German version of Windows XP on either a real 486 or an emulated one. The installer is available on the Internet Archive and there’s a detailed video below demonstrating installing it on the 86Box virtual machine host.

Thanks to [DosFox] for the tip!

15 thoughts on “Kernel Hack Brings Windows XP To The 486

  1. > Essentially, [Dietmar] had to find every usage of CMPXCHG8B and replace it with an equivalent series of CMPXCHG instructions.

    Perhaps I missed something but after browsing through the discussion thread it seems to me that his replacement subroutine isn’t truly atomic like “LOCK CMPXCHG8B”. I think using two “LOCK CMPXCHG” instructions (with other instructions in between as well) isn’t the same as a single atomic “LOCK CMPXCHG8B” and introduces a race condition. On a single core system with a single-threaded CPU like the 486 it’ll probably run OK most of the time, but an interrupt can come just the right time to cause subtle and random memory corruption and crashes.

    1. You can’t just split one CMPXCHG8B into two since it will do two 32-bit compares, and potentially move half the 8byte word. Nonetheless it should not be very difficult to write a routine doing the equivalent command, especially if you are fine with just turning off interrupts for a few instructions.

    1. Good question. An application can be decompiled and recompiled. But the compiler needs to know not to use that instruction, including in the standard library. And all the drivers and dll’s that use the instruction need to be rewritten.

    2. Considering that most programs of that era ran on plain 386s/486s that’s rather a non-issue?

      Windows XP had been used by people with an existing library of Windows 9x programs.
      Stability was a big reason why users migrated from 98SE to XP.

      To my knowledge the popular VB 5/6, Borland C++ or Delphi 5 didn’t compile atomic instructions into ordinary EXE files, at least. It was plain i386 code, rather.

  2. It would be slow as molasses, but one could surely trap the missing opcode and emulate it. Not that XP wouldn’t be slow already even on the Hyper-486 that an Am5x86-PR75 running at 160 MHz is, but yeah…

  3. To boot, Windows 95 RTM needed a 386 with 4MB of RAM and 40MB of HDD space.
    Same specs that ran Windows 3.10 very well.

    To actually work with 95, it needed 8MB of RAM or more.
    With roughly 32MB of RAM, the heavy swapfile usage would go away.
    When using real, commercial applications, I mean. Not Calc.exe and Pbrush.exe.

    Windows XP SP0/SP1 needed a Pentium MMX 166 MHz, 64 MB of RAM and 1,5GB HDD storage. Again, as a minium. I tried.

    For productivity, the specs had to be higher. 256MB RAM or more were really recommended.
    By the time SP2 was out, about 1GB was practical minimum. 2GB+ were a smooth experience.

    But of course, user didn’t bother to upgrade RAM accordingly. 🙄

    I remember when users had a high-end 486 with VLB slots and 100 MHz, but a lousy 4MB of RAM.

    And then they wondered why Windows 95 was so slow. 🤦

    And then I saw the same happening in the XP era. Again.
    They forced Windows XP onto Windows 98 era hardware, without any RAM upgrade. Sigh.

    And please don’t get me started about Vista.
    It was a beast of an OS, but also very powerful with high-end hardware.

    Anyway, the hack for XP is well done. Kudos to that man!
    It might be useful one day, when 486 can be implemented in FPGAs etc.

    1. 95 runs fine with 16Mb ram, with period correct workloads without much swapping. True 32Mb was better, but it took until 1998-99 for that to become a norm. My top of the line machine from end of 99 had just 64Mb ram.

      > By the time SP2 was out, about 1GB was practical minimum. 2GB+ were a smooth experience.
      In 2004 when SP2 came out 1GB ram was an extreme amount. 512Mb was the high end back then. It took until 2006 or 7 until 1GB ram become common. Also XP can’t handle “2GB+” because its 32 bit. If you put 4GB ram in it (and it was a high amount back then, so assume a high end gpu too), you will get ~3.2Gb usable. Hence nobody put more than 2GB in XP machines. Windows 7 was out when 2GB become common.

      1. “95 runs fine with 16Mb ram, with period correct workloads without much swapping.”

        I second that. Saw it runnung on such systems (386DX-40, 486DX-33, 486DX2-66).

        Here in Germany users were very conservative.
        Some had OS/2 Warp, but merely with 4MB RAM, too.

        486 laptops often had 4MB only, as well unless being expanded by a memory module.

        Microsoft knew this, so the 4MB minimum requirement made it on the package.

        Realistically speaking, Windows 95 would have required a similar memory expansion lile Windows NT in order to run smoothly.

        “In 2004 when SP2 came out 1GB ram was an extreme amount. 512Mb was the high end back then. It took until 2006 or 7 until 1GB ram become common.”

        Yes, it was. I had 768MB, because I’ve combined various memory modules.

        By 2007, 2GB wasn’t that high-end anymore, though.
        Windows Vista came out back then and wanted 512MB minimum by then.

        “Also XP can’t handle “2GB+” because its 32 bit. If you put 4GB ram in it (and it was a high amount back then, so assume a high end gpu too), you will get ~3.2Gb usable. Hence nobody put more than 2GB in XP machines. Windows 7 was out when 2GB become common. ”

        In late 2000s, I had 3,5GB of RAM in Windows XP SP2,
        since the on-board graphics card memory was merely 64MB or so (could be set in Setup).

        It also depends how much is going on in the 3,5GB – 4GB address range, maybe.
        Some stuff like PCI devices are up there and take up memory range.

        But to be fair, I also was working with VMs in Virtual PC 2004. So I needed as much RAM.

        Windows x86 can use more than 4GB, if PAE is being used.
        The 2003 server edition supports that out-of-box, thanks to its kernel.

        But yeah, normally, Windows XP can use ~3GB at best.
        The PAE thing is a bit of an hack. 🙂

        Using Windows XP Pro x64 would have been more elegant.

        1. I’d consider Windows 95 on the 8MB 386SX-40 pocket to be “fine”. It works as a decent frontend to the period games running on it.

          But I also had to swap floppies on the horrendous C64 drives when those machines were around. So there might be a bit of perspective at work.

          1. Yes, to run small utilities or lightweight Windows 3.1 software.

            In a network environment, even WfW 3.11 needed between 8 to 24 MB depending on the load.

            It really depends on the situation, I guess.
            Later Windows 95 versions were closer to Windows 98 in terms of requirements.

            Speaking of, I do remember that Windows 98SE needed about 16MB minimum in practice.
            I had it running with 24MB on a Pentium 90 or so. Still wasn’t ideal by any means.

            8MB were the recommended minimum for OS/2 Warp by the way, as well.

            The box said 4MB, too, but the OS/2 developers said that’s not realistically.

            In Germany, Vobis had bundled OS/2 Warp 3 with 4MB PCs, too, which caused a bad user experience.

            It was similar experience to running Windows 3.1 on a 2MB PC, maybe worse.
            Which a lot of users, did, sadly.
            To this day, users on YouTube spread false information that Windows 3.1 runs “fine” with just 2MB. sigh.

            Anyway, if it had been just two MB more (6MB total) who knows if OS/2 hadn’t developed a noticeable user base here..

            I’m sorry if I do sound like a nitpicker here, but I’ve lived trough these times and often experienced Windows and OS/2 running on underpowered hardware (IMHO).
            It often was lack of RAM that I noticed.

            In retrospect, I assume it’s probably a matter of pride sort of.
            RAM wasn’t cheap and users back then weren’t willing (or able) to invest in a proper RAM expansion.

            So they justify their former decisions by playing down the need for RAM.
            That’s my explanation, at least. I could be wrong, of course.

        2. Several coworkers and I tried Windows XP 64. It wasn’t compatible with many apps and devices. iTunes is one I remember that wouldn’t work. We went back to 32 bit. It wasn’t until the second year of Windows 7 that 64 bit was well supported.

      1. It’s often so that the official “minimum requirements” aren’t the real minimum requirements.
        In practice, it’s the “recommend requirements” that are the true minimum requirements.
        That’s sort of an unwritten rule in IT and it’s been there for decades.
        Because if manufacturers were honest here, it would deter users.
        The idea is that users would do upgrade their PCs on their own will a while after purchasing the product.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

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