PORTS Forum

Ports and Interfaces => USB => Topic started by: ehenkes on June 01, 2010, 12:48:23 pm

Title: FAT module from Jan Axelson's book "usb mass storage" FAT16 --> FAT32
Post by: ehenkes on June 01, 2010, 12:48:23 pm
Jan Axelson's "usb mass storage" is a great book helping me in completing my hobby OS! I love it. However, I have to transfer the FAT16 modules to FAT16 and FAT32 because most sticks today are formatted with FAT32, if you buy them, and FAT16 ends with 2 GB.

Is there a link to this code adapted to FAT32? I am fighting with the Cache_File_Entry(...), fileFind(...). and fillFileObject(...).

FAT32 uses the root dir like a file (with a cluster chain in the FAT). 

Any help would be highly appreciated.

Title: Re: FAT module from Jan Axelson's book "usb mass storage" FAT16 --> FAT32
Post by: Jan Axelson on June 01, 2010, 04:26:09 pm
The code examples in USB Mass Storage are from Microchip's USB Framework. Microchip's current code supports FAT16 and FAT32 and thus may be helpful to you:

Microchip Applications Library

http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2680&dDocName=en547784

Jan
Title: Re: FAT module from Jan Axelson's book "usb mass storage" FAT16 --> FAT32
Post by: ehenkes on June 01, 2010, 06:19:25 pm
Thank you very much for this download link. A lot of interesting material included.  :)
File/Directory/FAT source code: FSIO.h/FSIO.c at ...\Microchip Solutions\Microchip\MDD File System\...

I would like to propose to explain in the book the difference between FAT16 and FAT32 root directory. At a FAT32 volume this entity is handled like a normal file in the data area with its own FAT cluster chain starting at first cluster that is typically cluster number 2. ;)
Title: Re: FAT module from Jan Axelson's book "usb mass storage" FAT16 --> FAT32
Post by: Jan Axelson on June 01, 2010, 10:00:48 pm
That's a good point. Thanks for the suggestion.

Jan
Title: Re: FAT module from Jan Axelson's book "usb mass storage" FAT16 --> FAT32
Post by: ehenkes on June 22, 2010, 02:21:15 pm
Microchip's USB Framework code is very helpful to get an overview, but the the code style is not homogeneous enough (e.g. return values, no C99 style, lot of unnecessary temporary variables). It also works for FAT12 usb msd. You can produce such by copying Floppy images to the stick with dd.