Redhat Linux 5.2 for a retro PC project

stewartm82

New Member
Joined
Dec 22, 2025
Messages
2
Reaction score
0
Credits
55
I don’t know what I’m doing. This is a retro Linux project just for fun. I’m trying to boot a self-compiled Linux 2.2 kernel on an existing Red Hat 5.2 system (which originally shipped with a 2.0 kernel). The system boots perfectly with the original 2.0 kernel.

When I try and boot the 2.2 kernel I get:
Warning: unable to open an initial console.
The oracle suggested that kernel cannot open /dev/console and I need to recreate the char and block devices under dev. I have assumed:
  • initrm is deisgned to solve this
  • I can build an image of the dev tree with the correct major minor numbers for things like console and tty
  • I can use lilo to point to this img file which I have built and placed in boot
As I understnad the devices require different major minor numbers as 2.2 is stricter than 2.0.

With initrd:
Kernel panic: VFS: Unable to mount root fs on 01:00

IDE disks are detected (hda shows correct size), but root fails to mount when initrd is used.

What I’ve tried/verified:
  • IDE + ext2 built into kernel
  • VGA console built in (CONFIG_VT, CONFIG_VT_CONSOLE)
  • /dev/console, /dev/null, /dev/tty0–4 exist within init ramfs
  • root=/dev/hda1, rootdelay=, init=/bin/sh as lilo params.
  • Minimal initrd with only essential device nodes
  • Removing /dev/hda* from initrd
  • Clean rebuilds of the kernel. I have a script that will
    • make oldconfig
    • make dep
    • make
    • make modules
    • make modules_install
    • make bzImage
    • cp to image to /boot
Same LILO config boots 2.0 kernel fine. So at this point I'm wondering: Is it actually viable to boot a 2.2 kernel on a Red Hat 5.2, or am I hitting an unavoidable kernel or /dev incompatibility? Any insight from people would be appreciated.
 


G'day stewart, Welcome to Linux.org

While I almost certainly won't be the one to help you out with any dazzling insight here, I am more than chuffed with your opening statement::
I don’t know what I’m doing
You get an A+ for honesty !! You brought a wide smile to my face. Thank you.

Welcome. Stay a while.
 
I don’t know what I’m doing. This is a retro Linux project just for fun. I’m trying to boot a self-compiled Linux 2.2 kernel on an existing Red Hat 5.2 system (which originally shipped with a 2.0 kernel). The system boots perfectly with the original 2.0 kernel.

When I try and boot the 2.2 kernel I get:

The oracle suggested that kernel cannot open /dev/console and I need to recreate the char and block devices under dev. I have assumed:
  • initrm is deisgned to solve this
  • I can build an image of the dev tree with the correct major minor numbers for things like console and tty
  • I can use lilo to point to this img file which I have built and placed in boot
As I understnad the devices require different major minor numbers as 2.2 is stricter than 2.0.

With initrd:


IDE disks are detected (hda shows correct size), but root fails to mount when initrd is used.

What I’ve tried/verified:
  • IDE + ext2 built into kernel
  • VGA console built in (CONFIG_VT, CONFIG_VT_CONSOLE)
  • /dev/console, /dev/null, /dev/tty0–4 exist within init ramfs
  • root=/dev/hda1, rootdelay=, init=/bin/sh as lilo params.
  • Minimal initrd with only essential device nodes
  • Removing /dev/hda* from initrd
  • Clean rebuilds of the kernel. I have a script that will
    • make oldconfig
    • make dep
    • make
    • make modules
    • make modules_install
    • make bzImage
    • cp to image to /boot
Same LILO config boots 2.0 kernel fine. So at this point I'm wondering: Is it actually viable to boot a 2.2 kernel on a Red Hat 5.2, or am I hitting an unavoidable kernel or /dev incompatibility? Any insight from people would be appreciated.
Congratulations on the retro activity. It's fun and informative I think.

RedHat 5.2 was released with 2.0 kernel in 1998. The precise kernel version number is in the timeline shown in the history chart here: https://en.wikipedia.org/wiki/Red_Hat_Linux.

