Roll Your Own Filesystem: Difference between revisions

From OSDev.wiki
Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content added Content deleted
(idc)
m (Reverted edits by Leapofazzam (talk) to last revision by Bzt)
Line 21: Line 21:
You have 4 options here. Here are your options, in order of difficulty (and reward)
You have 4 options here. Here are your options, in order of difficulty (and reward)
* Don't boot from it. Use a dedicated boot partition (like [[EFI System Partition]]) and your FS as the root.
* Don't boot from it. Use a dedicated boot partition (like [[EFI System Partition]]) and your FS as the root.
* Use [[BOOTBOOT]] which can load an initial ramdisk from any file system.
* [[Rolling Your Own Bootloader | Roll your own bootloader]]
* [[Rolling Your Own Bootloader | Roll your own bootloader]]
* Use [[GRUB]] by [[Writing GRUB Modules|Writing a GRUB Module]]. You didn't expect GRUB to by pshycic and magically code itself, did you?
* Use [[GRUB]] by [[Writing GRUB Modules|Writing a GRUB Module]]. You didn't expect GRUB to by pshycic and magically code itself, did you?

Revision as of 10:30, 3 June 2022

This page is a work in progress.
This page may thus be incomplete. Its content may be changed in the near future.
Difficulty level

Master

Template:BadPractice

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)