A Tale of Running Modern Linux on Hardware from 1997

I have been interested in retro hardware for a long time. I don’t remember where the idea first came to me but I’ve always been interested in finding out how modern Linux behaves on bare metal old hardware, because quemu lies and is very inaccurate replicating the intricacies of x86 retro hardware. Modern Linux being anything 5.x or better.

So for a few years I have been hunting for a 486 level hardware, 486DX that is not 486SX. Although MATH FPU can be emulated by the kernel using CONFIG_MATH_EMULATION but there is still some issues with the SX variant.

Where I live people use a lot of OLD industrial equipment so finding anything that has an ISA slot is next to impossible as they are always in very high demand.

Frix

My initial experience with modern linux on 486 started with the FRIX Project, there were a couple of issues with it. The first one being that it was based on ao486 which is a 486 based core running on an FPGA and that poses a few problems. The HDL implementation is not perfect, it lacks a lot of IO options and has no expansion options. Moreover it requires patching the kernel a fair bit to boot any modern Linux distro. Its much slower than any real 486 in practice. But at that time it was better than nothing, however I could not go any further in terms of actually running meaningful Linux distros.

It’s All About The Pentiums

Late December 2021, I had to visit the local computer market to get some keyboard RMA’d but that trip ended up being more fruitful than anticipated. I came back with an actual Pentium system.

Here are the final specs after some upgrades:

  • CPU: Pentium 100MHZ
  • Memory: 256MB of PC133 SDRAM
  • Motherboard: Zida 5SVA
  • IDE:
    • DVD RW
    • SD-IDE Adapter
  • Gotek Floppy Emulator

If you are interested in seeing a full build log I did end up posting it on YouTube.

Socket 7 Inverse Sleeper Retro PC Build Featuring a Pentium 100MHz

The Modern Linux Experience

My aim was not only to test if any 5.x kernel would work but to find a distro that would work out of the box. In doing so i wanted to understand what parts on a modern linux distro cause issues and what works.

A lot of what i am going to talk about is specific to my hardware and people my have different experience than my own, I know for a fact that the chipset and BIOS on my system are not the best.

Before we being going down the list I wanted to clarify a few terms which are going to be important. Mostly in the Linux world, but also otherwise, whenever we talk about 32bit binaries compiled against x86 target we have four main categories:

  • i386: Intel i386/80386 was introduced by Intel in 1985. It was a a 32-bit microprocessor. As the original implementation of 32-bit extensions of 8086 architecture, the 8086 Instruction set, Programming model, Binary encodings are still the common denominator for all 32-bit x86 processors. The set of processors compatible with 80386 is collectively termed as x86 or i386 architecture. Packages that are compiled for i386 architecture, are compatible with i386, i486, i586 & i686 architectures.
  • i486: Intel i486 was released in 1989. It was a was a higher performance follow up on the Intel 80386 processor. i486 was originally released with an on chip FPU, but there was a i486SX variant that had the FPU disabled. Over the 386, the 486 offered the following new instructions: XADD, BSWAP, CMPXCHG, INVD, WBINVD, INVLPG. Packages that are compiled for i486 architecture, are compatible with i486, i586 & i686 architectures.
  • i586: Intel i586 was released in 1993. It was brand named Pentium. Also called P5, meant to be the 5th generation of x86 micro-architecture. In addition to the standard 486 instructions, it offered the following new instructions: CPUID, CMPXCHG8B, RDTSC, RDMSR, WRMSR, RSM. Packages that are compiled for i586 architecture, are compatible with i586 & i686 architectures. This is what my hardware is based around and this is the level I will be targeting.
  • i686: Intel i686 was released in 1995. It was brand named Pentium Pro. Also called P6, meant to be the 6th generation of x86 micro-architecture. In addition to the standard i586, it offers the following new instructions: FCMOV, FCOMI/FCOMIP/FUCOMI/FUCOMIP, RDPMC, UD2.
  • Bonus Instructions: i586 can have MMX and i686 can have a mix of MMX, SSE, SSE2, SSE3, FXSAVE, FXRSTOR & PAE and possibly more.

Let’s Distro Hop
  • Mageia Linux 8 (i586): I started with this because it had worked previously for my Via C3 based system as IIRC its a mix of i586 and i686 instructions but that’s a story for another time.
    However it had other issues on the Pentium. Mageia does not have a “light” installer, even on the Via C3 I had to upgrade to 1Gig of RAM to get it working. So with the limited 256MB of memory on the Pentium it did not work at all.
    However since the actual memory footprint on an installed system is quiet reasonable I decided to take a shot, install it on a VM and move the disk over to the Pentium.
    But unluckily there was some issue with the IDE driver, this is a pattern that will repeat. So after the Kernel loaded and dracut started it wasn’t able to find the partition UUID and brought down the system with a Kernel panic.
    So much for Mageia, moving on.

  • Alpine Linux 13.x (i586): The Alpine Linux story starts with a positive note. Alpine has a low enough memory footprint that it was able to boot live using the Boot Disk. Not only boot but install fully using the live environment.
    However… that lasted for a very short time. A reboot and boot from the hard drive resulted in a single line on a black screen “Press Any Key To Reboot”. At this point I have to guess that the bootloader isn’t very happy with the onboard IDE controller.
    Alright then. I plugged the drive into another system and fired up qemu, removed SYSLINUX and installed GRUB. But alas it was the same story. GRUB2 detects the partition layout but fails to load the filesystem on the Pentium, but works fine under qemu.
    In case you are interested in watching the install progress, I uploaded it to Youtube. So much for Alpine, moving on.
