[syslinux] [memdisk] [patch] adjust order of DPT values in mstructs.h

perditionc at gmail.com perditionc at gmail.com
Sat Jun 18 08:30:23 PDT 2011


swap order of sectors/track with bytes/sector to match diskette
parameter table order (as pointed to by INT 1Eh)
---
This patch corrects an issue where FreeDOS kernel can not read from
the original floppy drive when moved to 2nd drive after loading a disk
image via memdisk from syslinux in VMWare.  Specifically, the DPT as
established by memdisk has these two bytes swapped, which results in
calls to read from the VMWare provided floppy to always fail as bytes
per sector has a value of 9 (as the disk image loaded is 360KB so has
9 sectors/track - the 2 stored in bps is overwritten with correct
value based on diskette size).  The patch merely swaps the order of
bps and sectors in the struct fd_dpt of struct dpt_t in mstructs.h to
correspond with documented (see RBIL and HelpPC) order of the disk
parameter table.
Thank you,
Kenneth J. Davis
jeremyd at fdos.org


diff --git a/memdisk/mstructs.h b/memdisk/mstructs.h
index fecbff4..0b0dc07 100644
--- a/memdisk/mstructs.h
+++ b/memdisk/mstructs.h
@@ -121,9 +121,9 @@ typedef union {
 	uint8_t specify1;	/* "First specify byte" */
 	uint8_t specify2;	/* "Second specify byte" */
 	uint8_t delay;		/* Delay until motor turn off */
-	uint8_t sectors;	/* Sectors/track */
-
 	uint8_t bps;		/* Bytes/sector (02h = 512) */
+
+	uint8_t sectors;	/* Sectors/track */
 	uint8_t isgap;		/* Length of intersector gap */
 	uint8_t dlen;		/* Data length (0FFh) */
 	uint8_t fgap;		/* Formatting gap */




More information about the Syslinux mailing list