1.\" $NetBSD: rump.3,v 1.2 2009/03/22 05:41:49 pooka Exp $ 2.\" 3.\" Copyright (c) 2008 Antti Kantee. All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer. 10.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" notice, this list of conditions and the following disclaimer in the 12.\" documentation and/or other materials provided with the distribution. 13.\" 14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24.\" SUCH DAMAGE. 25.\" 26.Dd July 28, 2008 27.Dt RUMP 3 28.Os 29.Sh NAME 30.Nm rump 31.Nd Runnable Userspace Meta Program kernel 32.Sh LIBRARY 33rump Library (librump, \-lrump) 34.Sh SYNOPSIS 35.In rump/rump.h 36.In rump/rump_syscalls.h 37.In rump/rumpvnode_if.h 38.Sh DESCRIPTION 39.Nm 40emulates portions of the kernel in order to be able to run kernel code 41from a userspace application. 42For most parts kernel code is directly used, but in some cases such as 43with vm and device drivers a reimplementation suitable for userspace 44is provided. 45All of the routines in 46.Nm 47have been compiled in the kernel namespace with 48.Dv \-D_KERNEL . 49.Pp 50Although 51.Nm 52includes many kernel routines directly, userspace applications should 53not attempt to include 54.Nx 55system headers and call kernel functions directly. 56Instead, 57.Nm 58routines should be called. 59In case applications attempt to include 60.In sys 61headers from the 62.Nx 63tree, collisions will result on other platforms. 64.Pp 65Three classes of routines are provided by 66.Nm : 67.Bl -tag -width XXX -offset indent 68.It Native 69These routines have been handwritten for 70.Nm 71operation. 72Some are useful purely for 73.Nm , 74while others are merely interfaces to existing kernel routines. 75An example of the former is 76.Fn rump_fakeblk_register , 77while an example of the latter class is 78.Fn rump_vfs_unmount . 79.Pp 80The routines available in this class can be found from the header 81.In rump.h . 82.It System Calls 83It is possible to execute certain system calls from 84.Nm . 85However, contrary to real system calls, the kernel is never entered, 86but the system call backend code compiled into 87.Nm 88is merely called as a direct function call. 89.Pp 90The autogenerated list of system calls currently available in 91.Nm 92can be found from the header 93.In rump_syscalls.h . 94.It Vnode Interface 95To sort out namespace collisions for non-NetBSD platforms, the whole 96vnode interface set is provided under a special namespace. 97The operation is the same as in the kernel, but the interface names 98begin with the prefix RUMP_VOP. 99.Pp 100This class of routines is available from the autogenerated header 101.In rumpvnode_if.h . 102.El 103.Pp 104Before use 105.Nm 106must be initialized by calling 107.Fn rump_init . 108.Sh SEE ALSO 109.Xr p2k 3 , 110.Xr rumpuser 3 , 111.Xr ukfs 3 112.Rs 113.%A Antti Kantee 114.%D March 2009 115.%J Proceedings of AsiaBSDCon 2009 116.%P pp. 71-80 117.%T Environmental Independence: BSD Kernel TCP/IP in Userspace 118.Re 119.Sh HISTORY 120.Nm 121first appeared in 122.Nx 5.0 . 123.Sh AUTHORS 124.An Antti Kantee Aq pooka@iki.fi 125.Sh NOTE 126.Nm 127is highly experimental and may change in header location, library 128name, API and/or ABI without warning. 129