[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] [PATCH] Enable support for DOS FAT12 partition types



Inside the kernel there is code to support FAT12 partitions, but it's
only used when the partition ID returned by the XHDI driver is NULL
then the kernel is assuming a floppy or other BIOS device, there isn't
FAT12 support if the kernel reads the DOS partition type ID 0x01.

Commit message:

Enable support for DOS FAT12 partition types (ID = 0x01).
Contributed by David Gálvez.
diff -r 21419534c943 -r 4e68173847cb sys/fatfs.c
--- a/sys/fatfs.c	Wed Dec 10 19:33:18 2014 +0100
+++ b/sys/fatfs.c	Sat Dec 13 10:40:26 2014 +0100
@@ -5252,6 +5252,12 @@
 
 		switch (di->id[2])
 		{
+			case 0x01:
+			{
+				xbpb->ftype = FAT_TYPE_12;
+				fvi = (void *) (u->data + sizeof (*fbs));
+				break;
+			}
 			case 0x04:
 			case 0x06:
 			case 0x0e: /* FAT16, partially or completely above sector 16,450,559 (DOS-limit for CHS access) */
diff -r 21419534c943 -r 4e68173847cb sys/usb/src.km/udd/storage/install.c
--- a/sys/usb/src.km/udd/storage/install.c	Wed Dec 10 19:33:18 2014 +0100
+++ b/sys/usb/src.km/udd/storage/install.c	Sat Dec 13 10:40:26 2014 +0100
@@ -108,7 +108,7 @@
 /*
  * DOS & Linux partition ids that we support
  */
-static const unsigned long valid_dos[] = { 0x04, 0x06, 0x0e, 0x0b, 0x0c, 0x81, 0x83, 0 };
+static const unsigned long valid_dos[] = { 0x01, 0x04, 0x06, 0x0e, 0x0b, 0x0c, 0x81, 0x83, 0 };
 
 /*
  *	local function prototypes
@@ -209,6 +209,8 @@
 	bpbptr->numcl = clusters;
 	if (clusters > sys_XHDOSLimits(XH_DL_CLUSTS12,0))
 		bpbptr->bflags = 1;					/* FAT16 */
+	else 
+		bpbptr->bflags = 0;					/* FAT12 */
 }
 
 #ifdef DEBUGGING_ROUTINES