An empty drive and an unreadable diskette are different failures, and
until the previous patch SeaBIOS could not tell them apart: both ended
up in floppy_media_sense() exhausting the data rates and returning
DISK_RET_EMEDIA (0xC0). Now that the disk change line identifies an
absent medium, report it as DISK_RET_ETIMEOUT (0x80), the code the
INT 13h documentation gives for "time out, drive not ready".
floppy_media_sense() keeps DISK_RET_EMEDIA for a medium it cannot read.
0xC0 does not appear in the classic INT 13h status tables at all, and
guests treat it accordingly. Measured on an empty drive, with SeaBIOS
patched to return each code in turn. The guests here are German-language,
so their messages are quoted as they appear, with the English sense in
brackets:
PC-DOS 7, "dir a:"
0x80 "Nicht bereit beim Lesen von Laufwerk A"
[not ready reading drive A]
0xC0 "Allgemeiner Fehler beim Lesen von Laufwerk A"
[general failure reading drive A]
0xAA same message as 0xC0
0x99 same message as 0xC0 <- invented, not a real code
0x06 no message at all; DOS retries forever
Windows for Workgroups 3.11, File Manager, drive A:
0x80 "In Laufwerk A ist kein Datenträger eingelegt. Legen Sie einen
Datenträger ein, und versuchen Sie es erneut." [Wiederholen]
[there is no disk in drive A; insert one and try again]
0xC0 "Der Datenträger in Laufwerk A ist nicht formatiert. Möchten
Sie, daß der Datenträger jetzt formatiert wird?" [Ja] [Nein]
[the disk in drive A is not formatted; format it now?]
DOS gives 0xC0 the same message as the invented code 0x99, which is to
say it does not recognise it. Windows does recognise it, and offers to
format a diskette that is not there. Both are correct with 0x80.
Bochs BIOS, from which SeaBIOS descends, returns 0x80 here as well
("SET_AH(0x80); // drive not ready (timeout)"). It has no READ ID media
sensing; that arrived in SeaBIOS with commit e7c5a7ef, and DISK_RET_EMEDIA
came with it.
OS/2 2.11 and Linux are unaffected: both drive the controller through
their own drivers rather than INT 13h.
Not verified against real hardware -- I have none with a floppy drive.
Signed-off-by: Christian Quante <christian@quante.one>
---
src/hw/floppy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hw/floppy.c b/src/hw/floppy.c
index 20033fa3..d7249df4 100644
--- a/src/hw/floppy.c
+++ b/src/hw/floppy.c
@@ -498,7 +498,7 @@ floppy_check_media(struct drive_s *drive_gf, u8 floppyid)
return DISK_RET_SUCCESS;
dprintf(2, "Floppy_check_media %d: no medium\n", floppyid);
- return DISK_RET_EMEDIA;
+ return DISK_RET_ETIMEOUT;
}
static int
--
2.53.0
_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org