Subject: importing userspace kernel file system framework
To: None <,>
From: Antti Kantee <>
List: tech-userlevel
Date: 08/02/2007 21:38:59

As my Google SoC 2007 project, I created a framework for running kernel
file system code in userspace.  The project is now mostly finished,
although some tweaking remains.

Why was this an interesting project?  Now it is possible to do file system
testing and development in an easy environment and try out new ideas
without risking crashing the system.  Once the tests and/or development
is over, the code can be directly dropped back into the kernel and be
run as a kernel file system.  It also permits learning about kernel file
systems much more easily, as single-stepping etcetc. is possible like
with any other user program.

I have run ffs, ntfs, efs, cd9660fs and tmpfs under the system.
Currently tmpfs works the best, as I rewrote a bunch of code to support
it and some polishing with "regular" file systems remains.  However,
all are expected to function mostly flawlessly in the coming days.

Coming to the beef of this mail, to keep the system functional, it
is important to have it compile in a standard build cycle to prevent
bitrotting caused by kernel interface changes.  As the system doesn't
really fit any existing shoe, I suggest creating a new top-level directory
to our source tree.  Currently I call this "sakern" for standalone kernel.
Items in this tree are built against the current kernel sources but
not installed.  Other areas such as support for networking code may be
added here in the future.


  - antti

Usage instructions follow:

If you wish to look/give a testrun at the code, see:
(as soon as the website updates)

or grab a tarball from:
(available now)

You will also need a source tree/system from after 20070801 and
support for puffs.  Drop the code to src/sakern, run make, cd into
sakern/fs/bin/$fs and run the binary ./fs device /mountpath.

IMPORTANT: I do not recommend trying it out on a real file system yet,
although I haven't had any problems with lost data.  The exception is
tmpfs, that you can try on a real filesystem ;).

Finally, for now you need to drop into /usr/share/mk.
It is available here:

In addition, you will most likely need an i386 host at this stage,
although that should get fixed shortly.

p.s.  The framework is called p2k for "puffs 2: kernel".  Think of it
as a sequel.

Antti Kantee <>                     Of course he runs NetBSD                
    "la qualité la plus indispensable du cuisinier est l'exactitude"