Roll Your Own Filesystem

From OSDev Wiki
Jump to navigation Jump to search

This page is under construction! This page or section is a work in progress and may thus be incomplete. Its content may be changed in the near future.

Difficulty level
Difficulty 4.png
Master

You shouldn't do this! This page or section is unconventional. You shouldn't do this.

Introduction

Please note that rolling your own filesystem IS NOT RECOMMENDED. You're likely to make it a FAT style filesystem, and please, we don't need another one of those. However, for those of you who wish to defy convention, then we need to stop you making another FAT for sanity's sake. So here is a tutorial on how to avoid a FAT (of course, the design is up to you, so we can't give you a complete tutorial on how to make it).

Use FUSE

The best practice for a new file system is to start with a FUSE driver. This is a simple user space application running on your build machine that allows mounting partition images of your file system. With that, you can easily create files and directories in the image, and later you can re-use significant parts of the code in your kernel when you'll write your native FS implementation. It is much preferable than writing your own image creator.

Avoiding FAT

So how do you avoid a FAT? It all comes down to recognizing a FAT and punching yourself if your FS matches the description.

Dos

  • Use trees
  • others?

Don'ts

  • Use a File Allocation Table
  • others?

Booting from your filesystem

You have 4 options here. Here are your options, in order of difficulty (and reward)