Floppy emulation on old versions of Linux

Discussion of development and patch submission.
Post Reply
teppic
Posts: 42
Joined: Tue 20 Jun, 2017 12:31 pm

Floppy emulation on old versions of Linux

Post by teppic » Fri 05 Jan, 2018 8:33 pm

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

te_lanus
Posts: 64
Joined: Tue 28 Jul, 2015 4:47 am

Re: Floppy emulation on old versions of Linux

Post by te_lanus » Sun 07 Jan, 2018 6:13 am

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

teppic
Posts: 42
Joined: Tue 20 Jun, 2017 12:31 pm

Re: Floppy emulation on old versions of Linux

Post by teppic » Sun 07 Jan, 2018 4:25 pm

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?

teppic
Posts: 42
Joined: Tue 20 Jun, 2017 12:31 pm

Re: Floppy emulation on old versions of Linux

Post by teppic » Wed 24 Jan, 2018 9:06 pm

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).

micronix
Posts: 3
Joined: Mon 22 Jan, 2018 11:55 am

Re: Floppy emulation on old versions of Linux

Post by micronix » Thu 25 Jan, 2018 1:07 am

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.

teppic
Posts: 42
Joined: Tue 20 Jun, 2017 12:31 pm

Re: Floppy emulation on old versions of Linux

Post by teppic » Thu 25 Jan, 2018 11:09 am

Thanks for looking into that. Maybe Sarah can see what's going on with the changes in PCem?

Post Reply