Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kernel] Fix BIOS track read retry errors under QEMU #2063

Merged
merged 1 commit into from
Oct 6, 2024
Merged

Conversation

ghaerr
Copy link
Owner

@ghaerr ghaerr commented Oct 6, 2024

Fixes #1119.

While this fix has been coded using RESET_DISK_CHG for some time in bios.c, a test for running QEMU now makes the fix permanent, with no further bioshd(0) track read retry errors being displayed on the console.

Discussed recently in Mellvik/TLVC#88 (comment), this issue has been previously tested by @Mellvik on real hardware and was found to be a QEMU BIOS issue only. On QEMU, a BIOS disk reset is required when changing I/O (single or multi-sector) between floppy drives, for reasons unknown. This fix will allow for upcoming performance testing on QEMU without being concerned about track or sector I/O retries by automatically performing the required BIOS disk reset when needed.

The IODELAY option in bios.c is now enhanced to simulate realistic 1440k and 360k drive delays under QEMU (default OFF). A 1440k drive is assumed to be spinning at 300rpm (200ms/revolution) and 360k at 360rpm (167ms/revolution). A half-revolution delay plus additional time for the number of sectors read/written (~10ms/sector for 1440k and ~20ms for 360k) is performed, simulating average-case real hardware. Soon, this will be compared with the jiffies calculations @Mellvik is performing on real hardware in Mellvik/TLVC#88 for comparison and subsequent development of faster-booting disk images.

@Mellvik, feel free to comment on whether my floppy timings make sense for the two drives being simulated.

@Mellvik
Copy link
Contributor

Mellvik commented Oct 6, 2024

This looks good, @ghaerr. IIRC 3.5in drives are always 300rpm, 5.25in AT drives are always 360 rpm. Older 360k drives are 300rpm too, but not relevant to QEMU.
Looking forward to numbers. Will be really interesting to see how they add up and whether timings can be reliable on QEMU.

@ghaerr ghaerr merged commit 5d79fd2 into master Oct 6, 2024
2 checks passed
@ghaerr ghaerr deleted the track branch October 6, 2024 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BIOS track read retry errors when floppy sectors/track differ
2 participants