The 2.2 kernel was introduced in RedHat 6.0 about 5 months later, including a new glibc. The 6.0 version was the first RedHat used here installing RedHat from the cd which was provided by the book "Red Hat Linux For Dummies" written by John "maddog" Hall, so I don't have direct 5.2 experience. There was a second edition of the book with RedHat 6.2 cds which was a vastly superior installation from RedHat than 6.0.

I can't say with any certainty why the problem exists with compiling the 2.2 kernel, but it's possible that the kernel build tools that the 2.2 kernel needs are not available in RedHat 5.2. What I'm speculating is that the 2.2 kernel may have needed a later gcc, a newer GNU assembler and perhaps other updated kernel scripts. It may thus be worth upgrading the compiler and the binutils if possible and see how that goes. It was a time of rapid development and the distros generally at that time in my experience depended on quite a lot of specifically compatible software.

It's a most absorbing activity to run older distros and "see how they run" :-) , but there may be a limit to one's patience, especially if one enters into a "dependency hell".

My suggestion for a more fruitful retro activity would be to have a go at RedHat 6.2 which was a significant improvement on all that went before and lasted about 9 months before the next release which was a tribute to its improvements. The cds are available here: https://archive.org/details/disc1_202002. There are two of them, and there was a further one with extra software which I haven't been able to locate at this time, but it's entirely a bonus. Anyway, "good luck" with activity whichever way you go.
 
Last edited:
I don’t know what I’m doing. This is a retro Linux project just for fun. I’m trying to boot a self-compiled Linux 2.2 kernel on an existing Red Hat 5.2 system (which originally shipped with a 2.0 kernel). The system boots perfectly with the original 2.0 kernel.

When I try and boot the 2.2 kernel I get:

The oracle suggested that kernel cannot open /dev/console and I need to recreate the char and block devices under dev. I have assumed:
  • initrm is deisgned to solve this
  • I can build an image of the dev tree with the correct major minor numbers for things like console and tty
  • I can use lilo to point to this img file which I have built and placed in boot
As I understnad the devices require different major minor numbers as 2.2 is stricter than 2.0.

With initrd:


IDE disks are detected (hda shows correct size), but root fails to mount when initrd is used.

What I’ve tried/verified:
  • IDE + ext2 built into kernel
  • VGA console built in (CONFIG_VT, CONFIG_VT_CONSOLE)
  • /dev/console, /dev/null, /dev/tty0–4 exist within init ramfs
  • root=/dev/hda1, rootdelay=, init=/bin/sh as lilo params.
  • Minimal initrd with only essential device nodes
  • Removing /dev/hda* from initrd
  • Clean rebuilds of the kernel. I have a script that will
    • make oldconfig
    • make dep
    • make
    • make modules
    • make modules_install
    • make bzImage
    • cp to image to /boot
Same LILO config boots 2.0 kernel fine. So at this point I'm wondering: Is it actually viable to boot a 2.2 kernel on a Red Hat 5.2, or am I hitting an unavoidable kernel or /dev incompatibility? Any insight from people would be appreciated.
I'll second the other guys' kudos for taking on this project as a learning experience - and I suspect it will be a great learning experience.

My first distro was redhat 6.0 and, as a linux noob, getting it installed and running (and keeping it running) was a matter of luck rather than knowing what I was doing. All credit goes to whoever put together that installer. One of the reasons I moved on to DSL and, eventually, to Tiny Core was that I couldn't wrap my head around this new OS to the point of really understanding the boot process. With the passage of lots of years, I think I could grasp it a lot better - but I've moved on far enough now that that's not even on my to-do list any more.
 
Hello @stewartm82
Welcome to the Linux.org forum,
Interesting project. Thanks for sharing. As for the 2.2 kernel I believe if my memory is not completely gone that that kernel was not compatible with the older Glibc of Redhat 5.2. But it's been many years since I ran Redhat. So not sure.
Good luck on your project. Keep us posted how it turns out.
 
