06-05-2011, 02:11 PM
Abstract
When kernel functionality is desired in userspace, thecommon approach is to reimplement it for userspace interfaces.We show that use of existing kernel file systemsin userspace programs is possible without modifyingthe kernel file system code base. Two different operatingmodes are explored: 1) a transparent mode, inwhich the file system is mounted in the typical fashionby using the kernel code as a userspace server, and 2) astandalone mode, in which applications can use a kernelfile system as a library. The first mode provides isolationfrom the trusted computing base and a secure wayfor mounting untrusted file systems on a monolithic kernel.The second mode is useful for file system utilitiesand applications, such as populating an image or viewingthe contents without requiring host operating systemkernel support. Additional uses for both modes includedebugging, development and testing.The design and implementation of the RunnableUserspace Meta Program file system (rump fs) frameworkfor NetBSD is presented. Using rump, ten diskbasedfile systems, a memory file system, a network filesystem and a userspace framework file system have beentested to be functional. File system performance for anestimated typical workload is found to be ±5% of kernelperformance. The prototype of a similar frameworkfor Linux was also implemented and portability was verified:Linux file systems work on NetBSD and NetBSDfile systems work on Linux. Finally, the implementationis shown to be maintainable by examining the 1.5 yearperiod it has been a part of NetBSD.
1 Introduction
Motivation. “Userspace or kernel?” A typical caseof driver development starts with this exact question.The tradeoffs are classically well-understood: speed, efficiencyand stability for the kernel or ease of programmingand a more casual development style for userspace.The question stems from the different programming environmentsoffered by the two choices. Even if codewritten for the kernel is designed to be run in userspacefor testing, it is most likely implemented with #ifdef,crippled and does not support all features of kernelmode.Typical operating system kernels offer multitudes oftested and working code with reuse potential. A goodillustration is file system code, which in the case of mostoperating systems also comes with a virtual file systemabstraction [18] making access file system independent.By making kernel file systems function in userspace,existing code can be utilized for free in applications. Weaccomplished this by creating a shim layer to emulateenough of the kernel to make it possible to link and runthe kernel file system code. Additionally, we have createdsupplementary components necessary to integratethe file system code with a running system, i.e. mount itas a userspace file server. Our scheme requires no modificationsto existing kernel file system code.We define a Runnable Userspace Meta Programfile system (rump fs) to be kernel file system code usedin a userspace application or as a userspace file server.
Results. NetBSD [20] is a free 4.4BSD derived OS runningon over 50 platforms and used in the industry especiallyin embedded systems and servers. A real worldusable implementation of rump file systems, included inNetBSD since August 2007, has been written.The following NetBSD kernel file systems are usableand mountable in userspace without source modifications:cd9660, EFS, Ext2fs, FFS, HFS+, LFS,MSDOSFS, NFS (client1), NTFS, puffs, SysVBFS,tmpfs, and UDF. All are supported from the same codebasewithout file system specific custom code.Additionally, a quick prototype of a similar systemfor the Linux kernel was implemented. Under it, therelatively simple jffs2 [31] journaling file system fromthe Linux kernel is mountable as a userspace server onNetBSD.
Download full report
http://www.usenixevent/usenix09/tech/ful...kantee.pdf