root/Whitix/publications/kernel_configuration.tex

Revision 871, 5.2 KB (checked in by mwhitworth, 3 years ago)

Add beginning of paper/article on systemfs.

Line 
1\documentclass[11pt,twocolumn]{article}
2\usepackage{abstract,footmisc}
3\begin{document}
4\title{A new approach to kernel configuration and object management}
5\author{Matthew Whitworth \\ Imperial College London
6\\ \texttt{mtw07@doc.ic.ac.uk}}
7\twocolumn[
8\maketitle
9\begin{onecolabstract}
10Configuration of kernel objects in today's operating system kernels is either inconsistent, unstable,
11unextendable or not unified. This paper introduces and explains the Whitix kernel's configuration
12system, \texttt{SystemFs}, which features a consistent, stable and unified API and filesystem interface for non-peristent
13create, read, update and delete (CRUD) operations on kernel objects and subsystems in user space and kernel space.
14\end{onecolabstract}
15]
16\section{Introduction} \label{section:introduction}
17From the beginning of Unix in the 1960s a stream model was used for device input and output. Using
18standard system calls such as \texttt{open}, \texttt{close}, \texttt{read} and \texttt{write}, any application with
19sufficient privileges, including the shell, could manipulate system devices with ease.
20
21However, it was clear by the release of Bell Labs' Version 7 Unix that a simple read/write interface
22for device I/O would not be sufficient for devices of ever-increasing complexity. The developers added a new system call,
23\texttt{ioctl}, that would enable device creation, configuration and retrieval of information.
24
25System developers and administrators soon required a way of retrieving information about the system in general,
26along with its devices. Plan 9 from Bell Labs, the research successor to Unix, invented the \texttt{proc} filesystem.
27Originally designed for process information exclusively, \texttt{proc} allowed the kernel to expose information about system
28internals to any application. The filesystem was later adopted by the Linux kernel and the BSDs, and expanded to include virtually
29everything about a running system.
30
31The 2.6 release of the Linux kernel added another kernel filesystem, \texttt{sysfs}, intended to present the kernel's
32device model to userspace in a read-only fashion to track device and subsystem updates and other system changes. Another filesystem,
33\texttt{configfs}, was introduced in 2.6 for creating and destroying devices, as well as modifying device attributes,
34but it has not seen wide adoption and kernel developers note that it duplicates many of the functions of \texttt{sysfs}.
35
36The Windows NT line of kernels is thought to expose the device filesystem in a similar way to that of Linux, although
37device files and system information is not mounted on the filesystem. The Windows Executive has an Object Manager, which manages
38resource management in the kernel. Reference-counted objects, such as devices and file handles, are created and managed, and any system call
39that modifies resource allocation goes via the Object Manager. However, to configure devices and other objects,
40\texttt{DeviceIoControl}, a \texttt{ioctl} equivalent, must be used.
41
42As of 2008, no desktop kernel offers a single interface for CRUD operations on kernel objects and subsystems. Whitix's
43\texttt{SystemFs} plans to solve these problems. The new filesystem also addresses a number of disadvantages with the numerous
44current approaches, listed below, as well as simplifying kernel system calls and increasing driver security.
45\section{Current approaches} \label{section:current approaches}
46\subsection{System and device information}
47Current operating systems expose information about the system and its device through a filesystem interface. In Linux,
48this is achieved through \texttt{/proc} and \texttt{/sys}, which contain information about the system and the system's devices respectively.
49There a number of disadvantages with the current filsystems:
50\begin{itemize}
51\item temp
52\end{itemize}
53\subsection{Device configuration}
54In a modern operating system, configuring drivers and their devices is usually performed through a
55single system call to the kernel, \texttt{ioctl} in UNIX derivatives such as Linux and
56Apple's Darwin, and \texttt{DeviceIoControl} in Windows NT and its successors. This approach has several downsides:
57\begin{itemize}
58\item \textbf{No clear interface}. The \texttt{ioctl} system call lacks any kind of clear interface, and adding \\
59a new \texttt{ioctl} case to a function is like adding another system call without a clear definition.
60\item \textbf{No filesystem access}. Devices and kernel objects can only be configured by user applications calling \texttt{ioctl}. Technical users who wish to configure a device have to find an application that does so or create one themselves; the latter is \\
61common if the device is very new or obscure.
62\item \textbf{Lack of security}. Since \texttt{ioctl} is called from user code and accepts user parameters, a number of checks
63must be performed on these parameters before they can be used. Failure to do so may result in buffer overflows or invalid data being written
64to devices.
65\end{itemize}
66\subsection{Device creation and removal}
67\section{SystemFs, a replacement}
68\section{SystemFs operations}
69\section{Implementation status}
70\section{Future improvements}
71\section{Conclusion}
72\section{Acknowledgements}
73\bibliographystyle{acm}
74\bibliography{kernel_configuration}
75\end{document}
Note: See TracBrowser for help on using the browser.