| 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} |
|---|
| 10 | Configuration of kernel objects in today's operating system kernels is either inconsistent, unstable, |
|---|
| 11 | unextendable or not unified. This paper introduces and explains the Whitix kernel's configuration |
|---|
| 12 | system, \texttt{SystemFs}, which features a consistent, stable and unified API and filesystem interface for non-peristent |
|---|
| 13 | create, 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} |
|---|
| 17 | From the beginning of Unix in the 1960s a stream model was used for device input and output. Using |
|---|
| 18 | standard system calls such as \texttt{open}, \texttt{close}, \texttt{read} and \texttt{write}, any application with |
|---|
| 19 | sufficient privileges, including the shell, could manipulate system devices with ease. |
|---|
| 20 | |
|---|
| 21 | However, it was clear by the release of Bell Labs' Version 7 Unix that a simple read/write interface |
|---|
| 22 | for 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 | |
|---|
| 25 | System developers and administrators soon required a way of retrieving information about the system in general, |
|---|
| 26 | along with its devices. Plan 9 from Bell Labs, the research successor to Unix, invented the \texttt{proc} filesystem. |
|---|
| 27 | Originally designed for process information exclusively, \texttt{proc} allowed the kernel to expose information about system |
|---|
| 28 | internals to any application. The filesystem was later adopted by the Linux kernel and the BSDs, and expanded to include virtually |
|---|
| 29 | everything about a running system. |
|---|
| 30 | |
|---|
| 31 | The 2.6 release of the Linux kernel added another kernel filesystem, \texttt{sysfs}, intended to present the kernel's |
|---|
| 32 | device 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, |
|---|
| 34 | but it has not seen wide adoption and kernel developers note that it duplicates many of the functions of \texttt{sysfs}. |
|---|
| 35 | |
|---|
| 36 | The Windows NT line of kernels is thought to expose the device filesystem in a similar way to that of Linux, although |
|---|
| 37 | device files and system information is not mounted on the filesystem. The Windows Executive has an Object Manager, which manages |
|---|
| 38 | resource management in the kernel. Reference-counted objects, such as devices and file handles, are created and managed, and any system call |
|---|
| 39 | that 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 | |
|---|
| 42 | As 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 |
|---|
| 44 | current 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} |
|---|
| 47 | Current operating systems expose information about the system and its device through a filesystem interface. In Linux, |
|---|
| 48 | this is achieved through \texttt{/proc} and \texttt{/sys}, which contain information about the system and the system's devices respectively. |
|---|
| 49 | There a number of disadvantages with the current filsystems: |
|---|
| 50 | \begin{itemize} |
|---|
| 51 | \item temp |
|---|
| 52 | \end{itemize} |
|---|
| 53 | \subsection{Device configuration} |
|---|
| 54 | In a modern operating system, configuring drivers and their devices is usually performed through a |
|---|
| 55 | single system call to the kernel, \texttt{ioctl} in UNIX derivatives such as Linux and |
|---|
| 56 | Apple'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 \\ |
|---|
| 59 | a 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 \\ |
|---|
| 61 | common 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 |
|---|
| 63 | must be performed on these parameters before they can be used. Failure to do so may result in buffer overflows or invalid data being written |
|---|
| 64 | to 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} |
|---|