SvarDOS / edrdos

Enhanced DR-DOS kernel and command interpreter ported to JWasm and OpenWatcom C
http://svardos.org/
Other
40 stars 4 forks source link

FORMAT fails on a wiped diskette smaller than the maximum supported size #105

Closed boeckmann closed 2 months ago

boeckmann commented 3 months ago

When I format a WIPED! 720K floppy in a 1.44M drive, or a wiped 360K diskette in a 1.2M drive, format fails. I will consider this a kernel bug unless proved not to be. This also occurs under the FreeDOS kernel. Seems not to occur if the floppy contains a valid BPB before formatting.

Bildschirmfoto 2024-08-24 um 13 19 49
boeckmann commented 3 months ago

Addition: I used format /F:720 flag to make sure if formats to the right size.

boeckmann commented 3 months ago

Nope, seems to be similar under the FreeDOS kernel. Do I something wrong here? Steps to reproduce:

MAC> dd if=/dev/zero of=test720.img count=1440 bs=512
DOS> format a: /f:720 /d
Bildschirmfoto 2024-08-24 um 15 01 12
boeckmann commented 3 months ago

It may be that the DOS kernel is informed too late about the changed disk geometry while formatting. There is a Force_Drive_Recheck() call after the Create_File_System(), forcing DOS to rebuild its DDT (FreeDOS) / UDSC (EDR). But Create_File_System already fails. Create_File_System seems to use DOS absolute disk reads and writes, I guess with 1.44 disk geometry in use on a 720K floppy, because it fails on sector 9 (which might be the 10th?). That should indeed fail on a 720K. Would at least explain why this works if a previously formatted 720K is re-formatted.

boeckmann commented 3 months ago

Someone commented out the Force_Drive_Recheck() following the bootsector write. But I think this had some side-effects leading to this trouble. I re-enable this and check again.

https://github.com/FDOS/format/blob/9fe81f425f63615587e625701213025a0a08224c/createfs.c#L167-L169

PerditionC commented 2 months ago

Can you try test release of format - https://github.com/FDOS/format/releases/download/v0.92/format-092a-test.zip It re-enabled the Force_Drive_Recheck(), but only for floppies.

boeckmann commented 2 months ago

When I made this change myself a few days ago (without the floppy test) this worked. Do you want me to nevertheless test your test release? Will do it on weekend then...

boeckmann commented 2 months ago

fixed as of FORMAT 0.92