Installing Alpine Linux 3.15 on Pentium 100Mhz | Real Time Full
  • AOSC OS/Retro (i486): I wasn’t aware of this distro at all. I don’t know how i came to learn about it but its a very recent discovery. On paper it sounds good, after all its compiled against the i486 target and is designed to run on a 486 based system so surely it should run on a Pentium… Right? … Right? Well… Okay, lets not get ahead of ourselves.
    The good news is that the distro boots just fine and is more than usable in the live environment. The installation proceeds without any hiccups and what do you know! After the installation it boots fine from the hard drive. HA! and that’s SystemD booting on a Pentium i586 hardware!
    Well I can login and type uname -a…and it hard locks.
    Reset and try again, and this behavior is very reproducible. You have just enough time after boot to login and type in one command before the system hard locks and there is no segfault, crash log or kernel panic output at all.
    Surprisingly enough, this was booting using SYSLINUX by default, same as Alpine but i guess they used an old enough release or compiled it with the correct driver options.
    Well, atleast we got somewhere. So long AOSC OS/Retro, you tried your best.

  • ArchLinux32 (i486): Arch Linux killed off 32bit support a while ago but a group of folks have been maintaining it under the ArchLinux32 name. The project has two release targets i686 and i486. Since my hardware was an i586 I used the i486 release target which was from 2021 but still good enough. It worked fine under qemu so i gave it a go and copied it over the image to an sdcard. But Grub still wasn’t happy with the IDE controller and the results were similar to booting Alpin with Grub. Installing SYSLINUX was actually much better as it allowed me to load the kernel and initrd and boot from it…But this time the kernel couldn’t populate /dev/sda1 (or any other drive letter) and failed to mount rootfs and crashes.
    Back to square one, on to the next.

  • TinyCore Linux (i486): I’ve known about this distro for a while but never really cared for it. It has a dedicated community and is very actively maintained. Buts its not a traditional distro, however having tried out all the others and failing so far, this was a good choice as any.
    I was interested in it because it not only lists its minimum CPU requirement of a i486DX, but it is also the only distro that boots without modification on the Frix project. So it seems the kernel configs and compiler arguments they used were bare minimum to generate a x86 bootable image.
    It booted fine on the Pentium from its live medium, the GUI comes up as well, albeit a tad bit stuttery but given that I’m expecting modern X11 to run at just 100MHz it’s acceptable. The UI was otherwise usable. It installs fine on the main hard drive using the available GUI installer.
    And…IT FREAKING WORKS. SYSLINUX loaded fine, followed by the kernel, ramdisk and all the services and the GUI came up as well. Its extremely stable to use, I installed a few apps and they were all working fine. So looks like there is still some hope to get Modern Linux booting on a hardware from 1997.
    And here’s a video of all of it in action:

Tiny Core Linux install on Pentium 100Mhz | Real Time Full

Honorable Mentions:
  • Gentoo (i486): Gentoo maintains a vast number of supported architectures and they are able to do this because of the fact that installing gentoo basically means recompiling everything from scratch and in doing so you can select your own compiler flags. This ensures that the binaries are compatible with your setup. However in the spirit of not having to compile an entire distro’s worth of code on a 100Mhz CPU with only 256MB of memory or the alternative of having to stick the boot SD Card on a vm just to add or update packages, I didn’t give it go.
    But luckily someone had already done the work and setup detailed instruction to try it out: https://github.com/yeokm1/gentoo-on-486.
  • Distro Builders (Buildroot/Yocto etc): Theoretically it is a trivial job to write device support config/meta-package for them and get modern linux booting on old hardware. But I always considered this as a last resort because I really wanted an easily mutable Linux Distro rather than going the embedded linux route.
Missed Opportunities

I just wanted to list a few distros that would’ve been a great fit for this retro hardware but unfortunately they either do not have a 32bit build or are built for a minimum of i686 support.

  • Debian: Targets a minimum of i686.
  • Manjaro: No 32bit support.
  • Xbuntu/Lubuntu: Targets i686

Closing Out

32bit general purpose linux is on its way out, irrespective of the architecture. Even my daily driver distro, Fedora, announced that starting with f37 they are killing 32bit support even on Arm and they’ve not had a 32bit x86 release for a long while.

Luckily for the older systems out there, there are communities looking out for them. I know running Modern Linux on an early i586 class hardware makes little sense and on mine if i really do want to run something modern and light, NetBSD works in a pinch.

Although AOSC OS/Retro didn’t quiet work, I am going to follow up on their channels and try and resolve the issues. TinyLinux is fine but its rather limiting and i still prefer the regular rootfs-on-block-storage vibe of most linux distros rather than running straight out of memory.
Alpine linux on the other hand has very little need to improve support on such old hardware and I do not want to needlessly start reporting bugs. I was always designed as a light, non-GNU distro suitable for the cloud and container world.
ArchLinux32 is another great candidate but they seem to be focusing all of their energy on i686 releases and their last i486 release was from mid 2021. But I still consider it a better alternative.
It was a nice experience figuring all of this out and hopefully this helps someone or atleast passes of as an interesting read.
As usual, you can find me hanging out in the twitterverse @sahajsarup.