Close

Making a Real Filesystem

A project log for MooseOS

x86 Operating System that runs on QEMU, Bochs and physical PCs.

ethan-zhangEthan Zhang 10/11/2025 at 02:000 Comments

Retroactive Log – September 1st (Reconstructed from memory and commit logs)

So far, I had just been using a makeshift filesystem. Since I was getting ambitious with this project, I wanted a real one, with dynamic file sizes and disk I/O. This definitely wasn't hard. I already had my own kernel memory allocator, so all I had to do was to malloc space when I want to make a file, and malloc more if the file size exceeds the size of its allocated memory. However, know that since I started this project with virtually no experience, I had to learn about superblocks, disk inodes, and lots more, which proved challenging because that week was exam week.

Disk I/O wasn't as hard. Since I already learnt how to set up bits, all I had to do was write a function that uploaded the entire filesystem, along with its custom signature, into the disk, which was a .img file QEMU generated. On startup, MooseOS would check the .img disk given to it, verify the signature, and store the disk contents in memory, ready for the process to be repeated.

Discussions