Hello @stewartm82
Welcome to the Linux.org forum,
Interesting project. Thanks for sharing. As for the 2.2 kernel I believe if my memory is not completely gone that that kernel was not compatible with the older Glibc of Redhat 5.2. But it's been many years since I ran Redhat. So not sure.
Good luck on your project. Keep us posted how it turns out.
When seeing that the 2.2 kernel was accompanied by a new glibc, that was my first thought, that the upgraded glibc might have made a difference. However, when compiling a kernel, glibc is not involved in the compilation since glibc is in user space whereas the compilation is within kernel space which is largely self-contained and building software to interact directly with the hardware. That's outside user space. The kernel build is using kernel headers and system calls and makefiles, that sort of thing which doesn't use or need glibc. User space apps use glibc and other libraries, which is all higher level than the kernel. Anyway, that's how I see it at the moment, which led me to consider the compatibility of the compilation tools themselves.
 
The “Warning: unable to open an initial console” on a 2.2 kernel usually means the kernel (or init) can’t open /dev/console (or a fallback tty) from whatever root filesystem it mounted first (your real root or your initrd). That’s almost always due to:

/dev/console missing or wrong type/major/minor,
console support not enabled in the kernel (virtual terminal/serial),
mounting a root/initrd whose /dev is empty/minimal,
wrong permissions/ownership on console devices,
booting with serial console without the right devices or kernel config.

You don’t need to “point LILO to a dev image” directly; if you use an initrd, you specify it with initrd=..., and that initrd must contain a proper /dev (including /dev/console). If you boot straight to the disk’s root fs, that /dev must be correct.

----------------

Verify your essential device nodes (on the root filesystem the 2.2 kernel will mount)
Boot the working 2.0 kernel. Then check and (re)create the must-have character devices:

Code:
# As root, on your *real* root filesystem (not a chroot, not a tmpfs):
ls -l /dev/console /dev/tty /dev/tty0 /dev/null /dev/zero /dev/ptmx || true

# Create/repair them if missing or wrong. The major/minor values are the classic ones:
# /dev/console  -> c 5,1  (permissions usually 0600 root:root)
# /dev/tty      -> c 5,0  (0666)
# /dev/tty0     -> c 4,0  (0666)  (VGA console first VT)
# /dev/null     -> c 1,3  (0666)
# /dev/zero     -> c 1,5  (0666)
# /dev/ptmx     -> c 5,2  (0666)  (ptmx for devpts, optional but helpful)

# Recreate with canonical modes:
mknod -m 600 /dev/console c 5 1
mknod -m 666 /dev/tty     c 5 0
mknod -m 666 /dev/tty0    c 4 0
mknod -m 666 /dev/null    c 1 3
mknod -m 666 /dev/zero    c 1 5
mknod -m 666 /dev/ptmx    c 5 2
chown root:root /dev/console /dev/tty /dev/tty0 /dev/null /dev/zero /dev/ptmx

The majors/minors did not change between 2.0 and 2.2 for these core devices; 2.2 is simply stricter about them being present and usable.

If you plan to use serial console, also make sure your serial devices exist

Code:
# Standard PC COM ports
mknod -m 660 /dev/ttyS0 c 4 64
mknod -m 660 /dev/ttyS1 c 4 65
chown root:uucp /dev/ttyS0 /dev/ttyS1  # or root:dialout depending on your system
``


Kernel config: enable console support that matches how you want to see output
Rebuild your 2.2 kernel with:

Built-in (not modules) for whatever is needed to get to the root fs.

Storage (IDE/SCSI driver for your disk controller) - ** NOTE - 2.x kernels do not support SSD/NVME drives. You will need an older drive.
Filesystem (likely ext2)

Console/VT support:

CONFIG_VT=y
CONFIG_VGA_CONSOLE=y (if using VGA text console)
CONFIG_SERIAL=y and CONFIG_SERIAL_CONSOLE=y (if using serial console)


Optional: CONFIG_UNIX98_PTYS=y and CONFIG_DEVPTS_FS=y if you want /dev/pts behavior. If you enable devpts, consider adding a mount in rc.sysinit:

Code:
mount -t devpts devpts /dev/pts

If you intend to use serial console,

Code:
append="console=ttyS0,115200n8"

Red Hat 5.2 used an initrd to preload SCSI/IDE modules for the root disk. If your 2.2 kernel has all storage + filesystem needed built-in, you can boot without an initrd. If you do use an initrd:

Build an initrd that includes:

