During the installation formatting took 16 minutes and copying two hours: SuSE Linux 5.3’s kernel 2.0.35 drives the disk in PIO mode, one sector at a time. And on any PC from the last fifteen years it would not even see the disk, because it is SATA. What if we gave it a newer kernel, without touching the rest of the system?

We picked Linux 2.4.37.11, the last of the 2.4 series (2011): it still runs the 1998 programs as they are (libc5 included) and it already has what 2.0 lacks: DMA on almost every IDE chipset, libata for SATA and AHCI, USB keyboards and mice, and high memory to use GBs of RAM. Everything is on GitHub: suse-retro-kernel.
The 1998 compiler is not enough
First stumble: SuSE 5.3’s gcc is version 2.7.2.1, and Linux 2.4 itself asks for at least gcc 2.95.3 (“gcc 2.7.2.3 is no longer a supported kernel compiler”). Today’s gcc does not work either: it is far too new for twenty-year-old code.
The answer was a compiler from the in-between years: Debian sarge (2005), with gcc 3.3.5, in an unprivileged chroot inside a Debian 13 virtual machine. One detail cost a round trip: it had to be entered with setarch i686, or the configure scripts see the machine’s 64-bit kernel and build for x86_64.

The configuration
Built for 486 (it boots on anything from a 1994 PC to a 2015 one), with the essentials built in so it boots anywhere:
| Built in | What for |
|---|---|
| IDE with automatic DMA (PIIX, VIA, AMD, SiS, ALi, Promise, HPT…) | goodbye PIO |
| libata: AHCI, PIIX/ICH, VIA, SiS, NVIDIA, Promise, SiI | SATA disks and burners |
| ide-scsi and sg | burning CDs with cdrecord |
| ext2, ext3, iso9660, UDF, VFAT | filesystems |
| NE2000, RTL8139, e100, e1000, PCnet, tulip, 3c59x | network |
| USB keyboard, mouse and storage | PCs without a PS/2 port |
| a.out, SysV IPC, HIGHMEM 4 GB | old binaries, ADABAS D and GBs of RAM |
Everything else as modules: OSS sound, AppleTalk, IPX, more network and SCSI cards, I2C and TV cards… 541 modules, all compiled, without a single unresolved symbol. With 12 cores the whole kernel takes 45 seconds.
One patch of our own: the 2.4 AHCI driver only knows a list of chips up to Intel’s ICH9. We added what 2.6 does: recognise any AHCI controller by its PCI class (01.06.01).

Two kernels on one system
Second stumble: SuSE 5.3’s modutils (version 2.1.85, from the 2.0 days) cannot load 2.4 modules. That needs modutils 2.4.27… which had to be built on SuSE 5.3 itself, and there a 1998 bug showed up: bash 1.14 segfaults on unset MAIL, which modern configure scripts do. Running it with a clean environment (env -) solved it.
To let both kernels live together we wrote a dispatcher: /sbin/insmod, modprobe, lsmod and friends point to a three-line script that checks uname -r and calls either the 2.0 or the 2.4 modutils. With SuSE’s kernel nothing changes (not even kerneld); with 2.4 the kernel loads modules by itself when needed.

The RPM and the YaST CD
It all goes into one RPM, k_retro24 (SuSE called its kernel packages k_), which works with the 1998 rpm 2.4.12:
- Installs the kernel in
/bootand the modules in/lib/modules/2.4.37.11-retro. - Installs modutils 2.4.27 and the dispatcher; SuSE’s modutils move to
/lib/modutils-2.0. - Adds a linux24 entry to LILO without changing the default: the system still boots 2.0.35, and typing
linux24at the prompt is enough. rpm -e k_retro24undoes everything.


And, as with the VESA driver, an add-on CD that YaST 0.97 accepts as an installation medium: it only carries k_retro24, in its own series kret.



The real test: SATA and 2 GB of RAM
For PCs where the normal installation fails we have a restorer: a CD that copies an already installed SuSE 5.3 onto a disk without going through YaST. Its version 2 has a second option, restaura24, which boots the new kernel. We tried it on a virtual machine with 2 GB of RAM and the disk on a SATA AHCI controller, like a modern PC.




With the version 1 restorer (kernel 2.0, PIO) copying the system took over half an hour; with DMA, three and a half minutes. And since Linux 2.0 cannot see SATA disks, in that case the restorer leaves only the 2.4 entry in LILO.




Errors and tricks
- gcc 2.7.2.1 cannot build Linux 2.4: a Debian sarge chroot with gcc 3.3.5, entered with
setarch i686. - modutils 2.1.85 cannot load 2.4 modules: modutils 2.4.27 side by side, with a dispatcher on
uname -r. - bash 1.14 crashes on
unset MAIL: runconfigurewithenv -. - The 2.4 AHCI driver only knows chips up to ICH9: a patch to match it by PCI class.
/etc/conf.modulesis deprecated for modutils 2.4: the RPM renames it to/etc/modules.confand leaves a link with the old name for SuSE’s modutils.- A rare panic with 2 GB: in about 19 boots of the CD, three times the kernel stopped early with “Bad pmd in pte_alloc … Failed to allocate buffer hash table”. A reboot boots normally and we could not reproduce it on demand (16 boots in a row without a failure), so the cause is still open. LILO carries
nopentiumas a precaution, but it is not proven to be the cure. - AppleTalk is off: SuSE’s
modules.confhasalias net-pf-5 off; change it for netatalk. - The restorer on SATA: it needs the
restaura24option; the normal one (2.0.35) cannot see the disk.
Downloads
At github.com/madgusmx/suse-retro-kernel: the k_retro24-2.4.37.11-2 RPM, the YaST add-on CD, the patch, the configuration and the build scripts, and the Linux and modutils sources as signed by kernel.org. It is organised by release: SuSE 6.x and 7.x come next.
What came before
- Installing SuSE Linux 5.3: three hours of YaST and 948 packages.
- KDE 1.0 on SuSE Linux 5.3 and a VESA driver for XFree86 3.3.2.
- Programming without internet in 1998.
- cdrecord 3.02 for SuSE 5.3, which with this kernel can use IDE and SATA burners.
Did you have this CD or the magazine? Tell us in the Telegram group: Telegram group
This post is also on our social media:
