Page 1 of 1

Floppy emulation on old versions of Linux

Posted: Fri 05 Jan, 2018 8:33 pm
by teppic
With older Linux systems that were installed using a floppy there seems to be a bug with floppy drive detection. The boot begins but when the kernel finds the drive(s) it freezes. I've tried a few emulated machines and it's the same result.

Here is Red Hat Linux 4.1's boot floppy:

https://ufile.io/pnsuy

Re: Floppy emulation on old versions of Linux

Posted: Sun 07 Jan, 2018 6:13 am
by te_lanus
I tried it this morning and seems to work here:

Image Image

But the image you upload fails when it gets to the drive detection :( The same problem happens with Redhat 3.0.3

Re: Floppy emulation on old versions of Linux

Posted: Sun 07 Jan, 2018 4:25 pm
by teppic
The image works on VirtualBox and on the unofficial PCem fork - maybe there's some bug with how it sends raw codes to the drive instead of using the BIOS?

Re: Floppy emulation on old versions of Linux

Posted: Wed 24 Jan, 2018 9:06 pm
by teppic
I investigated this a little more. The same lockup problem occurs in Red Hat 5.2, but this is available as a bootable ISO CD. It wasn't anything to do with booting from the floppy itself. If I disabled the floppy controller in the BIOS the CD would boot normally (but obviously without any floppy drives available).

Re: Floppy emulation on old versions of Linux

Posted: Thu 25 Jan, 2018 1:07 am
by micronix
This problem seems to be caused by the floppy drive detection code in older linux kernels.
They are caught in an endless loop and send the sense interrupt command to the FDC over and over again.
I compiled two older kernels. The 2.0.27 kernel freezes and the 2.0.40 kernel boots up normally.
Slackware 1.2.0, which has kernel version 1.0.8 doesn't freeze, while Slackware 3.0 with kernel version 1.2.13 freezes.

The conclusion is, that the bug was introduced in a kernel version after 1.0.8 and fixed before version 2.0.40.

With PCem V11 and older, these buggy kernels didn't freeze. This only started with V12.
So I isolated the exact change in the PCem code which causes this behavior and reverted the change. After that, the buggy kernels boot again.
I created a patch and posted it in the Patches subforum if you are interested.

Re: Floppy emulation on old versions of Linux

Posted: Thu 25 Jan, 2018 11:09 am
by teppic
Thanks for looking into that. Maybe Sarah can see what's going on with the changes in PCem?