Required storage modules
linuxrc or init script
A minimal /dev containing at least /dev/console, /dev/tty, /dev/null, etc.


Point LILO to it:

Code:
image=/boot/vmlinuz-2.2.x
    label=linux-2.2
    root=/dev/hda2           # adjust to your actual root
    read-only
    initrd=/boot/initrd-2.2.x.img
    append="...optional console=... if serial..."

Make sure /sbin/init exists and is executable. If debugging, you can try:

Code:
init=/bin/sh


Root FS driver must be built-in, not a module; otherwise the kernel can’t mount root, and you’ll fall back to the initrd and hit /dev issues.
If you see the console warning and other messages about “Trying to execute init” or “No init found”, confirm the path to /sbin/init and that your root device in LILO (root=/dev/…) is correct.
Make sure /dev is the real directory on your root (not a stale mount or mis-specified chroot when you created nodes).
Permissions: /dev/console typically 0600 root:root. Some init setups prefer 0600; others tolerate 0600/0620/0666. If paranoid, try 0660 root:tty and ensure init can open it.

You will need (at the very least) these devices.

Code:
# Core
mknod -m 600 /dev/console c 5 1
mknod -m 666 /dev/tty     c 5 0
mknod -m 666 /dev/tty0    c 4 0
mknod -m 666 /dev/null    c 1 3
mknod -m 666 /dev/zero    c 1 5
mknod -m 666 /dev/ptmx    c 5 2

# Optional  for ttys
for i in 1 2 3 4 5 6; do mknod -m 620 /dev/tty$i c 4 $i; done

# Serial (as needed)
mknod -m 660 /dev/ttyS0 c 4 64
mknod -m 660 /dev/ttyS1 c 4 65

Here is an example LILO I have used before.

Code:
image=/boot/vmlinuz-2.2.26      # adjust name
    label=linux-2.2
    root=/dev/hda2              # your root
    read-only
    append="console=tty0"       # or omit; or use console=ttyS0,115200


Given RH 5.2’s age, the most likely fix is:

Recreate /dev/console et al. on the root filesystem you’re booting with 2.2.
Ensure the 2.2 kernel has VT/VGA console (or serial console) enabled.
If you use an initrd, ensure it contains the device nodes (or remove the need for initrd by compiling drivers in).

You probably do not need different major/minor numbers for 2.2; you just need the correct classic ones present and accessible.

...as you can see, this is not a trival project.

How are you planning to console—VGA or serial? And are you building your storage + ext2 built-in or relying on modules/initrd?
 
@stewartm82 , having inspected the linux 2.2 kernel source now, I think a useful way to proceed to test the compilation/configuration problem is to try and compile the default configuration that comes with the source. It's located in the source tree at: linux/arch/i386/defconfig, and can be copied to a .config file in the root directory of the source. Then run make. If that compiles and runs, then the issue could be in your configurations as @dos2unix has outlined.

The default configuration does have all the "necessaries" in place such as:
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
CONFIG_SERIAL=y
as well as other vital configs all built into the kernel, and it's certainly a valid .config (as defconfig) that was released as linux 2.2. There are actually numerous patches that were subsequently applied which can be downloaded from https://ftp.funet.fi/index/Linux/kernel/v2.2, but they shouldn't be needed for this project AIUI. Good luck again. I think some readers would be very interested in your progress if you'd care to report it.
 
Last edited:
@stewartm82 , having inspected the linux 2.2 kernel source now, I think a useful way to proceed to test the compilation/configuration problem is to try and compile the default configuration that comes with the source. It's located in the source tree at: linux/arch/i386/defconfig, and can be copied to a .config file in the root directory of the source. Then run make. If that compiles and runs, then the issue could be in your configurations as @dos2unix has outlined.

The default configuration does have all the "necessaries" in place such as:
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
CONFIG_SERIAL=y
as well as other vital configs all built into the kernel, and it's certainly a valid .config (as defconfig) that was released as linux 2.2. There are actually numerous patches that were subsequently applied which can be downloaded from https://ftp.funet.fi/index/Linux/kernel/v2.2, but they shouldn't be needed for this project AIUI. Good luck again. I think some readers would be very interested in your progress if you'd care to report it.
Absolutely happy to keep reporting on it and thank you all so much for the warm welcome.

