ARM based FAT12 implementation

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
System123
Member
Member
Posts: 196
Joined: Mon Jul 07, 2008 1:25 am

ARM based FAT12 implementation

Post 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
Gizmic OS
Currently - Busy with FAT12 driver and VFS
Cjreek
Member
Member
Posts: 70
Joined: Thu May 28, 2009 2:41 pm
Location: Germany

Re: ARM based FAT12 implementation

Post 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
alexfru
Member
Member
Posts: 1112
Joined: Tue Mar 04, 2014 5:27 am

Re: ARM based FAT12 implementation

Post 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.
User avatar
Arto
Member
Member
Posts: 44
Joined: Wed May 15, 2013 5:49 pm
Location: Berlin
Contact:

Re: ARM based FAT12 implementation

Post 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.
Developer of libc11
User avatar
Schol-R-LEA
Member
Member
Posts: 1925
Joined: Fri Oct 27, 2006 9:42 am
Location: Athens, GA, USA

Re: ARM based FAT12 implementation

Post 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).
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
Post Reply