Page 1 of 1

ARM based FAT12 implementation

Posted: Wed Nov 19, 2014 6:56 am
by System123
Hi,

I was wondering if anyone had an efficient ARM FAT12 filesytem implementation. I came across "http://www.elm-chan.org/fsw/ff/00index_e.html" but it supports Fat32 and Fat16 and compiles to about 8KB in size. Which is too large for my bootloader application. I started writing my own implementation, but decided to see if anyone already had one which they are prepaed to share before I spend hours doing it from scratch.

Note: This is not for an OS, it is for a bootloader application that I am writing for a hobby project of mine. I want to try implement USB mass storage.

Thanks

Re: ARM based FAT12 implementation

Posted: Wed Nov 19, 2014 7:03 am
by Cjreek
A minimal FAT12 readonly driver is not that much work and also isn't that difficult.
Depending on how long you are already looking for existing code you probably could have written your own code by now ;) :P

Re: ARM based FAT12 implementation

Posted: Wed Nov 19, 2014 11:12 pm
by alexfru
I don't know how much space you have and how compact ARM instructions are in your case (I know that Thumb/Thumb2 exists because the old (original) 32 bits per instruction were a bit too many), but I was able to fit a FAT file loader (either FAT12 or FAT16 or FAT32, just one of the three) into a standard 512-byte PC bootsector with 80386 assembly and it also included code for .COM/.EXE setup/relocation. My guess would be that Thumb2 FAT12 code is likely going to fit the same space. Just write it. Or write it in C first and then convert into assembly.

Re: ARM based FAT12 implementation

Posted: Sat Nov 22, 2014 2:01 am
by Arto
The BrokenThorn tutorial contains a read-only FAT12 driver in less than 400 lines of C code. That might be a good starting point.

Re: ARM based FAT12 implementation

Posted: Wed Nov 26, 2014 7:38 pm
by Schol-R-LEA
I realize this is somewhat late in the game, but I have three questions: how proficient are you with ARM assembly language, how much space do you actually have for the boot loader on the device, and how large a storage capacity do you intend to support? The last is perhaps the most important question, as FAT12 has a maximum addressing capacity of 16MiB, which almost any USB device is likely to exceed by a considerable margin.

BTW, if you don't have any overriding requirements to support FAT, you might consider SimpleFS as an alternative that is both easier to implement and free of any patent taint (the long file name support for FAT is under patent).