I was able to locate the original .config file from an RPM package provided with the CD. I used that as my starting point by copying it to my build location and running make oldconfig. I verified that all the options you suggested are enabled.

I'll add reviewing the patches to my list of ideas to explore. I'm hoping to avoid patching if possible.

@dos2unix
Thanks so much for your detailed post. I've spent a couple of days digesting it. What's interesting is that in my stock install of RHEL 5.2 with the 2.0 kernel, /dev/console has the major/minor numbers 4,0. I'm not sure why this differs from sources suggesting 5,1. I have tried both, but after changing to 5,1, my 2.0 kernel did not boot, so I might be stuck there.

I can confirm that the file system I'm using is ext2, as set up by the original 5.2 install. The file system drivers are built into the kernel, not modules. In menuconfig, I see * instead of M, including for IDE and ext2. Ideally, I want to avoid using an initramfs, as it adds complexity and I plan to build all required modules directly into the kernel.

I've been looking at the difference between VGA and serial consoles. I prefer VGA because it’s simpler, but currently, I can’t scroll back through the kernel boot messages. I may need to switch to a serial console using an adapter like this one:


My understanding is that with this, I can view all kernel boot messages on my modern Linux machine, which seems essential if I’m going to debug further. It’s kind of cool too.

It might be worth mentioning that I don’t see any output related to ide0 in the kernel messages during boot. It’s as if the IDE controller is not being detected at all. The system can see ide1 with the CD-ROM but not ide0.

Given that I’m using a CF-to-IDE adapter, I started researching this and found that Linux 2.2 might not have great support for this setup, whereas 2.4 reportedly handles it better. So I built the 2.4 kernel (after building new versions of binutils, GCC, make, and modutils—it took about 2 days, but it was fun). I can report that the 2.4 kernel does not boot either. It shows the same messages. I can confirm that all modules are compiled in, and I’ve tried both with and without an initramfs.

At this point, I think my next step is to get the serial cable linked above and see what output I can get via a serial console. I will order that in the new year.
 
Absolutely happy to keep reporting on it and thank you all so much for the warm welcome.
....
What's interesting is that in my stock install of RHEL 5.2 with the 2.0 kernel, /dev/console has the major/minor numbers 4,0. I'm not sure why this differs from sources suggesting 5,1. I have tried both, but after changing to 5,1, my 2.0 kernel did not boot, so I might be stuck there.

r.
Thanks for the info of this project.

It's probably worth noting the comments in the devices.txt file in the kernel documentation in relation to /dev/console. The following is from documentation in a later kernel's docs, but it's relevance is clear I think.
Code:
 4 char   TTY devices
         0 = /dev/tty0     Current virtual console
         1 = /dev/tty1     First virtual console
<snip>
 5 char   Alternate TTY devices
        0 = /dev/tty      Current TTY device
        1 = /dev/console  System console
        2 = /dev/ptmx     PTY master multiplex
        3 = /dev/ttyprintk    User messages via printk TTY device
       64 = /dev/cua0     Callout device for ttyS0
          ...
      255 = /dev/cua191   Callout device for ttyS191

      (5,1) is /dev/console starting with Linux 2.1.71.  See
      the section on terminal devices for more information
      on /dev/console.

Working with 2.0 and 2.2 or greater kernels can thus use different major and minor numbers for the creation of devices.

The basic difference between /dev/tty0 and /dev/console is that the kernel uses /dev/console as the destination of its messages like boot messages and panic messages. In current device directories it's common to see:
Code:
[~]$ ll /dev/console
crw------- 1 root root 5, 1 Dec 26 06:40 /dev/console
[~]$ ll /dev/tty0
crw------- 1 root tty 4, 0 Dec 26 06:39 /dev/tty0
They are not the same device, but when tty devices exist, the kernel messages appear on tty devices, so it looks as if there's a kernel option: console=tty0, but actually the kernel is using its console before /dev devices are set. When /dev/tty0 is set, and the environment is set for the use of /dev/tty0 in user space, that's when the messages can appear for the user if those tty virtual terminals exist.
 


Follow Linux.org


Top