JustKernel

Ray Of Hope

Tiny UserMode FileSystem

Ever wondered writing a file system driver and then dropped the idea because its way to complex.. It has happened to me.

Every time I tried to write a simple file system driver I need to leave in between , because its way to complex and may be because my basic concepts regarding file system were not clear..

Its important to realize that before capturing the big beast , you need the understand the basics of it. Basics are the founding stone towards complex tasks.

For eg..
If we are writing a file system driver then we should have answers to some initial set of questions like

  • how File System driver  keeps tracks of files and directories.
  • How File System driver  maintains this ordering i.e directory contains directories and then further files.
  • If user wants to access certain files, then how does driver finds the location and retrieves the content.
  • How FDs are mapped to actual files.
  • Why Metadata is useful.

These were some of the questions that I faced and I was sure in my mind I need to find a simple logical answers to these questions before proceeding to write a file system driver.

So following the funda of “Keep It Simple Stupid” and sticking to the basics I decided to write a simple User Mode File System filter Driver which can answer all my above queries and build my understanding towards diving into the deep world of inodes , Metadataetc.

Assumptions and requirement :

  1. My FileSystem has around 1 MB of heap space.
  2. Initial 500 bytes are to be reserved for Metadata.
  3. Directory structure is ROOT->mydir->File1/File2/File3
  4. Only 3 files are allowed File1, File2 and File3
  5. basic Functions supported fs_read, fs_write, fs_initialize, fs_ls.

Eager to see the code.. Wait for the next article..  Watch out for more after this break..:)

Originally Posted On: 2011-06-01 01:35:24

Anshul makkar,  anshul_makkar@justkernel.com

Tags:


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.