* [U-Boot-Users] fat32 w/o parition table? (a.k.a VBR instead of MBR)
@ 2008-05-08 20:33 Brad Parker
2008-06-04 22:05 ` Wolfgang Denk
0 siblings, 1 reply; 2+ messages in thread
From: Brad Parker @ 2008-05-08 20:33 UTC (permalink / raw)
To: u-boot
After some user complaints about not being able to fatls micro
sd cards which were formatted by Windows XP, I felt compelled to
make the following change (to u-boot 1.1.6, which I know is ancient,
but looking at the git tree, the latest doesn't handle it either near
as I can tell.
Just curious if anyone has any thoughts.
In the latest code, it seems like checking the partition table first
is dangerous as a VBR might looks like it has a partition table (but it
would be bogus)
Some documents suggest checking the first 3 bytes of the block for the
branch instructions. The idea being that an MBR with a valid partition
table won't have the branch. voodoo, I know...
-brad
--- fat.c.orig 2008-05-08 16:18:40.000000000 -0400
+++ fat.c 2008-05-08 12:54:56.000000000 -0400
@@ -52,6 +52,7 @@
#define DOS_PART_TBL_OFFSET 0x1be
#define DOS_PART_MAGIC_OFFSET 0x1fe
#define DOS_FS_TYPE_OFFSET 0x36
+#define DOS_FS_FAT32_TYPE_OFFSET 0x52
int disk_read (__u32 startblock, __u32 getsize, __u8 * bufptr)
{
@@ -85,7 +86,9 @@
return -1;
}
- if(!strncmp((char *)&buffer[DOS_FS_TYPE_OFFSET],"FAT",3)) {
+ if(!strncmp((char *)&buffer[DOS_FS_TYPE_OFFSET],"FAT",3) ||
+ !strncmp((char *)&buffer[DOS_FS_FAT32_TYPE_OFFSET],"FAT32",5))
+ {
/* ok, we assume we are on a PBR only */
cur_part = 1;
part_offset=0;
This lets me fatls/fatload from the fat32 file systems created by windows.
I've done a little FAT hacking, and I think this falls under the
category of "disk with VBR instead of MBR".
-brad
^ permalink raw reply [flat|nested] 2+ messages in thread* [U-Boot-Users] fat32 w/o parition table? (a.k.a VBR instead of MBR)
2008-05-08 20:33 [U-Boot-Users] fat32 w/o parition table? (a.k.a VBR instead of MBR) Brad Parker
@ 2008-06-04 22:05 ` Wolfgang Denk
0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Denk @ 2008-06-04 22:05 UTC (permalink / raw)
To: u-boot
Hello,
in message <1998.1210278835@mini> you wrote:
>
> After some user complaints about not being able to fatls micro
> sd cards which were formatted by Windows XP, I felt compelled to
> make the following change (to u-boot 1.1.6, which I know is ancient,
> but looking at the git tree, the latest doesn't handle it either near
> as I can tell.
>
> Just curious if anyone has any thoughts.
>
> In the latest code, it seems like checking the partition table first
> is dangerous as a VBR might looks like it has a partition table (but it
> would be bogus)
>
> Some documents suggest checking the first 3 bytes of the block for the
> branch instructions. The idea being that an MBR with a valid partition
> table won't have the branch. voodoo, I know...
Strangely enough, this message seems to have received no feedback at
all.
So what do we do about this?
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Leave bigotry in your quarters; there's no room for it on the bridge.
-- Kirk, "Balance of Terror", stardate 1709.2
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-06-04 22:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-08 20:33 [U-Boot-Users] fat32 w/o parition table? (a.k.a VBR instead of MBR) Brad Parker
2008-06-04 22:05 ` Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox