Home

Filesystem


Access to the filesystem is handled by a separate kernel task contained in filesystem.c. Currently the filesystem handles messages to create, open, read from, write to and close files. In addition there are messages to delete a file, return a directory entry, and return the PID of the filesystem (I've got a feeling I'm going to need this at a later stage).

The filesystem is a limited implementation of the FAT filesystem. Currently I only deal with a flat filesystem containg up to 200 files. I may expand this to cover more features of a FAT filesystem or, more likely, I might write my own filesystem with more capabilities.

For the sake of efficiency the whole of the directory and the whole of the file allocation table are cached in memory - it doesn't really use up much memory. Currently, whenever anything changes in these items the whole lot is written back to disk. That's not very efficient! If I proceed much further with a FAT filesystem I'll make the routines a little more intelligent so that they only write back any sectors that have changed and wait a while before doing so to allow for several consecutive changes.

There's nothing particularly complicated about the filesystem code, so I don't intend to document it further at the moment.