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

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



I forgot to add the ID number to the supported partition list in
source's comment.
Attached a second version of the patch.

Please commit this version instead.

Thanks.


2014-12-13 11:56 GMT+01:00 David Gálvez <dgalvez75@gmail.com>:
> 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 09b767d6bf26 sys/fatfs.c
--- a/sys/fatfs.c	Wed Dec 10 19:33:18 2014 +0100
+++ b/sys/fatfs.c	Sat Dec 13 12:19:51 2014 +0100
@@ -5243,7 +5243,7 @@
 	else
 
 	/*
-	 * step 3: check for dos medium (supported signs: 0x04, 0x06, 0x0b, 0x0c, 0x0e)
+	 * step 3: check for dos medium (supported signs: 0x01, 0x04, 0x06, 0x0b, 0x0c, 0x0e)
 	 */
 
 	if (di->id[0] == '\0' && di->id[1] == 'D')
@@ -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 09b767d6bf26 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 12:19:51 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