Author Topic: Custom filesystem for embedded systems  (Read 1999 times)

0 Members and 1 Guest are viewing this topic.

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Custom filesystem for embedded systems
« on: March 08, 2014, 06:04:21 am »
I wanted to design my own filesystem for the eZ8 computer. I wanted to make it very simple to implement. It has these features:
-Block size:512 bytes (4 bytes per block reserved for filesystem)
-16 character filenames
-Wear leveling
-File fragmenting
-Variable-size file headers

-Scratching files by writing just two bytes
-No need for file indexing
-No need to alter the file header when appending new data to a file
-Flags for things like: executable, system/user-file
-Extended addressing for accessing external media like flash roms

-No directories yet, but can be implemented later on.

File structure:
Code: [Select]
File header:
offset | size | function
 +0       2      file identifier (0x0002 for start of file)
 +2       2      size of header (not including first 4 bytes)
 +4       16     filename
 +20      2      flags: executable,system/user-file
 +22      2      address of next block
 +24      2      size of block
(+26      2      extended address)
 -- Stream of Data --


Block header:
offset | size | function
 +0       2      address to next block
 +2       2      size of block (not including first 4 bytes)
-- Stream of Data --
File identifiers:
Code: [Select]


0x0000   Scratched file (file can be erased if no free blocks are available)
0x0002   Start of file
0xFFFE   Invalid. Used to identify the last block in a file.
0xFFFF   Free block


What do you think about this filesystem? Any suggestions/foreseen problems?
« Last Edit: March 08, 2014, 10:24:34 am by Keoni29 »
If you like my work: why not give me an internet?








Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: Custom filesystem for embedded systems
« Reply #1 on: March 08, 2014, 05:23:14 pm »
I just wrote a whole bunch of code. I can now search files, open them and read them as a continuous stream of data. Files can be more than one block large. It does not matter where the blocks are located because every block holds the address to the next block in its header.
If you like my work: why not give me an internet?