[kernel] Fix BIOS track read retry errors under QEMU #2063
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 furtherbioshd(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 thejiffies
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.