tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Adding a new file system



I recently started writing a file system for some specific use-cases,
and had to make a number of changes. There was a request that I write
up the steps that needed to be taken, and so this tries to outline
them.

For the purposes of this write-up, we'll call the new file system NEWfs

1. the file system code itself - src/sys/fs/NEWfs/*

2. add the location and file-system related definition to 
   src/sys/conf/files
   include "fs/NEWfs/files.NEWfs"

3. construct a new kernel config file in src/sys/amd64/conf/NEWkernel
   include "arch/amd64/conf/GENERIC"
   file-system     NEWFS

4. add string definitions to src/sys/sys/mount.h
   #define MOUNT_NEWFS   "newfs"       /* New file system*/

5. add new vnodetagtype (VT_NEWFS) and string representation in
   VNODE_TAGS in the same respective places to src/sys/sys/vnode.h

6. add and populate src/sbin/mount_NEWfs

7. add and populate src/sbin/newfs_NEWfs

8. add new FSTYPE_DEFN src/sys/sys/disklabel.h
   x(NEWFS, 30, "NewFS",    NULL,  "newfs")/* NEW file system */

9. add another definition to src/sys/sys/disk.h
   #define      DKW_PTYPE_NEWFS "newfs"

10. add the DKW definition from src/sys/sys/disk.h to the code in
    src/common/lib/libutil/getfstypename.c
        case FS_NEWFS:
                return DKW_PTYPE_NEWFS;

Then I had to add some code so that I could build my new file system
with the rump infrastructure:

11. add the source directory for NEWfs to 
src/sys/rump/fs/lib/Makefile.rumpfscomp

12. add and populate src/sys/rump/fs/lib/libNEWfs

13. add and populate src/usr.bin/puffs/rump_NEWfs

14. add and populate src/sys/modules/NEWfs

Having built and installed all header files by "make includes", and
all libraries and programs by "make install", I could newfs to a file
system image, and use rump to mount the image on a directory.

Regards,
Alistair
Sat Jun  9 00:28:53 PDT 2012


Home | Main Index | Thread Index | Old Index