Hi,

I prepare a new versione of fat support to test in user space, with some modification of the function. So before to post a patch in u-boot mailing list, we can adjust the library.

I send an archive that contains a first step in this direction

Regards Michael

[EMAIL PROTECTED] wrote:
Adrian Filipi wrote:

It looks like fat.c is not handling the case where the sectors/cluster is 1, and the rood directory spans multiple clusters.

In my case I was getting garbage directory info after the invalid fat error. The attached patch stops the code
from rolling past the end of cluster.

I was also getting these garbage directory entries which appeared
to be file nodes being interpreted as directory nodes.

I can confirm that Adrian's patch fixes this particular problem
for FAT32.  Now, on FAT32, whatever files are displayed by fatls
are also readable by fatload.  As Adrian mentions below, the files
not displayed by fatls are completely inaccessible to the current
fat.c with or without Adrian's patch.

FAT16 also suffered from this "garbage" problem when there were
512 files, but the patch also fixes this.  (If there is a volume
name, it should use one of the root directory entries, leaving
only 511 directory entries for files; otherwise, the lack/presence
of a volume name probably has no effect on FAT16.)

It looks like a loop to walk the allocation chain is necessary. I think get_contents() does all the right work,
but it of course starts with a directory entry, which we don't
have yet for /.  A little refactoring might do the trick.

Of course this only applies to FAT32.  Adrian's patch appears to
have fixed the only issue with FAT16 that I'm aware of.

Time permitting, I will try to fix this remaining problem myself.
Adrian, thanks for your insight into the problem and a potential
solution.

Sincerely,

Ken Fuchs


Attachment: user-uboot-fat.gz
Description: GNU Zip compressed data

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

Reply via email to