Close

4.2) File system and OS

A project log for A2Z Computer

A computer invented, designed and built from scratch. Custom CPU on FPGA.

f4hdkf4hdk 11/18/2016 at 19:230 Comments

File system:

The file system is very simple. It is based on a FAT (file allocation table). Each file entry (file or folder) contains the following information:

The index of a FAT entry is its position on the FAT table. I limit the file number to 1024, which is enough for 16MB, and the demonstrations.

The filesystem enables a tree structure, of course, with the help of the “folder field” of each FAT entry.

The FAT is the portion of the Flash that is re-written the most. Each modification of the file system leads to a FAT modification. I wanted to avoid re-writing always the same Flash blocs, therefore I implemented a mechanism that writes the FAT in 8 different places, written successively at each FAT update. A FAT index is used to find the freshest FAT out of the 8 FAT stored.

It is a bit useless because the usage of this computer is very small, but I coded that especially for fun.

The FAT is small (less than 64kB) and it is therefore always stored in RAM.

Limitations:

Flash Memory organization:

Human – Machine Interface : the file explorer.

I didn’t want a “command line” HMI. I hate command line OS, since my young age, when I used MS/DOS.

Therefore, I have coded a simple file explorer, with pseudo graphic interface, that shows the content of a folder, allows the user to select one file/folder with arrows, and propose actions to the user depending on the type of file/folder selected. This looks like the old “Norton Commander” on MS/DOS.

All the basic commands of a file explorer are available : copy, cut, paste, rename, create a new file or folder, delete.

You can also open a file. The action made while opening a file depends on the file type:

In the “action menu”, a specific action allows to update the content of the selected file, from the PC to the Flash. This is made in 2 manners:

OS or not OS ?

Finally, what I call “OS” is not really an OS. It is just a file explorer. All applications are almost totally independent from the OS, and they integrate their own driver to access to the hardware. There is no hardware abstraction made by the OS.

Discussions