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

Re: [MiNT] [PATCH] USB mass storage partitions access (wrong patch!)



2014-02-14 14:15 GMT+01:00 Alan Hourihane <alanh@fairlite.co.uk>:
> I just tried applying this to the HEAD and it doesn't apply.
>
> Can you re-check David ?
>

Sorry again, I have such a mess here with several patches.

Attached you find one that should apply directly in the usb storage directory.
Index: bios.S
===================================================================
RCS file: /mint/freemint/sys/usb/src.km/udd/storage/bios.S,v
retrieving revision 1.7
diff -u -8 -r1.7 bios.S
--- bios.S	18 Feb 2013 23:32:13 -0000	1.7
+++ bios.S	14 Feb 2014 15:45:56 -0000
@@ -125,18 +125,25 @@
 	cmp.l #0xC,D2		// FAT32
 	beq.s .partition_ok
 	cmp.l #0x81,D2		// MINIX
 	beq.s .partition_ok
 	cmp.l #0x83,D2		// EXT2/LNX
 	bne .no_pinfo
 .partition_ok:
 	lea _pun_usb,A3
+	move.l pinfo_cookie(A3),D0	// PUN_INFO already installed?
+	cmp.l #0x41484449,D0		// AHDI
+	beq.s .pinfo_ok
 	move.l A3,pun_ptr
 	clr.w pinfo_puns(A3)
+	move.l #0x41484449,D0		// AHDI
+	move.l D0,pinfo_cookie(A3)
+	move.w #0x0300,D0
+	move.w D0,pinfo_vernum(A3)
 	move.w #0x4000,D0
 	move.w D0,pinfo_maxsiz(A3)
 	lea pinfo_pun(A3),A0
 	moveq #-1,D0
 	move.w D0,(A0)+          // drives A/B
 	move.l D0,(A0)+
 	move.l D0,(A0)+
 	move.l D0,(A0)+
Index: usb_storage.c
===================================================================
RCS file: /mint/freemint/sys/usb/src.km/udd/storage/usb_storage.c,v
retrieving revision 1.8
diff -u -8 -r1.8 usb_storage.c
--- usb_storage.c	4 Feb 2014 09:54:54 -0000	1.8
+++ usb_storage.c	14 Feb 2014 15:45:56 -0000
@@ -1942,17 +1942,17 @@
 
 long
 usb_storage_init(void)
 {
 	unsigned char i;
 
 	usb_stor_curr_dev = -1;
 	usb_1st_disk_drive = 0;
-	max_logical_drive = 0;	
+	max_logical_drive = 32; /* max XHDI major numbers available for USB */
 
 	if(usb_stor_buf == NULL)
 		usb_stor_buf = (unsigned char *)kmalloc(512);
 	if(usb_stor_buf == NULL)
 		return -1;
 
 	memset(usb_stor_buf, 0, sizeof(usb_stor_buf));