Re: How to write a file system?

H. Peter Anvin (hpa@transmeta.com)
18 Sep 1997 16:29:25 GMT


Followup to: <Pine.LNX.3.95.970918155733.5431A-100000@pc7537.hil.siemens.at>
By author: Ingo Molnar <mingo@pc7537.hil.siemens.at>
In newsgroup: linux.dev.kernel
>
> > Does anyone have in-depth information on how to write a file
> > system driver? I've read the part about file systems in the
> > Kernel Hackers Guide, but it's not very detailed.
>
> this isnt very detailed information, but anyway: look at patches which add
> a new filesystem. Eg fs/romfs around 2.1.20, or autofs. Cut out the diffs
> that add the new filesystem, and change all occurences to your 'newfs'
> string. That should give you a good skeleton to start. Try to implement a
> filesystem first that has a single inode, and sprintf() some 'Hello World'
> string if someone wants to know the content of the inode :)
>
> then add physical layout, more inodes, directories, etc. It's easy ;)
>

The book "Linux Kernel Internals" by Beck, Böhme, et al is a very good
reference, and really helped me get started with the VFS layer
interface. It is mostly accurate for 2.0.x still; 2.1.x is
*completely* different because of the new dentry mechanism...

-hpa

-- 
    PGP: 2047/2A960705 BA 03 D3 2C 14 A8 A8 BD  1E DF FE 69 EE 35 BD 74
    See http://www.zytor.com/~hpa/ for web page and full PGP public key
Always looking for a few good BOsFH.  **  Linux - the OS of global cooperation
        I am Baha'i -- ask me about it or see http://www.bahai.org/