Searching \ for '[PIC] FAT16 question' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/microchip/devices.htm?key=pic
Search entire site for: 'FAT16 question'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] FAT16 question'
2006\05\31@125030 by Harold Hallikainen

face picon face
I hope this is ok under the PIC tag. I'm using a pic for it! I'm looking
at the contents of the sectors of an SD card formatted FAT16. I'm finding
the boot record for partition #1 at sector 0x5f. At offset 22 decimal is
supposed to be a 16 bit word with sectors/FAT, according to various
documents I've found on the web. This location has 0x00f2. The next word
(at offset 24 decimal) is supposed to be sectors/track (which seems
meaningless on an SD card). The value I'm finding there is 0x0020.

I find the first FAT at sector 0x60. I find the second FAT at sector 0x80.
I'm trying to figure out how one determines how long the FAT is (so I can
figure out where the second FAT starts and where the root directory starts
after it). It SEEMS we should somewhere have a "clusters per FAT" since
that would tell us how many FAT table entries there are. With
"sectors/FAT" we'd need to divide by the number of sectors per cluster
(which I'm finding in the boot record at offset 13 decimal as 0x04).

It IS interesting that the value at offset 24 (supposedly sectors/track)
has a value of 0x20, which appears to be the size of the FAT (first one at
sector 0x60, second at 0x80).

So... can someone suggest exactly what I should be looking at to determine
the size of the FAT?

THANKS!

Harold


--
FCC Rules Updated Daily at http://www.hallikainen.com - Advertising
opportunities available!

2006\05\31@132216 by Bob Axtell

face picon face
Harold Hallikainen wrote:
{Quote hidden}

You will drive yourself crazy trying to learn FAT16. The way several
folks have done it is to create a large
file which is contiguous and fills the entire SD card. Then simply write
directly into the file in a scheme that
will work for you. It becomes very easy this way. The "file" is never
removed, ever. But the PC can read it,
and its trivial for the host application to extract your data from it.

--Bob

2006\05\31@133049 by Alan B. Pearce

face picon face
>I'm looking at the contents of the sectors
>of an SD card formatted FAT16.

The definitive document is the Microsoft one, which includes pseudo C code
on how to deal with every item. Search the MS website for fatgen103.pdf (the
number might be greater, as that is the revision number) and all will become
clearer.

2006\05\31@142939 by Gordon Williams

picon face
I used the fatgen103.pdf doc to create FAT12 and FAT16 files on MMC cards
with a PIC.  You need to read the document carefully and don't assume
anything.

Also helpful is a disk viewer to see what you have on the card before and
after you let the PIC do its stuff.  I used WinHex disk viewer.

Good luck.

Gordon Williams

{Original Message removed}

2006\05\31@150514 by Harold Hallikainen

face picon face
Thanks! I'm reviewing fatgen103.pdf right now.

Harold


{Quote hidden}

> {Original Message removed}


'[PIC] FAT16 question'
2006\06\01@003805 by Herbert Graf
flavicon
face
On Wed, 2006-05-31 at 09:50 -0700, Harold Hallikainen wrote:
{Quote hidden}

My carmon project does a very minimalistic handling of a FAT16 volume,
basically by just reading and writing a single large file:

http://repatch.dyndns.org:8383/pic_stuff/carmon

That said, the only reason I did it that way was it was all the
functionality I needed. The references I provide point to all the
information you'd need to do a "real" FAT manipulation.

As a warning though, it can get pretty confusing very quickly, read the
sections very carefully, all the information is in the spec, but it
doesn't make sense the first time you read it.

On top of that, get a raw disk viewer (under windows winhex is
excellent) that will let you see the sectors. That will make things MUCH
easier to correlate.

TTYL

2006\06\01@090132 by Carey Fisher

face picon face

>
> On top of that, get a raw disk viewer (under windows winhex is
> excellent) that will let you see the sectors. That will make things MUCH
> easier to correlate.
>
> TTYL
>
>  
Probably should be a change of topic but... what sites do you trust to
get programs like
WinHex from?  WinHex doesn't seem to have it's own website but I found
plenty of sites
where I could download it but not sure how to know
anymore which ones to trust to have uncorrupted versions of
executables.  I still use TUCOWS
but are there other "trusted" sites for (shareware/freeware) programs
like WinHex?
--

*Carey Fisher, Chief Technical Officer
New Communications Solutions, LLC
*spam_OUTcareyfisherTakeThisOuTspamncsradio.com <.....careyfisherKILLspamspam@spam@ncsradio.com>
Toll Free Phone:888-883-5788
Local Phone:770-814-0683
FAX: 888-883-5788
http://www.ncsradio.com <http://www.ncsradio.com/>

More... (looser matching)
- Last day of these posts
- In 2006 , 2007 only
- Today
- New search...