2013-12-31 04:23:56 +04:00
|
|
|
/* $NetBSD: rump_allserver.c,v 1.33 2013/12/31 00:23:56 pooka Exp $ */
|
Add a rump server which comes with all the drivers currently
available. In terms of modules it maps to:
golem> rump.modstat
NAME CLASS SOURCE REFS SIZE REQUIRES
bpf driver builtin 0 - -
cd9660 vfs builtin 0 - -
cgd driver builtin 0 - -
dm driver builtin 0 - -
efs vfs builtin 0 - -
ext2fs vfs builtin 0 - ffs
fdesc vfs builtin 0 - -
ffs vfs builtin 3 - -
fss driver builtin 0 - -
hfs vfs builtin 0 - -
kernfs vfs builtin 0 - -
ksem misc builtin 0 - -
layerfs misc builtin 2 - -
lfs vfs builtin 0 - ffs
mfs vfs builtin 0 - ffs
msdos vfs builtin 0 - -
nfs vfs builtin 1 - -
nfsserver misc builtin 0 - nfs
nilfs vfs builtin 0 - -
ntfs vfs builtin 0 - -
null vfs builtin 0 - layerfs
pad driver builtin 0 - -
ptyfs vfs builtin 0 - -
puffs vfs builtin 0 - putter
putter driver builtin 1 - -
scsiverbose misc builtin 0 - -
smbfs vfs builtin 0 - -
suser secmodel builtin 0 - -
swsensor driver builtin 0 - -
sysvbfs vfs builtin 0 - -
tmpfs vfs builtin 0 - -
udf vfs builtin 0 - -
umap vfs builtin 0 - layerfs
union vfs builtin 0 - -
usbverbose misc builtin 0 - -
wapbl vfs builtin 0 - -
In terms of interfaces:
golem> rump.ifconfig -C
shmif virt lo carp
and dmesg:
NetBSD 5.99.41 (RUMP-ROAST) #0: Tue Nov 30 15:35:05 CET 2010
pooka@pain-rustique.localhost:/usr/allsrc/src/sys/rump/librump/rumpkern
total memory = unlimited (host limit)
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "rumpclk" frequency 100 Hz quality 0
cpu0 at thinair0: rump virtual cpu
cpu1 at thinair0: rump virtual cpu
root file system type: rumpfs
mainbus0 (root)
ugenhc0 at mainbus0
usb0 at ugenhc0: USB revision 2.0
uhub0 at usb0: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub0: 1 port with 1 removable, self powered
ugenhc1 at mainbus0
usb1 at ugenhc1: USB revision 2.0
uhub1 at usb1: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub1: 1 port with 1 removable, self powered
ugenhc2 at mainbus0
usb2 at ugenhc2: USB revision 2.0
uhub2 at usb2: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub2: 1 port with 1 removable, self powered
ugenhc3 at mainbus0
usb3 at ugenhc3: USB revision 2.0
uhub3 at usb3: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub3: 1 port with 1 removable, self powered
scsitest0 at mainbus0
scsibus0 at scsitest0: 2 targets, 1 lun per target
cd0 at scsibus0 target 1 lun 0: <RUMPHOBO, It's a LIE, 0.00> cdrom removable
Chicony Electronics Chicony Electronics, class 0/0, rev 2.00/1.00, addr 2, uhub0 port 1 not configured
AuthenTec AuthenTec, class 255/255, rev 1.10/6.21, addr 2, uhub1 port 1 not configured
swwdog0: software watchdog initialized
Kernelized RAIDframe activated
pad0: outputs: 44100Hz, 16-bit, stereo
audio0 at pad0: half duplex, playback, capture
There a bunch of other stuff which doesn't show up as any of the
above, plus of course the usb drivers which are probed only if I
have the appropriate hardware plugged into my workstation.
2010-12-05 20:37:32 +03:00
|
|
|
|
|
|
|
/*-
|
2011-02-04 23:06:23 +03:00
|
|
|
* Copyright (c) 2010, 2011 Antti Kantee. All Rights Reserved.
|
Add a rump server which comes with all the drivers currently
available. In terms of modules it maps to:
golem> rump.modstat
NAME CLASS SOURCE REFS SIZE REQUIRES
bpf driver builtin 0 - -
cd9660 vfs builtin 0 - -
cgd driver builtin 0 - -
dm driver builtin 0 - -
efs vfs builtin 0 - -
ext2fs vfs builtin 0 - ffs
fdesc vfs builtin 0 - -
ffs vfs builtin 3 - -
fss driver builtin 0 - -
hfs vfs builtin 0 - -
kernfs vfs builtin 0 - -
ksem misc builtin 0 - -
layerfs misc builtin 2 - -
lfs vfs builtin 0 - ffs
mfs vfs builtin 0 - ffs
msdos vfs builtin 0 - -
nfs vfs builtin 1 - -
nfsserver misc builtin 0 - nfs
nilfs vfs builtin 0 - -
ntfs vfs builtin 0 - -
null vfs builtin 0 - layerfs
pad driver builtin 0 - -
ptyfs vfs builtin 0 - -
puffs vfs builtin 0 - putter
putter driver builtin 1 - -
scsiverbose misc builtin 0 - -
smbfs vfs builtin 0 - -
suser secmodel builtin 0 - -
swsensor driver builtin 0 - -
sysvbfs vfs builtin 0 - -
tmpfs vfs builtin 0 - -
udf vfs builtin 0 - -
umap vfs builtin 0 - layerfs
union vfs builtin 0 - -
usbverbose misc builtin 0 - -
wapbl vfs builtin 0 - -
In terms of interfaces:
golem> rump.ifconfig -C
shmif virt lo carp
and dmesg:
NetBSD 5.99.41 (RUMP-ROAST) #0: Tue Nov 30 15:35:05 CET 2010
pooka@pain-rustique.localhost:/usr/allsrc/src/sys/rump/librump/rumpkern
total memory = unlimited (host limit)
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "rumpclk" frequency 100 Hz quality 0
cpu0 at thinair0: rump virtual cpu
cpu1 at thinair0: rump virtual cpu
root file system type: rumpfs
mainbus0 (root)
ugenhc0 at mainbus0
usb0 at ugenhc0: USB revision 2.0
uhub0 at usb0: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub0: 1 port with 1 removable, self powered
ugenhc1 at mainbus0
usb1 at ugenhc1: USB revision 2.0
uhub1 at usb1: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub1: 1 port with 1 removable, self powered
ugenhc2 at mainbus0
usb2 at ugenhc2: USB revision 2.0
uhub2 at usb2: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub2: 1 port with 1 removable, self powered
ugenhc3 at mainbus0
usb3 at ugenhc3: USB revision 2.0
uhub3 at usb3: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub3: 1 port with 1 removable, self powered
scsitest0 at mainbus0
scsibus0 at scsitest0: 2 targets, 1 lun per target
cd0 at scsibus0 target 1 lun 0: <RUMPHOBO, It's a LIE, 0.00> cdrom removable
Chicony Electronics Chicony Electronics, class 0/0, rev 2.00/1.00, addr 2, uhub0 port 1 not configured
AuthenTec AuthenTec, class 255/255, rev 1.10/6.21, addr 2, uhub1 port 1 not configured
swwdog0: software watchdog initialized
Kernelized RAIDframe activated
pad0: outputs: 44100Hz, 16-bit, stereo
audio0 at pad0: half duplex, playback, capture
There a bunch of other stuff which doesn't show up as any of the
above, plus of course the usb drivers which are probed only if I
have the appropriate hardware plugged into my workstation.
2010-12-05 20:37:32 +03:00
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
|
|
|
|
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
|
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
|
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
2013-09-10 21:59:52 +04:00
|
|
|
#include <rump/rumpuser_port.h>
|
|
|
|
|
Add a rump server which comes with all the drivers currently
available. In terms of modules it maps to:
golem> rump.modstat
NAME CLASS SOURCE REFS SIZE REQUIRES
bpf driver builtin 0 - -
cd9660 vfs builtin 0 - -
cgd driver builtin 0 - -
dm driver builtin 0 - -
efs vfs builtin 0 - -
ext2fs vfs builtin 0 - ffs
fdesc vfs builtin 0 - -
ffs vfs builtin 3 - -
fss driver builtin 0 - -
hfs vfs builtin 0 - -
kernfs vfs builtin 0 - -
ksem misc builtin 0 - -
layerfs misc builtin 2 - -
lfs vfs builtin 0 - ffs
mfs vfs builtin 0 - ffs
msdos vfs builtin 0 - -
nfs vfs builtin 1 - -
nfsserver misc builtin 0 - nfs
nilfs vfs builtin 0 - -
ntfs vfs builtin 0 - -
null vfs builtin 0 - layerfs
pad driver builtin 0 - -
ptyfs vfs builtin 0 - -
puffs vfs builtin 0 - putter
putter driver builtin 1 - -
scsiverbose misc builtin 0 - -
smbfs vfs builtin 0 - -
suser secmodel builtin 0 - -
swsensor driver builtin 0 - -
sysvbfs vfs builtin 0 - -
tmpfs vfs builtin 0 - -
udf vfs builtin 0 - -
umap vfs builtin 0 - layerfs
union vfs builtin 0 - -
usbverbose misc builtin 0 - -
wapbl vfs builtin 0 - -
In terms of interfaces:
golem> rump.ifconfig -C
shmif virt lo carp
and dmesg:
NetBSD 5.99.41 (RUMP-ROAST) #0: Tue Nov 30 15:35:05 CET 2010
pooka@pain-rustique.localhost:/usr/allsrc/src/sys/rump/librump/rumpkern
total memory = unlimited (host limit)
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "rumpclk" frequency 100 Hz quality 0
cpu0 at thinair0: rump virtual cpu
cpu1 at thinair0: rump virtual cpu
root file system type: rumpfs
mainbus0 (root)
ugenhc0 at mainbus0
usb0 at ugenhc0: USB revision 2.0
uhub0 at usb0: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub0: 1 port with 1 removable, self powered
ugenhc1 at mainbus0
usb1 at ugenhc1: USB revision 2.0
uhub1 at usb1: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub1: 1 port with 1 removable, self powered
ugenhc2 at mainbus0
usb2 at ugenhc2: USB revision 2.0
uhub2 at usb2: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub2: 1 port with 1 removable, self powered
ugenhc3 at mainbus0
usb3 at ugenhc3: USB revision 2.0
uhub3 at usb3: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub3: 1 port with 1 removable, self powered
scsitest0 at mainbus0
scsibus0 at scsitest0: 2 targets, 1 lun per target
cd0 at scsibus0 target 1 lun 0: <RUMPHOBO, It's a LIE, 0.00> cdrom removable
Chicony Electronics Chicony Electronics, class 0/0, rev 2.00/1.00, addr 2, uhub0 port 1 not configured
AuthenTec AuthenTec, class 255/255, rev 1.10/6.21, addr 2, uhub1 port 1 not configured
swwdog0: software watchdog initialized
Kernelized RAIDframe activated
pad0: outputs: 44100Hz, 16-bit, stereo
audio0 at pad0: half duplex, playback, capture
There a bunch of other stuff which doesn't show up as any of the
above, plus of course the usb drivers which are probed only if I
have the appropriate hardware plugged into my workstation.
2010-12-05 20:37:32 +03:00
|
|
|
#ifndef lint
|
2013-12-31 04:23:56 +04:00
|
|
|
__RCSID("$NetBSD: rump_allserver.c,v 1.33 2013/12/31 00:23:56 pooka Exp $");
|
Add a rump server which comes with all the drivers currently
available. In terms of modules it maps to:
golem> rump.modstat
NAME CLASS SOURCE REFS SIZE REQUIRES
bpf driver builtin 0 - -
cd9660 vfs builtin 0 - -
cgd driver builtin 0 - -
dm driver builtin 0 - -
efs vfs builtin 0 - -
ext2fs vfs builtin 0 - ffs
fdesc vfs builtin 0 - -
ffs vfs builtin 3 - -
fss driver builtin 0 - -
hfs vfs builtin 0 - -
kernfs vfs builtin 0 - -
ksem misc builtin 0 - -
layerfs misc builtin 2 - -
lfs vfs builtin 0 - ffs
mfs vfs builtin 0 - ffs
msdos vfs builtin 0 - -
nfs vfs builtin 1 - -
nfsserver misc builtin 0 - nfs
nilfs vfs builtin 0 - -
ntfs vfs builtin 0 - -
null vfs builtin 0 - layerfs
pad driver builtin 0 - -
ptyfs vfs builtin 0 - -
puffs vfs builtin 0 - putter
putter driver builtin 1 - -
scsiverbose misc builtin 0 - -
smbfs vfs builtin 0 - -
suser secmodel builtin 0 - -
swsensor driver builtin 0 - -
sysvbfs vfs builtin 0 - -
tmpfs vfs builtin 0 - -
udf vfs builtin 0 - -
umap vfs builtin 0 - layerfs
union vfs builtin 0 - -
usbverbose misc builtin 0 - -
wapbl vfs builtin 0 - -
In terms of interfaces:
golem> rump.ifconfig -C
shmif virt lo carp
and dmesg:
NetBSD 5.99.41 (RUMP-ROAST) #0: Tue Nov 30 15:35:05 CET 2010
pooka@pain-rustique.localhost:/usr/allsrc/src/sys/rump/librump/rumpkern
total memory = unlimited (host limit)
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "rumpclk" frequency 100 Hz quality 0
cpu0 at thinair0: rump virtual cpu
cpu1 at thinair0: rump virtual cpu
root file system type: rumpfs
mainbus0 (root)
ugenhc0 at mainbus0
usb0 at ugenhc0: USB revision 2.0
uhub0 at usb0: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub0: 1 port with 1 removable, self powered
ugenhc1 at mainbus0
usb1 at ugenhc1: USB revision 2.0
uhub1 at usb1: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub1: 1 port with 1 removable, self powered
ugenhc2 at mainbus0
usb2 at ugenhc2: USB revision 2.0
uhub2 at usb2: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub2: 1 port with 1 removable, self powered
ugenhc3 at mainbus0
usb3 at ugenhc3: USB revision 2.0
uhub3 at usb3: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub3: 1 port with 1 removable, self powered
scsitest0 at mainbus0
scsibus0 at scsitest0: 2 targets, 1 lun per target
cd0 at scsibus0 target 1 lun 0: <RUMPHOBO, It's a LIE, 0.00> cdrom removable
Chicony Electronics Chicony Electronics, class 0/0, rev 2.00/1.00, addr 2, uhub0 port 1 not configured
AuthenTec AuthenTec, class 255/255, rev 1.10/6.21, addr 2, uhub1 port 1 not configured
swwdog0: software watchdog initialized
Kernelized RAIDframe activated
pad0: outputs: 44100Hz, 16-bit, stereo
audio0 at pad0: half duplex, playback, capture
There a bunch of other stuff which doesn't show up as any of the
above, plus of course the usb drivers which are probed only if I
have the appropriate hardware plugged into my workstation.
2010-12-05 20:37:32 +03:00
|
|
|
#endif /* !lint */
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
2013-09-10 21:59:52 +04:00
|
|
|
#include <sys/stat.h>
|
Add a rump server which comes with all the drivers currently
available. In terms of modules it maps to:
golem> rump.modstat
NAME CLASS SOURCE REFS SIZE REQUIRES
bpf driver builtin 0 - -
cd9660 vfs builtin 0 - -
cgd driver builtin 0 - -
dm driver builtin 0 - -
efs vfs builtin 0 - -
ext2fs vfs builtin 0 - ffs
fdesc vfs builtin 0 - -
ffs vfs builtin 3 - -
fss driver builtin 0 - -
hfs vfs builtin 0 - -
kernfs vfs builtin 0 - -
ksem misc builtin 0 - -
layerfs misc builtin 2 - -
lfs vfs builtin 0 - ffs
mfs vfs builtin 0 - ffs
msdos vfs builtin 0 - -
nfs vfs builtin 1 - -
nfsserver misc builtin 0 - nfs
nilfs vfs builtin 0 - -
ntfs vfs builtin 0 - -
null vfs builtin 0 - layerfs
pad driver builtin 0 - -
ptyfs vfs builtin 0 - -
puffs vfs builtin 0 - putter
putter driver builtin 1 - -
scsiverbose misc builtin 0 - -
smbfs vfs builtin 0 - -
suser secmodel builtin 0 - -
swsensor driver builtin 0 - -
sysvbfs vfs builtin 0 - -
tmpfs vfs builtin 0 - -
udf vfs builtin 0 - -
umap vfs builtin 0 - layerfs
union vfs builtin 0 - -
usbverbose misc builtin 0 - -
wapbl vfs builtin 0 - -
In terms of interfaces:
golem> rump.ifconfig -C
shmif virt lo carp
and dmesg:
NetBSD 5.99.41 (RUMP-ROAST) #0: Tue Nov 30 15:35:05 CET 2010
pooka@pain-rustique.localhost:/usr/allsrc/src/sys/rump/librump/rumpkern
total memory = unlimited (host limit)
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "rumpclk" frequency 100 Hz quality 0
cpu0 at thinair0: rump virtual cpu
cpu1 at thinair0: rump virtual cpu
root file system type: rumpfs
mainbus0 (root)
ugenhc0 at mainbus0
usb0 at ugenhc0: USB revision 2.0
uhub0 at usb0: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub0: 1 port with 1 removable, self powered
ugenhc1 at mainbus0
usb1 at ugenhc1: USB revision 2.0
uhub1 at usb1: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub1: 1 port with 1 removable, self powered
ugenhc2 at mainbus0
usb2 at ugenhc2: USB revision 2.0
uhub2 at usb2: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub2: 1 port with 1 removable, self powered
ugenhc3 at mainbus0
usb3 at ugenhc3: USB revision 2.0
uhub3 at usb3: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub3: 1 port with 1 removable, self powered
scsitest0 at mainbus0
scsibus0 at scsitest0: 2 targets, 1 lun per target
cd0 at scsibus0 target 1 lun 0: <RUMPHOBO, It's a LIE, 0.00> cdrom removable
Chicony Electronics Chicony Electronics, class 0/0, rev 2.00/1.00, addr 2, uhub0 port 1 not configured
AuthenTec AuthenTec, class 255/255, rev 1.10/6.21, addr 2, uhub1 port 1 not configured
swwdog0: software watchdog initialized
Kernelized RAIDframe activated
pad0: outputs: 44100Hz, 16-bit, stereo
audio0 at pad0: half duplex, playback, capture
There a bunch of other stuff which doesn't show up as any of the
above, plus of course the usb drivers which are probed only if I
have the appropriate hardware plugged into my workstation.
2010-12-05 20:37:32 +03:00
|
|
|
|
2010-12-13 16:32:25 +03:00
|
|
|
#include <dlfcn.h>
|
Add a rump server which comes with all the drivers currently
available. In terms of modules it maps to:
golem> rump.modstat
NAME CLASS SOURCE REFS SIZE REQUIRES
bpf driver builtin 0 - -
cd9660 vfs builtin 0 - -
cgd driver builtin 0 - -
dm driver builtin 0 - -
efs vfs builtin 0 - -
ext2fs vfs builtin 0 - ffs
fdesc vfs builtin 0 - -
ffs vfs builtin 3 - -
fss driver builtin 0 - -
hfs vfs builtin 0 - -
kernfs vfs builtin 0 - -
ksem misc builtin 0 - -
layerfs misc builtin 2 - -
lfs vfs builtin 0 - ffs
mfs vfs builtin 0 - ffs
msdos vfs builtin 0 - -
nfs vfs builtin 1 - -
nfsserver misc builtin 0 - nfs
nilfs vfs builtin 0 - -
ntfs vfs builtin 0 - -
null vfs builtin 0 - layerfs
pad driver builtin 0 - -
ptyfs vfs builtin 0 - -
puffs vfs builtin 0 - putter
putter driver builtin 1 - -
scsiverbose misc builtin 0 - -
smbfs vfs builtin 0 - -
suser secmodel builtin 0 - -
swsensor driver builtin 0 - -
sysvbfs vfs builtin 0 - -
tmpfs vfs builtin 0 - -
udf vfs builtin 0 - -
umap vfs builtin 0 - layerfs
union vfs builtin 0 - -
usbverbose misc builtin 0 - -
wapbl vfs builtin 0 - -
In terms of interfaces:
golem> rump.ifconfig -C
shmif virt lo carp
and dmesg:
NetBSD 5.99.41 (RUMP-ROAST) #0: Tue Nov 30 15:35:05 CET 2010
pooka@pain-rustique.localhost:/usr/allsrc/src/sys/rump/librump/rumpkern
total memory = unlimited (host limit)
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "rumpclk" frequency 100 Hz quality 0
cpu0 at thinair0: rump virtual cpu
cpu1 at thinair0: rump virtual cpu
root file system type: rumpfs
mainbus0 (root)
ugenhc0 at mainbus0
usb0 at ugenhc0: USB revision 2.0
uhub0 at usb0: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub0: 1 port with 1 removable, self powered
ugenhc1 at mainbus0
usb1 at ugenhc1: USB revision 2.0
uhub1 at usb1: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub1: 1 port with 1 removable, self powered
ugenhc2 at mainbus0
usb2 at ugenhc2: USB revision 2.0
uhub2 at usb2: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub2: 1 port with 1 removable, self powered
ugenhc3 at mainbus0
usb3 at ugenhc3: USB revision 2.0
uhub3 at usb3: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub3: 1 port with 1 removable, self powered
scsitest0 at mainbus0
scsibus0 at scsitest0: 2 targets, 1 lun per target
cd0 at scsibus0 target 1 lun 0: <RUMPHOBO, It's a LIE, 0.00> cdrom removable
Chicony Electronics Chicony Electronics, class 0/0, rev 2.00/1.00, addr 2, uhub0 port 1 not configured
AuthenTec AuthenTec, class 255/255, rev 1.10/6.21, addr 2, uhub1 port 1 not configured
swwdog0: software watchdog initialized
Kernelized RAIDframe activated
pad0: outputs: 44100Hz, 16-bit, stereo
audio0 at pad0: half duplex, playback, capture
There a bunch of other stuff which doesn't show up as any of the
above, plus of course the usb drivers which are probed only if I
have the appropriate hardware plugged into my workstation.
2010-12-05 20:37:32 +03:00
|
|
|
#include <errno.h>
|
2010-12-14 19:40:05 +03:00
|
|
|
#include <fcntl.h>
|
2010-12-12 21:32:47 +03:00
|
|
|
#include <semaphore.h>
|
2013-12-31 04:23:56 +04:00
|
|
|
#include <signal.h>
|
Add a rump server which comes with all the drivers currently
available. In terms of modules it maps to:
golem> rump.modstat
NAME CLASS SOURCE REFS SIZE REQUIRES
bpf driver builtin 0 - -
cd9660 vfs builtin 0 - -
cgd driver builtin 0 - -
dm driver builtin 0 - -
efs vfs builtin 0 - -
ext2fs vfs builtin 0 - ffs
fdesc vfs builtin 0 - -
ffs vfs builtin 3 - -
fss driver builtin 0 - -
hfs vfs builtin 0 - -
kernfs vfs builtin 0 - -
ksem misc builtin 0 - -
layerfs misc builtin 2 - -
lfs vfs builtin 0 - ffs
mfs vfs builtin 0 - ffs
msdos vfs builtin 0 - -
nfs vfs builtin 1 - -
nfsserver misc builtin 0 - nfs
nilfs vfs builtin 0 - -
ntfs vfs builtin 0 - -
null vfs builtin 0 - layerfs
pad driver builtin 0 - -
ptyfs vfs builtin 0 - -
puffs vfs builtin 0 - putter
putter driver builtin 1 - -
scsiverbose misc builtin 0 - -
smbfs vfs builtin 0 - -
suser secmodel builtin 0 - -
swsensor driver builtin 0 - -
sysvbfs vfs builtin 0 - -
tmpfs vfs builtin 0 - -
udf vfs builtin 0 - -
umap vfs builtin 0 - layerfs
union vfs builtin 0 - -
usbverbose misc builtin 0 - -
wapbl vfs builtin 0 - -
In terms of interfaces:
golem> rump.ifconfig -C
shmif virt lo carp
and dmesg:
NetBSD 5.99.41 (RUMP-ROAST) #0: Tue Nov 30 15:35:05 CET 2010
pooka@pain-rustique.localhost:/usr/allsrc/src/sys/rump/librump/rumpkern
total memory = unlimited (host limit)
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "rumpclk" frequency 100 Hz quality 0
cpu0 at thinair0: rump virtual cpu
cpu1 at thinair0: rump virtual cpu
root file system type: rumpfs
mainbus0 (root)
ugenhc0 at mainbus0
usb0 at ugenhc0: USB revision 2.0
uhub0 at usb0: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub0: 1 port with 1 removable, self powered
ugenhc1 at mainbus0
usb1 at ugenhc1: USB revision 2.0
uhub1 at usb1: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub1: 1 port with 1 removable, self powered
ugenhc2 at mainbus0
usb2 at ugenhc2: USB revision 2.0
uhub2 at usb2: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub2: 1 port with 1 removable, self powered
ugenhc3 at mainbus0
usb3 at ugenhc3: USB revision 2.0
uhub3 at usb3: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub3: 1 port with 1 removable, self powered
scsitest0 at mainbus0
scsibus0 at scsitest0: 2 targets, 1 lun per target
cd0 at scsibus0 target 1 lun 0: <RUMPHOBO, It's a LIE, 0.00> cdrom removable
Chicony Electronics Chicony Electronics, class 0/0, rev 2.00/1.00, addr 2, uhub0 port 1 not configured
AuthenTec AuthenTec, class 255/255, rev 1.10/6.21, addr 2, uhub1 port 1 not configured
swwdog0: software watchdog initialized
Kernelized RAIDframe activated
pad0: outputs: 44100Hz, 16-bit, stereo
audio0 at pad0: half duplex, playback, capture
There a bunch of other stuff which doesn't show up as any of the
above, plus of course the usb drivers which are probed only if I
have the appropriate hardware plugged into my workstation.
2010-12-05 20:37:32 +03:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2013-09-10 21:59:52 +04:00
|
|
|
#include <stdint.h>
|
Add a rump server which comes with all the drivers currently
available. In terms of modules it maps to:
golem> rump.modstat
NAME CLASS SOURCE REFS SIZE REQUIRES
bpf driver builtin 0 - -
cd9660 vfs builtin 0 - -
cgd driver builtin 0 - -
dm driver builtin 0 - -
efs vfs builtin 0 - -
ext2fs vfs builtin 0 - ffs
fdesc vfs builtin 0 - -
ffs vfs builtin 3 - -
fss driver builtin 0 - -
hfs vfs builtin 0 - -
kernfs vfs builtin 0 - -
ksem misc builtin 0 - -
layerfs misc builtin 2 - -
lfs vfs builtin 0 - ffs
mfs vfs builtin 0 - ffs
msdos vfs builtin 0 - -
nfs vfs builtin 1 - -
nfsserver misc builtin 0 - nfs
nilfs vfs builtin 0 - -
ntfs vfs builtin 0 - -
null vfs builtin 0 - layerfs
pad driver builtin 0 - -
ptyfs vfs builtin 0 - -
puffs vfs builtin 0 - putter
putter driver builtin 1 - -
scsiverbose misc builtin 0 - -
smbfs vfs builtin 0 - -
suser secmodel builtin 0 - -
swsensor driver builtin 0 - -
sysvbfs vfs builtin 0 - -
tmpfs vfs builtin 0 - -
udf vfs builtin 0 - -
umap vfs builtin 0 - layerfs
union vfs builtin 0 - -
usbverbose misc builtin 0 - -
wapbl vfs builtin 0 - -
In terms of interfaces:
golem> rump.ifconfig -C
shmif virt lo carp
and dmesg:
NetBSD 5.99.41 (RUMP-ROAST) #0: Tue Nov 30 15:35:05 CET 2010
pooka@pain-rustique.localhost:/usr/allsrc/src/sys/rump/librump/rumpkern
total memory = unlimited (host limit)
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "rumpclk" frequency 100 Hz quality 0
cpu0 at thinair0: rump virtual cpu
cpu1 at thinair0: rump virtual cpu
root file system type: rumpfs
mainbus0 (root)
ugenhc0 at mainbus0
usb0 at ugenhc0: USB revision 2.0
uhub0 at usb0: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub0: 1 port with 1 removable, self powered
ugenhc1 at mainbus0
usb1 at ugenhc1: USB revision 2.0
uhub1 at usb1: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub1: 1 port with 1 removable, self powered
ugenhc2 at mainbus0
usb2 at ugenhc2: USB revision 2.0
uhub2 at usb2: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub2: 1 port with 1 removable, self powered
ugenhc3 at mainbus0
usb3 at ugenhc3: USB revision 2.0
uhub3 at usb3: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub3: 1 port with 1 removable, self powered
scsitest0 at mainbus0
scsibus0 at scsitest0: 2 targets, 1 lun per target
cd0 at scsibus0 target 1 lun 0: <RUMPHOBO, It's a LIE, 0.00> cdrom removable
Chicony Electronics Chicony Electronics, class 0/0, rev 2.00/1.00, addr 2, uhub0 port 1 not configured
AuthenTec AuthenTec, class 255/255, rev 1.10/6.21, addr 2, uhub1 port 1 not configured
swwdog0: software watchdog initialized
Kernelized RAIDframe activated
pad0: outputs: 44100Hz, 16-bit, stereo
audio0 at pad0: half duplex, playback, capture
There a bunch of other stuff which doesn't show up as any of the
above, plus of course the usb drivers which are probed only if I
have the appropriate hardware plugged into my workstation.
2010-12-05 20:37:32 +03:00
|
|
|
#include <string.h>
|
|
|
|
#include <unistd.h>
|
2013-09-10 21:59:52 +04:00
|
|
|
|
|
|
|
#include <rump/rump.h>
|
|
|
|
#include <rump/rump_syscalls.h>
|
2013-11-13 20:43:38 +04:00
|
|
|
#include <rump/rumpdefs.h>
|
2013-12-19 00:48:31 +04:00
|
|
|
#include <rump/rumperr.h>
|
Add a rump server which comes with all the drivers currently
available. In terms of modules it maps to:
golem> rump.modstat
NAME CLASS SOURCE REFS SIZE REQUIRES
bpf driver builtin 0 - -
cd9660 vfs builtin 0 - -
cgd driver builtin 0 - -
dm driver builtin 0 - -
efs vfs builtin 0 - -
ext2fs vfs builtin 0 - ffs
fdesc vfs builtin 0 - -
ffs vfs builtin 3 - -
fss driver builtin 0 - -
hfs vfs builtin 0 - -
kernfs vfs builtin 0 - -
ksem misc builtin 0 - -
layerfs misc builtin 2 - -
lfs vfs builtin 0 - ffs
mfs vfs builtin 0 - ffs
msdos vfs builtin 0 - -
nfs vfs builtin 1 - -
nfsserver misc builtin 0 - nfs
nilfs vfs builtin 0 - -
ntfs vfs builtin 0 - -
null vfs builtin 0 - layerfs
pad driver builtin 0 - -
ptyfs vfs builtin 0 - -
puffs vfs builtin 0 - putter
putter driver builtin 1 - -
scsiverbose misc builtin 0 - -
smbfs vfs builtin 0 - -
suser secmodel builtin 0 - -
swsensor driver builtin 0 - -
sysvbfs vfs builtin 0 - -
tmpfs vfs builtin 0 - -
udf vfs builtin 0 - -
umap vfs builtin 0 - layerfs
union vfs builtin 0 - -
usbverbose misc builtin 0 - -
wapbl vfs builtin 0 - -
In terms of interfaces:
golem> rump.ifconfig -C
shmif virt lo carp
and dmesg:
NetBSD 5.99.41 (RUMP-ROAST) #0: Tue Nov 30 15:35:05 CET 2010
pooka@pain-rustique.localhost:/usr/allsrc/src/sys/rump/librump/rumpkern
total memory = unlimited (host limit)
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "rumpclk" frequency 100 Hz quality 0
cpu0 at thinair0: rump virtual cpu
cpu1 at thinair0: rump virtual cpu
root file system type: rumpfs
mainbus0 (root)
ugenhc0 at mainbus0
usb0 at ugenhc0: USB revision 2.0
uhub0 at usb0: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub0: 1 port with 1 removable, self powered
ugenhc1 at mainbus0
usb1 at ugenhc1: USB revision 2.0
uhub1 at usb1: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub1: 1 port with 1 removable, self powered
ugenhc2 at mainbus0
usb2 at ugenhc2: USB revision 2.0
uhub2 at usb2: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub2: 1 port with 1 removable, self powered
ugenhc3 at mainbus0
usb3 at ugenhc3: USB revision 2.0
uhub3 at usb3: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub3: 1 port with 1 removable, self powered
scsitest0 at mainbus0
scsibus0 at scsitest0: 2 targets, 1 lun per target
cd0 at scsibus0 target 1 lun 0: <RUMPHOBO, It's a LIE, 0.00> cdrom removable
Chicony Electronics Chicony Electronics, class 0/0, rev 2.00/1.00, addr 2, uhub0 port 1 not configured
AuthenTec AuthenTec, class 255/255, rev 1.10/6.21, addr 2, uhub1 port 1 not configured
swwdog0: software watchdog initialized
Kernelized RAIDframe activated
pad0: outputs: 44100Hz, 16-bit, stereo
audio0 at pad0: half duplex, playback, capture
There a bunch of other stuff which doesn't show up as any of the
above, plus of course the usb drivers which are probed only if I
have the appropriate hardware plugged into my workstation.
2010-12-05 20:37:32 +03:00
|
|
|
|
2011-09-16 19:39:25 +04:00
|
|
|
__dead static void
|
Add a rump server which comes with all the drivers currently
available. In terms of modules it maps to:
golem> rump.modstat
NAME CLASS SOURCE REFS SIZE REQUIRES
bpf driver builtin 0 - -
cd9660 vfs builtin 0 - -
cgd driver builtin 0 - -
dm driver builtin 0 - -
efs vfs builtin 0 - -
ext2fs vfs builtin 0 - ffs
fdesc vfs builtin 0 - -
ffs vfs builtin 3 - -
fss driver builtin 0 - -
hfs vfs builtin 0 - -
kernfs vfs builtin 0 - -
ksem misc builtin 0 - -
layerfs misc builtin 2 - -
lfs vfs builtin 0 - ffs
mfs vfs builtin 0 - ffs
msdos vfs builtin 0 - -
nfs vfs builtin 1 - -
nfsserver misc builtin 0 - nfs
nilfs vfs builtin 0 - -
ntfs vfs builtin 0 - -
null vfs builtin 0 - layerfs
pad driver builtin 0 - -
ptyfs vfs builtin 0 - -
puffs vfs builtin 0 - putter
putter driver builtin 1 - -
scsiverbose misc builtin 0 - -
smbfs vfs builtin 0 - -
suser secmodel builtin 0 - -
swsensor driver builtin 0 - -
sysvbfs vfs builtin 0 - -
tmpfs vfs builtin 0 - -
udf vfs builtin 0 - -
umap vfs builtin 0 - layerfs
union vfs builtin 0 - -
usbverbose misc builtin 0 - -
wapbl vfs builtin 0 - -
In terms of interfaces:
golem> rump.ifconfig -C
shmif virt lo carp
and dmesg:
NetBSD 5.99.41 (RUMP-ROAST) #0: Tue Nov 30 15:35:05 CET 2010
pooka@pain-rustique.localhost:/usr/allsrc/src/sys/rump/librump/rumpkern
total memory = unlimited (host limit)
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "rumpclk" frequency 100 Hz quality 0
cpu0 at thinair0: rump virtual cpu
cpu1 at thinair0: rump virtual cpu
root file system type: rumpfs
mainbus0 (root)
ugenhc0 at mainbus0
usb0 at ugenhc0: USB revision 2.0
uhub0 at usb0: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub0: 1 port with 1 removable, self powered
ugenhc1 at mainbus0
usb1 at ugenhc1: USB revision 2.0
uhub1 at usb1: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub1: 1 port with 1 removable, self powered
ugenhc2 at mainbus0
usb2 at ugenhc2: USB revision 2.0
uhub2 at usb2: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub2: 1 port with 1 removable, self powered
ugenhc3 at mainbus0
usb3 at ugenhc3: USB revision 2.0
uhub3 at usb3: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub3: 1 port with 1 removable, self powered
scsitest0 at mainbus0
scsibus0 at scsitest0: 2 targets, 1 lun per target
cd0 at scsibus0 target 1 lun 0: <RUMPHOBO, It's a LIE, 0.00> cdrom removable
Chicony Electronics Chicony Electronics, class 0/0, rev 2.00/1.00, addr 2, uhub0 port 1 not configured
AuthenTec AuthenTec, class 255/255, rev 1.10/6.21, addr 2, uhub1 port 1 not configured
swwdog0: software watchdog initialized
Kernelized RAIDframe activated
pad0: outputs: 44100Hz, 16-bit, stereo
audio0 at pad0: half duplex, playback, capture
There a bunch of other stuff which doesn't show up as any of the
above, plus of course the usb drivers which are probed only if I
have the appropriate hardware plugged into my workstation.
2010-12-05 20:37:32 +03:00
|
|
|
usage(void)
|
|
|
|
{
|
|
|
|
|
2013-09-10 21:59:52 +04:00
|
|
|
#ifndef PLATFORM_HAS_SETGETPROGNAME
|
|
|
|
#define getprogname() "rump_server"
|
|
|
|
#endif
|
2011-01-03 15:18:25 +03:00
|
|
|
fprintf(stderr, "usage: %s [-s] [-c ncpu] [-d drivespec] [-l libs] "
|
2011-01-03 13:44:40 +03:00
|
|
|
"[-m modules] bindurl\n", getprogname());
|
Add a rump server which comes with all the drivers currently
available. In terms of modules it maps to:
golem> rump.modstat
NAME CLASS SOURCE REFS SIZE REQUIRES
bpf driver builtin 0 - -
cd9660 vfs builtin 0 - -
cgd driver builtin 0 - -
dm driver builtin 0 - -
efs vfs builtin 0 - -
ext2fs vfs builtin 0 - ffs
fdesc vfs builtin 0 - -
ffs vfs builtin 3 - -
fss driver builtin 0 - -
hfs vfs builtin 0 - -
kernfs vfs builtin 0 - -
ksem misc builtin 0 - -
layerfs misc builtin 2 - -
lfs vfs builtin 0 - ffs
mfs vfs builtin 0 - ffs
msdos vfs builtin 0 - -
nfs vfs builtin 1 - -
nfsserver misc builtin 0 - nfs
nilfs vfs builtin 0 - -
ntfs vfs builtin 0 - -
null vfs builtin 0 - layerfs
pad driver builtin 0 - -
ptyfs vfs builtin 0 - -
puffs vfs builtin 0 - putter
putter driver builtin 1 - -
scsiverbose misc builtin 0 - -
smbfs vfs builtin 0 - -
suser secmodel builtin 0 - -
swsensor driver builtin 0 - -
sysvbfs vfs builtin 0 - -
tmpfs vfs builtin 0 - -
udf vfs builtin 0 - -
umap vfs builtin 0 - layerfs
union vfs builtin 0 - -
usbverbose misc builtin 0 - -
wapbl vfs builtin 0 - -
In terms of interfaces:
golem> rump.ifconfig -C
shmif virt lo carp
and dmesg:
NetBSD 5.99.41 (RUMP-ROAST) #0: Tue Nov 30 15:35:05 CET 2010
pooka@pain-rustique.localhost:/usr/allsrc/src/sys/rump/librump/rumpkern
total memory = unlimited (host limit)
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "rumpclk" frequency 100 Hz quality 0
cpu0 at thinair0: rump virtual cpu
cpu1 at thinair0: rump virtual cpu
root file system type: rumpfs
mainbus0 (root)
ugenhc0 at mainbus0
usb0 at ugenhc0: USB revision 2.0
uhub0 at usb0: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub0: 1 port with 1 removable, self powered
ugenhc1 at mainbus0
usb1 at ugenhc1: USB revision 2.0
uhub1 at usb1: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub1: 1 port with 1 removable, self powered
ugenhc2 at mainbus0
usb2 at ugenhc2: USB revision 2.0
uhub2 at usb2: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub2: 1 port with 1 removable, self powered
ugenhc3 at mainbus0
usb3 at ugenhc3: USB revision 2.0
uhub3 at usb3: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub3: 1 port with 1 removable, self powered
scsitest0 at mainbus0
scsibus0 at scsitest0: 2 targets, 1 lun per target
cd0 at scsibus0 target 1 lun 0: <RUMPHOBO, It's a LIE, 0.00> cdrom removable
Chicony Electronics Chicony Electronics, class 0/0, rev 2.00/1.00, addr 2, uhub0 port 1 not configured
AuthenTec AuthenTec, class 255/255, rev 1.10/6.21, addr 2, uhub1 port 1 not configured
swwdog0: software watchdog initialized
Kernelized RAIDframe activated
pad0: outputs: 44100Hz, 16-bit, stereo
audio0 at pad0: half duplex, playback, capture
There a bunch of other stuff which doesn't show up as any of the
above, plus of course the usb drivers which are probed only if I
have the appropriate hardware plugged into my workstation.
2010-12-05 20:37:32 +03:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
2011-09-16 19:39:25 +04:00
|
|
|
__dead static void
|
2013-12-19 00:48:31 +04:00
|
|
|
diedie(int sflag, const char *reason, int error, const char *errstr)
|
2010-12-11 13:44:55 +03:00
|
|
|
{
|
|
|
|
|
2013-12-17 03:27:33 +04:00
|
|
|
if (reason != NULL)
|
|
|
|
fputs(reason, stderr);
|
2013-12-19 00:48:31 +04:00
|
|
|
if (errstr) {
|
|
|
|
fprintf(stderr, ": %s", errstr);
|
|
|
|
}
|
2013-12-17 03:27:33 +04:00
|
|
|
fputc('\n', stderr);
|
2010-12-11 13:44:55 +03:00
|
|
|
if (!sflag)
|
|
|
|
rump_daemonize_done(error);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
2013-12-19 00:48:31 +04:00
|
|
|
__dead static void
|
|
|
|
die(int sflag, int error, const char *reason)
|
|
|
|
{
|
|
|
|
|
|
|
|
diedie(sflag, reason, error, error == 0 ? NULL : strerror(error));
|
|
|
|
}
|
|
|
|
|
|
|
|
__dead static void
|
|
|
|
die_rumperr(int sflag, int error, const char *reason)
|
|
|
|
{
|
|
|
|
|
|
|
|
diedie(sflag, reason, error, error == 0 ? NULL : rump_strerror(error));
|
|
|
|
}
|
|
|
|
|
2010-12-12 21:32:47 +03:00
|
|
|
static sem_t sigsem;
|
|
|
|
static void
|
|
|
|
sigreboot(int sig)
|
|
|
|
{
|
|
|
|
|
|
|
|
sem_post(&sigsem);
|
|
|
|
}
|
|
|
|
|
2010-12-14 19:40:05 +03:00
|
|
|
static const char *const disktokens[] = {
|
|
|
|
#define DKEY 0
|
|
|
|
"key",
|
|
|
|
#define DFILE 1
|
|
|
|
"hostpath",
|
|
|
|
#define DSIZE 2
|
2011-02-17 19:59:46 +03:00
|
|
|
#define DSIZE_E -1
|
2010-12-14 19:40:05 +03:00
|
|
|
"size",
|
2011-02-03 14:21:16 +03:00
|
|
|
#define DOFFSET 3
|
|
|
|
"offset",
|
2011-02-04 23:06:23 +03:00
|
|
|
#define DLABEL 4
|
|
|
|
"disklabel",
|
2011-02-17 19:03:05 +03:00
|
|
|
#define DTYPE 5
|
|
|
|
"type",
|
2010-12-14 19:40:05 +03:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
struct etfsreg {
|
|
|
|
const char *key;
|
|
|
|
const char *hostpath;
|
|
|
|
off_t flen;
|
2011-02-03 14:21:16 +03:00
|
|
|
off_t foffset;
|
2011-02-04 23:06:23 +03:00
|
|
|
char partition;
|
2010-12-14 19:40:05 +03:00
|
|
|
enum rump_etfs_type type;
|
|
|
|
};
|
|
|
|
|
2011-02-17 19:03:05 +03:00
|
|
|
struct etfstype {
|
|
|
|
const char *name;
|
|
|
|
enum rump_etfs_type type;
|
|
|
|
} etfstypes[] = {
|
|
|
|
{ "blk", RUMP_ETFS_BLK },
|
|
|
|
{ "chr", RUMP_ETFS_CHR },
|
|
|
|
{ "reg", RUMP_ETFS_REG },
|
|
|
|
};
|
|
|
|
|
2013-11-13 21:47:27 +04:00
|
|
|
static void processlabel(int, int, int, off_t *, off_t *);
|
|
|
|
|
Add a rump server which comes with all the drivers currently
available. In terms of modules it maps to:
golem> rump.modstat
NAME CLASS SOURCE REFS SIZE REQUIRES
bpf driver builtin 0 - -
cd9660 vfs builtin 0 - -
cgd driver builtin 0 - -
dm driver builtin 0 - -
efs vfs builtin 0 - -
ext2fs vfs builtin 0 - ffs
fdesc vfs builtin 0 - -
ffs vfs builtin 3 - -
fss driver builtin 0 - -
hfs vfs builtin 0 - -
kernfs vfs builtin 0 - -
ksem misc builtin 0 - -
layerfs misc builtin 2 - -
lfs vfs builtin 0 - ffs
mfs vfs builtin 0 - ffs
msdos vfs builtin 0 - -
nfs vfs builtin 1 - -
nfsserver misc builtin 0 - nfs
nilfs vfs builtin 0 - -
ntfs vfs builtin 0 - -
null vfs builtin 0 - layerfs
pad driver builtin 0 - -
ptyfs vfs builtin 0 - -
puffs vfs builtin 0 - putter
putter driver builtin 1 - -
scsiverbose misc builtin 0 - -
smbfs vfs builtin 0 - -
suser secmodel builtin 0 - -
swsensor driver builtin 0 - -
sysvbfs vfs builtin 0 - -
tmpfs vfs builtin 0 - -
udf vfs builtin 0 - -
umap vfs builtin 0 - layerfs
union vfs builtin 0 - -
usbverbose misc builtin 0 - -
wapbl vfs builtin 0 - -
In terms of interfaces:
golem> rump.ifconfig -C
shmif virt lo carp
and dmesg:
NetBSD 5.99.41 (RUMP-ROAST) #0: Tue Nov 30 15:35:05 CET 2010
pooka@pain-rustique.localhost:/usr/allsrc/src/sys/rump/librump/rumpkern
total memory = unlimited (host limit)
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "rumpclk" frequency 100 Hz quality 0
cpu0 at thinair0: rump virtual cpu
cpu1 at thinair0: rump virtual cpu
root file system type: rumpfs
mainbus0 (root)
ugenhc0 at mainbus0
usb0 at ugenhc0: USB revision 2.0
uhub0 at usb0: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub0: 1 port with 1 removable, self powered
ugenhc1 at mainbus0
usb1 at ugenhc1: USB revision 2.0
uhub1 at usb1: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub1: 1 port with 1 removable, self powered
ugenhc2 at mainbus0
usb2 at ugenhc2: USB revision 2.0
uhub2 at usb2: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub2: 1 port with 1 removable, self powered
ugenhc3 at mainbus0
usb3 at ugenhc3: USB revision 2.0
uhub3 at usb3: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub3: 1 port with 1 removable, self powered
scsitest0 at mainbus0
scsibus0 at scsitest0: 2 targets, 1 lun per target
cd0 at scsibus0 target 1 lun 0: <RUMPHOBO, It's a LIE, 0.00> cdrom removable
Chicony Electronics Chicony Electronics, class 0/0, rev 2.00/1.00, addr 2, uhub0 port 1 not configured
AuthenTec AuthenTec, class 255/255, rev 1.10/6.21, addr 2, uhub1 port 1 not configured
swwdog0: software watchdog initialized
Kernelized RAIDframe activated
pad0: outputs: 44100Hz, 16-bit, stereo
audio0 at pad0: half duplex, playback, capture
There a bunch of other stuff which doesn't show up as any of the
above, plus of course the usb drivers which are probed only if I
have the appropriate hardware plugged into my workstation.
2010-12-05 20:37:32 +03:00
|
|
|
int
|
|
|
|
main(int argc, char *argv[])
|
|
|
|
{
|
2010-12-11 13:44:55 +03:00
|
|
|
const char *serverurl;
|
2010-12-14 19:40:05 +03:00
|
|
|
struct etfsreg *etfs = NULL;
|
|
|
|
unsigned netfs = 0, curetfs = 0;
|
Add a rump server which comes with all the drivers currently
available. In terms of modules it maps to:
golem> rump.modstat
NAME CLASS SOURCE REFS SIZE REQUIRES
bpf driver builtin 0 - -
cd9660 vfs builtin 0 - -
cgd driver builtin 0 - -
dm driver builtin 0 - -
efs vfs builtin 0 - -
ext2fs vfs builtin 0 - ffs
fdesc vfs builtin 0 - -
ffs vfs builtin 3 - -
fss driver builtin 0 - -
hfs vfs builtin 0 - -
kernfs vfs builtin 0 - -
ksem misc builtin 0 - -
layerfs misc builtin 2 - -
lfs vfs builtin 0 - ffs
mfs vfs builtin 0 - ffs
msdos vfs builtin 0 - -
nfs vfs builtin 1 - -
nfsserver misc builtin 0 - nfs
nilfs vfs builtin 0 - -
ntfs vfs builtin 0 - -
null vfs builtin 0 - layerfs
pad driver builtin 0 - -
ptyfs vfs builtin 0 - -
puffs vfs builtin 0 - putter
putter driver builtin 1 - -
scsiverbose misc builtin 0 - -
smbfs vfs builtin 0 - -
suser secmodel builtin 0 - -
swsensor driver builtin 0 - -
sysvbfs vfs builtin 0 - -
tmpfs vfs builtin 0 - -
udf vfs builtin 0 - -
umap vfs builtin 0 - layerfs
union vfs builtin 0 - -
usbverbose misc builtin 0 - -
wapbl vfs builtin 0 - -
In terms of interfaces:
golem> rump.ifconfig -C
shmif virt lo carp
and dmesg:
NetBSD 5.99.41 (RUMP-ROAST) #0: Tue Nov 30 15:35:05 CET 2010
pooka@pain-rustique.localhost:/usr/allsrc/src/sys/rump/librump/rumpkern
total memory = unlimited (host limit)
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "rumpclk" frequency 100 Hz quality 0
cpu0 at thinair0: rump virtual cpu
cpu1 at thinair0: rump virtual cpu
root file system type: rumpfs
mainbus0 (root)
ugenhc0 at mainbus0
usb0 at ugenhc0: USB revision 2.0
uhub0 at usb0: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub0: 1 port with 1 removable, self powered
ugenhc1 at mainbus0
usb1 at ugenhc1: USB revision 2.0
uhub1 at usb1: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub1: 1 port with 1 removable, self powered
ugenhc2 at mainbus0
usb2 at ugenhc2: USB revision 2.0
uhub2 at usb2: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub2: 1 port with 1 removable, self powered
ugenhc3 at mainbus0
usb3 at ugenhc3: USB revision 2.0
uhub3 at usb3: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub3: 1 port with 1 removable, self powered
scsitest0 at mainbus0
scsibus0 at scsitest0: 2 targets, 1 lun per target
cd0 at scsibus0 target 1 lun 0: <RUMPHOBO, It's a LIE, 0.00> cdrom removable
Chicony Electronics Chicony Electronics, class 0/0, rev 2.00/1.00, addr 2, uhub0 port 1 not configured
AuthenTec AuthenTec, class 255/255, rev 1.10/6.21, addr 2, uhub1 port 1 not configured
swwdog0: software watchdog initialized
Kernelized RAIDframe activated
pad0: outputs: 44100Hz, 16-bit, stereo
audio0 at pad0: half duplex, playback, capture
There a bunch of other stuff which doesn't show up as any of the
above, plus of course the usb drivers which are probed only if I
have the appropriate hardware plugged into my workstation.
2010-12-05 20:37:32 +03:00
|
|
|
int error;
|
2010-12-11 13:44:55 +03:00
|
|
|
int ch, sflag;
|
2013-09-10 21:59:52 +04:00
|
|
|
unsigned i;
|
|
|
|
char **modarray = NULL;
|
|
|
|
unsigned nmods = 0, curmod = 0;
|
|
|
|
|
|
|
|
#ifdef PLATFORM_HAS_SETGETPROGNAME
|
Add a rump server which comes with all the drivers currently
available. In terms of modules it maps to:
golem> rump.modstat
NAME CLASS SOURCE REFS SIZE REQUIRES
bpf driver builtin 0 - -
cd9660 vfs builtin 0 - -
cgd driver builtin 0 - -
dm driver builtin 0 - -
efs vfs builtin 0 - -
ext2fs vfs builtin 0 - ffs
fdesc vfs builtin 0 - -
ffs vfs builtin 3 - -
fss driver builtin 0 - -
hfs vfs builtin 0 - -
kernfs vfs builtin 0 - -
ksem misc builtin 0 - -
layerfs misc builtin 2 - -
lfs vfs builtin 0 - ffs
mfs vfs builtin 0 - ffs
msdos vfs builtin 0 - -
nfs vfs builtin 1 - -
nfsserver misc builtin 0 - nfs
nilfs vfs builtin 0 - -
ntfs vfs builtin 0 - -
null vfs builtin 0 - layerfs
pad driver builtin 0 - -
ptyfs vfs builtin 0 - -
puffs vfs builtin 0 - putter
putter driver builtin 1 - -
scsiverbose misc builtin 0 - -
smbfs vfs builtin 0 - -
suser secmodel builtin 0 - -
swsensor driver builtin 0 - -
sysvbfs vfs builtin 0 - -
tmpfs vfs builtin 0 - -
udf vfs builtin 0 - -
umap vfs builtin 0 - layerfs
union vfs builtin 0 - -
usbverbose misc builtin 0 - -
wapbl vfs builtin 0 - -
In terms of interfaces:
golem> rump.ifconfig -C
shmif virt lo carp
and dmesg:
NetBSD 5.99.41 (RUMP-ROAST) #0: Tue Nov 30 15:35:05 CET 2010
pooka@pain-rustique.localhost:/usr/allsrc/src/sys/rump/librump/rumpkern
total memory = unlimited (host limit)
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "rumpclk" frequency 100 Hz quality 0
cpu0 at thinair0: rump virtual cpu
cpu1 at thinair0: rump virtual cpu
root file system type: rumpfs
mainbus0 (root)
ugenhc0 at mainbus0
usb0 at ugenhc0: USB revision 2.0
uhub0 at usb0: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub0: 1 port with 1 removable, self powered
ugenhc1 at mainbus0
usb1 at ugenhc1: USB revision 2.0
uhub1 at usb1: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub1: 1 port with 1 removable, self powered
ugenhc2 at mainbus0
usb2 at ugenhc2: USB revision 2.0
uhub2 at usb2: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub2: 1 port with 1 removable, self powered
ugenhc3 at mainbus0
usb3 at ugenhc3: USB revision 2.0
uhub3 at usb3: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub3: 1 port with 1 removable, self powered
scsitest0 at mainbus0
scsibus0 at scsitest0: 2 targets, 1 lun per target
cd0 at scsibus0 target 1 lun 0: <RUMPHOBO, It's a LIE, 0.00> cdrom removable
Chicony Electronics Chicony Electronics, class 0/0, rev 2.00/1.00, addr 2, uhub0 port 1 not configured
AuthenTec AuthenTec, class 255/255, rev 1.10/6.21, addr 2, uhub1 port 1 not configured
swwdog0: software watchdog initialized
Kernelized RAIDframe activated
pad0: outputs: 44100Hz, 16-bit, stereo
audio0 at pad0: half duplex, playback, capture
There a bunch of other stuff which doesn't show up as any of the
above, plus of course the usb drivers which are probed only if I
have the appropriate hardware plugged into my workstation.
2010-12-05 20:37:32 +03:00
|
|
|
setprogname(argv[0]);
|
2013-09-10 21:59:52 +04:00
|
|
|
#endif
|
Add a rump server which comes with all the drivers currently
available. In terms of modules it maps to:
golem> rump.modstat
NAME CLASS SOURCE REFS SIZE REQUIRES
bpf driver builtin 0 - -
cd9660 vfs builtin 0 - -
cgd driver builtin 0 - -
dm driver builtin 0 - -
efs vfs builtin 0 - -
ext2fs vfs builtin 0 - ffs
fdesc vfs builtin 0 - -
ffs vfs builtin 3 - -
fss driver builtin 0 - -
hfs vfs builtin 0 - -
kernfs vfs builtin 0 - -
ksem misc builtin 0 - -
layerfs misc builtin 2 - -
lfs vfs builtin 0 - ffs
mfs vfs builtin 0 - ffs
msdos vfs builtin 0 - -
nfs vfs builtin 1 - -
nfsserver misc builtin 0 - nfs
nilfs vfs builtin 0 - -
ntfs vfs builtin 0 - -
null vfs builtin 0 - layerfs
pad driver builtin 0 - -
ptyfs vfs builtin 0 - -
puffs vfs builtin 0 - putter
putter driver builtin 1 - -
scsiverbose misc builtin 0 - -
smbfs vfs builtin 0 - -
suser secmodel builtin 0 - -
swsensor driver builtin 0 - -
sysvbfs vfs builtin 0 - -
tmpfs vfs builtin 0 - -
udf vfs builtin 0 - -
umap vfs builtin 0 - layerfs
union vfs builtin 0 - -
usbverbose misc builtin 0 - -
wapbl vfs builtin 0 - -
In terms of interfaces:
golem> rump.ifconfig -C
shmif virt lo carp
and dmesg:
NetBSD 5.99.41 (RUMP-ROAST) #0: Tue Nov 30 15:35:05 CET 2010
pooka@pain-rustique.localhost:/usr/allsrc/src/sys/rump/librump/rumpkern
total memory = unlimited (host limit)
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "rumpclk" frequency 100 Hz quality 0
cpu0 at thinair0: rump virtual cpu
cpu1 at thinair0: rump virtual cpu
root file system type: rumpfs
mainbus0 (root)
ugenhc0 at mainbus0
usb0 at ugenhc0: USB revision 2.0
uhub0 at usb0: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub0: 1 port with 1 removable, self powered
ugenhc1 at mainbus0
usb1 at ugenhc1: USB revision 2.0
uhub1 at usb1: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub1: 1 port with 1 removable, self powered
ugenhc2 at mainbus0
usb2 at ugenhc2: USB revision 2.0
uhub2 at usb2: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub2: 1 port with 1 removable, self powered
ugenhc3 at mainbus0
usb3 at ugenhc3: USB revision 2.0
uhub3 at usb3: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub3: 1 port with 1 removable, self powered
scsitest0 at mainbus0
scsibus0 at scsitest0: 2 targets, 1 lun per target
cd0 at scsibus0 target 1 lun 0: <RUMPHOBO, It's a LIE, 0.00> cdrom removable
Chicony Electronics Chicony Electronics, class 0/0, rev 2.00/1.00, addr 2, uhub0 port 1 not configured
AuthenTec AuthenTec, class 255/255, rev 1.10/6.21, addr 2, uhub1 port 1 not configured
swwdog0: software watchdog initialized
Kernelized RAIDframe activated
pad0: outputs: 44100Hz, 16-bit, stereo
audio0 at pad0: half duplex, playback, capture
There a bunch of other stuff which doesn't show up as any of the
above, plus of course the usb drivers which are probed only if I
have the appropriate hardware plugged into my workstation.
2010-12-05 20:37:32 +03:00
|
|
|
|
2010-12-11 13:44:55 +03:00
|
|
|
sflag = 0;
|
2011-02-21 21:50:21 +03:00
|
|
|
while ((ch = getopt(argc, argv, "c:d:l:m:r:sv")) != -1) {
|
2010-12-11 13:44:55 +03:00
|
|
|
switch (ch) {
|
2011-01-03 13:44:40 +03:00
|
|
|
case 'c':
|
|
|
|
setenv("RUMP_NCPU", optarg, 1);
|
|
|
|
break;
|
2010-12-14 19:40:05 +03:00
|
|
|
case 'd': {
|
|
|
|
char *options, *value;
|
|
|
|
char *key, *hostpath;
|
2011-02-03 14:21:16 +03:00
|
|
|
long long flen, foffset;
|
2011-02-04 23:06:23 +03:00
|
|
|
char partition;
|
2011-02-17 19:03:05 +03:00
|
|
|
int ftype;
|
2010-12-14 19:40:05 +03:00
|
|
|
|
2011-02-03 14:21:16 +03:00
|
|
|
flen = foffset = 0;
|
2011-02-04 23:06:23 +03:00
|
|
|
partition = 0;
|
2010-12-14 19:40:05 +03:00
|
|
|
key = hostpath = NULL;
|
2011-02-17 19:03:05 +03:00
|
|
|
ftype = -1;
|
2010-12-14 19:40:05 +03:00
|
|
|
options = optarg;
|
|
|
|
while (*options) {
|
|
|
|
switch (getsubopt(&options,
|
|
|
|
__UNCONST(disktokens), &value)) {
|
|
|
|
case DKEY:
|
2010-12-15 22:07:43 +03:00
|
|
|
if (key != NULL) {
|
|
|
|
fprintf(stderr,
|
|
|
|
"key already given\n");
|
|
|
|
usage();
|
|
|
|
}
|
2010-12-14 19:40:05 +03:00
|
|
|
key = value;
|
|
|
|
break;
|
2011-02-04 23:06:23 +03:00
|
|
|
|
2010-12-14 19:40:05 +03:00
|
|
|
case DFILE:
|
2010-12-15 22:07:43 +03:00
|
|
|
if (hostpath != NULL) {
|
|
|
|
fprintf(stderr,
|
|
|
|
"hostpath already given\n");
|
|
|
|
usage();
|
|
|
|
}
|
2010-12-14 19:40:05 +03:00
|
|
|
hostpath = value;
|
|
|
|
break;
|
2011-02-04 23:06:23 +03:00
|
|
|
|
2010-12-14 19:40:05 +03:00
|
|
|
case DSIZE:
|
2010-12-15 22:07:43 +03:00
|
|
|
if (flen != 0) {
|
|
|
|
fprintf(stderr,
|
|
|
|
"size already given\n");
|
|
|
|
usage();
|
|
|
|
}
|
2011-02-18 12:54:03 +03:00
|
|
|
if (strcmp(value, "host") == 0) {
|
2011-02-17 19:59:46 +03:00
|
|
|
if (foffset != 0) {
|
|
|
|
fprintf(stderr,
|
|
|
|
"cannot specify "
|
|
|
|
"offset with "
|
2011-02-22 18:51:59 +03:00
|
|
|
"size=host\n");
|
2011-02-17 19:59:46 +03:00
|
|
|
usage();
|
|
|
|
}
|
|
|
|
flen = DSIZE_E;
|
|
|
|
} else {
|
2013-09-10 21:59:52 +04:00
|
|
|
#ifdef PLATFORM_HAS_STRSUFTOLL
|
2011-02-17 19:59:46 +03:00
|
|
|
/* XXX: off_t max? */
|
|
|
|
flen = strsuftoll("-d size",
|
|
|
|
value, 0, LLONG_MAX);
|
2013-09-10 21:59:52 +04:00
|
|
|
#else
|
|
|
|
flen = strtoull(value,
|
|
|
|
NULL, 10);
|
|
|
|
#endif
|
2011-02-17 19:59:46 +03:00
|
|
|
}
|
2010-12-14 19:40:05 +03:00
|
|
|
break;
|
2011-02-03 14:21:16 +03:00
|
|
|
case DOFFSET:
|
|
|
|
if (foffset != 0) {
|
|
|
|
fprintf(stderr,
|
|
|
|
"offset already given\n");
|
|
|
|
usage();
|
|
|
|
}
|
2011-02-17 19:59:46 +03:00
|
|
|
if (flen == DSIZE_E) {
|
|
|
|
fprintf(stderr, "cannot "
|
|
|
|
"specify offset with "
|
2011-02-22 18:51:59 +03:00
|
|
|
"size=host\n");
|
2011-02-17 19:59:46 +03:00
|
|
|
usage();
|
|
|
|
}
|
2013-09-10 21:59:52 +04:00
|
|
|
#ifdef PLATFORM_HAS_STRSUFTOLL
|
2011-02-03 14:21:16 +03:00
|
|
|
/* XXX: off_t max? */
|
|
|
|
foffset = strsuftoll("-d offset", value,
|
|
|
|
0, LLONG_MAX);
|
2013-09-10 21:59:52 +04:00
|
|
|
#else
|
|
|
|
foffset = strtoull(value, NULL, 10);
|
|
|
|
#endif
|
2011-02-03 14:21:16 +03:00
|
|
|
break;
|
2011-02-04 23:06:23 +03:00
|
|
|
|
|
|
|
case DLABEL:
|
|
|
|
if (foffset != 0 || flen != 0) {
|
|
|
|
fprintf(stderr,
|
|
|
|
"disklabel needs to be "
|
|
|
|
"used alone\n");
|
|
|
|
usage();
|
|
|
|
}
|
|
|
|
if (strlen(value) != 1 ||
|
|
|
|
*value < 'a' || *value > 'z') {
|
|
|
|
fprintf(stderr,
|
|
|
|
"invalid label part\n");
|
|
|
|
usage();
|
|
|
|
}
|
|
|
|
partition = *value;
|
|
|
|
break;
|
|
|
|
|
2011-02-17 19:03:05 +03:00
|
|
|
case DTYPE:
|
|
|
|
if (ftype != -1) {
|
|
|
|
fprintf(stderr,
|
|
|
|
"type already specified\n");
|
|
|
|
usage();
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0;
|
|
|
|
i < __arraycount(etfstypes);
|
|
|
|
i++) {
|
|
|
|
if (strcmp(etfstypes[i].name,
|
|
|
|
value) == 0)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (i == __arraycount(etfstypes)) {
|
|
|
|
fprintf(stderr,
|
|
|
|
"invalid type %s\n", value);
|
|
|
|
usage();
|
|
|
|
}
|
|
|
|
ftype = etfstypes[i].type;
|
|
|
|
break;
|
|
|
|
|
2010-12-14 19:40:05 +03:00
|
|
|
default:
|
|
|
|
fprintf(stderr, "invalid dtoken\n");
|
|
|
|
usage();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-02-04 23:06:23 +03:00
|
|
|
if (key == NULL || hostpath == NULL ||
|
|
|
|
(flen == 0 && partition == 0)) {
|
2010-12-14 19:40:05 +03:00
|
|
|
fprintf(stderr, "incomplete drivespec\n");
|
|
|
|
usage();
|
|
|
|
}
|
2011-02-17 19:03:05 +03:00
|
|
|
if (ftype == -1)
|
|
|
|
ftype = RUMP_ETFS_BLK;
|
2010-12-14 19:40:05 +03:00
|
|
|
|
|
|
|
if (netfs - curetfs == 0) {
|
|
|
|
etfs = realloc(etfs, (netfs+16)*sizeof(*etfs));
|
|
|
|
if (etfs == NULL)
|
2013-09-11 00:36:08 +04:00
|
|
|
die(1, errno, "realloc etfs");
|
2010-12-14 19:40:05 +03:00
|
|
|
netfs += 16;
|
|
|
|
}
|
|
|
|
|
|
|
|
etfs[curetfs].key = key;
|
|
|
|
etfs[curetfs].hostpath = hostpath;
|
|
|
|
etfs[curetfs].flen = flen;
|
2011-02-03 14:21:16 +03:00
|
|
|
etfs[curetfs].foffset = foffset;
|
2011-02-04 23:06:23 +03:00
|
|
|
etfs[curetfs].partition = partition;
|
2011-02-17 19:03:05 +03:00
|
|
|
etfs[curetfs].type = ftype;
|
2010-12-14 19:40:05 +03:00
|
|
|
curetfs++;
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
2010-12-13 16:32:25 +03:00
|
|
|
case 'l':
|
2010-12-13 17:26:22 +03:00
|
|
|
if (dlopen(optarg, RTLD_LAZY|RTLD_GLOBAL) == NULL) {
|
|
|
|
char pb[MAXPATHLEN];
|
|
|
|
/* try to mimic linker -l syntax */
|
|
|
|
|
|
|
|
snprintf(pb, sizeof(pb), "lib%s.so", optarg);
|
|
|
|
if (dlopen(pb, RTLD_LAZY|RTLD_GLOBAL) == NULL) {
|
2013-12-17 03:27:33 +04:00
|
|
|
fprintf(stderr, "dlopen: %s", dlerror());
|
|
|
|
die(1, 0, NULL);
|
2010-12-13 17:26:22 +03:00
|
|
|
}
|
|
|
|
}
|
2010-12-13 16:32:25 +03:00
|
|
|
break;
|
2013-09-10 21:59:52 +04:00
|
|
|
case 'm': {
|
|
|
|
|
2010-12-13 17:13:21 +03:00
|
|
|
if (nmods - curmod == 0) {
|
|
|
|
modarray = realloc(modarray,
|
|
|
|
(nmods+16) * sizeof(char *));
|
|
|
|
if (modarray == NULL)
|
2013-09-11 00:36:08 +04:00
|
|
|
die(1, errno, "realloc");
|
2010-12-13 17:13:21 +03:00
|
|
|
nmods += 16;
|
|
|
|
}
|
|
|
|
modarray[curmod++] = optarg;
|
2013-09-10 21:59:52 +04:00
|
|
|
break; }
|
2011-02-21 21:50:21 +03:00
|
|
|
case 'r':
|
|
|
|
setenv("RUMP_MEMLIMIT", optarg, 1);
|
|
|
|
break;
|
2010-12-11 13:44:55 +03:00
|
|
|
case 's':
|
|
|
|
sflag = 1;
|
|
|
|
break;
|
2011-02-21 21:50:21 +03:00
|
|
|
case 'v':
|
|
|
|
setenv("RUMP_VERBOSE", "1", 1);
|
|
|
|
break;
|
2010-12-11 13:44:55 +03:00
|
|
|
default:
|
|
|
|
usage();
|
|
|
|
/*NOTREACHED*/
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
argc -= optind;
|
|
|
|
argv += optind;
|
|
|
|
|
|
|
|
if (argc != 1)
|
Add a rump server which comes with all the drivers currently
available. In terms of modules it maps to:
golem> rump.modstat
NAME CLASS SOURCE REFS SIZE REQUIRES
bpf driver builtin 0 - -
cd9660 vfs builtin 0 - -
cgd driver builtin 0 - -
dm driver builtin 0 - -
efs vfs builtin 0 - -
ext2fs vfs builtin 0 - ffs
fdesc vfs builtin 0 - -
ffs vfs builtin 3 - -
fss driver builtin 0 - -
hfs vfs builtin 0 - -
kernfs vfs builtin 0 - -
ksem misc builtin 0 - -
layerfs misc builtin 2 - -
lfs vfs builtin 0 - ffs
mfs vfs builtin 0 - ffs
msdos vfs builtin 0 - -
nfs vfs builtin 1 - -
nfsserver misc builtin 0 - nfs
nilfs vfs builtin 0 - -
ntfs vfs builtin 0 - -
null vfs builtin 0 - layerfs
pad driver builtin 0 - -
ptyfs vfs builtin 0 - -
puffs vfs builtin 0 - putter
putter driver builtin 1 - -
scsiverbose misc builtin 0 - -
smbfs vfs builtin 0 - -
suser secmodel builtin 0 - -
swsensor driver builtin 0 - -
sysvbfs vfs builtin 0 - -
tmpfs vfs builtin 0 - -
udf vfs builtin 0 - -
umap vfs builtin 0 - layerfs
union vfs builtin 0 - -
usbverbose misc builtin 0 - -
wapbl vfs builtin 0 - -
In terms of interfaces:
golem> rump.ifconfig -C
shmif virt lo carp
and dmesg:
NetBSD 5.99.41 (RUMP-ROAST) #0: Tue Nov 30 15:35:05 CET 2010
pooka@pain-rustique.localhost:/usr/allsrc/src/sys/rump/librump/rumpkern
total memory = unlimited (host limit)
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "rumpclk" frequency 100 Hz quality 0
cpu0 at thinair0: rump virtual cpu
cpu1 at thinair0: rump virtual cpu
root file system type: rumpfs
mainbus0 (root)
ugenhc0 at mainbus0
usb0 at ugenhc0: USB revision 2.0
uhub0 at usb0: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub0: 1 port with 1 removable, self powered
ugenhc1 at mainbus0
usb1 at ugenhc1: USB revision 2.0
uhub1 at usb1: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub1: 1 port with 1 removable, self powered
ugenhc2 at mainbus0
usb2 at ugenhc2: USB revision 2.0
uhub2 at usb2: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub2: 1 port with 1 removable, self powered
ugenhc3 at mainbus0
usb3 at ugenhc3: USB revision 2.0
uhub3 at usb3: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub3: 1 port with 1 removable, self powered
scsitest0 at mainbus0
scsibus0 at scsitest0: 2 targets, 1 lun per target
cd0 at scsibus0 target 1 lun 0: <RUMPHOBO, It's a LIE, 0.00> cdrom removable
Chicony Electronics Chicony Electronics, class 0/0, rev 2.00/1.00, addr 2, uhub0 port 1 not configured
AuthenTec AuthenTec, class 255/255, rev 1.10/6.21, addr 2, uhub1 port 1 not configured
swwdog0: software watchdog initialized
Kernelized RAIDframe activated
pad0: outputs: 44100Hz, 16-bit, stereo
audio0 at pad0: half duplex, playback, capture
There a bunch of other stuff which doesn't show up as any of the
above, plus of course the usb drivers which are probed only if I
have the appropriate hardware plugged into my workstation.
2010-12-05 20:37:32 +03:00
|
|
|
usage();
|
|
|
|
|
2010-12-11 13:44:55 +03:00
|
|
|
serverurl = argv[0];
|
|
|
|
|
|
|
|
if (!sflag) {
|
|
|
|
error = rump_daemonize_begin();
|
|
|
|
if (error)
|
2013-12-19 00:48:31 +04:00
|
|
|
die_rumperr(1, error, "rump daemonize");
|
2010-12-11 13:44:55 +03:00
|
|
|
}
|
|
|
|
|
Add a rump server which comes with all the drivers currently
available. In terms of modules it maps to:
golem> rump.modstat
NAME CLASS SOURCE REFS SIZE REQUIRES
bpf driver builtin 0 - -
cd9660 vfs builtin 0 - -
cgd driver builtin 0 - -
dm driver builtin 0 - -
efs vfs builtin 0 - -
ext2fs vfs builtin 0 - ffs
fdesc vfs builtin 0 - -
ffs vfs builtin 3 - -
fss driver builtin 0 - -
hfs vfs builtin 0 - -
kernfs vfs builtin 0 - -
ksem misc builtin 0 - -
layerfs misc builtin 2 - -
lfs vfs builtin 0 - ffs
mfs vfs builtin 0 - ffs
msdos vfs builtin 0 - -
nfs vfs builtin 1 - -
nfsserver misc builtin 0 - nfs
nilfs vfs builtin 0 - -
ntfs vfs builtin 0 - -
null vfs builtin 0 - layerfs
pad driver builtin 0 - -
ptyfs vfs builtin 0 - -
puffs vfs builtin 0 - putter
putter driver builtin 1 - -
scsiverbose misc builtin 0 - -
smbfs vfs builtin 0 - -
suser secmodel builtin 0 - -
swsensor driver builtin 0 - -
sysvbfs vfs builtin 0 - -
tmpfs vfs builtin 0 - -
udf vfs builtin 0 - -
umap vfs builtin 0 - layerfs
union vfs builtin 0 - -
usbverbose misc builtin 0 - -
wapbl vfs builtin 0 - -
In terms of interfaces:
golem> rump.ifconfig -C
shmif virt lo carp
and dmesg:
NetBSD 5.99.41 (RUMP-ROAST) #0: Tue Nov 30 15:35:05 CET 2010
pooka@pain-rustique.localhost:/usr/allsrc/src/sys/rump/librump/rumpkern
total memory = unlimited (host limit)
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "rumpclk" frequency 100 Hz quality 0
cpu0 at thinair0: rump virtual cpu
cpu1 at thinair0: rump virtual cpu
root file system type: rumpfs
mainbus0 (root)
ugenhc0 at mainbus0
usb0 at ugenhc0: USB revision 2.0
uhub0 at usb0: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub0: 1 port with 1 removable, self powered
ugenhc1 at mainbus0
usb1 at ugenhc1: USB revision 2.0
uhub1 at usb1: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub1: 1 port with 1 removable, self powered
ugenhc2 at mainbus0
usb2 at ugenhc2: USB revision 2.0
uhub2 at usb2: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub2: 1 port with 1 removable, self powered
ugenhc3 at mainbus0
usb3 at ugenhc3: USB revision 2.0
uhub3 at usb3: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub3: 1 port with 1 removable, self powered
scsitest0 at mainbus0
scsibus0 at scsitest0: 2 targets, 1 lun per target
cd0 at scsibus0 target 1 lun 0: <RUMPHOBO, It's a LIE, 0.00> cdrom removable
Chicony Electronics Chicony Electronics, class 0/0, rev 2.00/1.00, addr 2, uhub0 port 1 not configured
AuthenTec AuthenTec, class 255/255, rev 1.10/6.21, addr 2, uhub1 port 1 not configured
swwdog0: software watchdog initialized
Kernelized RAIDframe activated
pad0: outputs: 44100Hz, 16-bit, stereo
audio0 at pad0: half duplex, playback, capture
There a bunch of other stuff which doesn't show up as any of the
above, plus of course the usb drivers which are probed only if I
have the appropriate hardware plugged into my workstation.
2010-12-05 20:37:32 +03:00
|
|
|
error = rump_init();
|
|
|
|
if (error)
|
2013-12-19 00:48:31 +04:00
|
|
|
die_rumperr(sflag, error, "rump init failed");
|
2010-12-13 17:13:21 +03:00
|
|
|
|
2010-12-14 19:40:05 +03:00
|
|
|
/* load modules */
|
2010-12-13 17:13:21 +03:00
|
|
|
for (i = 0; i < curmod; i++) {
|
2013-11-13 20:43:38 +04:00
|
|
|
struct rump_modctl_load ml;
|
2010-12-13 17:13:21 +03:00
|
|
|
|
|
|
|
#define ETFSKEY "/module.mod"
|
|
|
|
if ((error = rump_pub_etfs_register(ETFSKEY,
|
|
|
|
modarray[0], RUMP_ETFS_REG)) != 0)
|
2013-12-19 00:48:31 +04:00
|
|
|
die_rumperr(sflag,
|
|
|
|
error, "module etfs register failed");
|
2010-12-13 17:13:21 +03:00
|
|
|
memset(&ml, 0, sizeof(ml));
|
|
|
|
ml.ml_filename = ETFSKEY;
|
2013-12-19 00:48:31 +04:00
|
|
|
/*
|
|
|
|
* XXX: since this is a syscall, error namespace depends
|
|
|
|
* on loaded emulations. revisit and fix.
|
|
|
|
*/
|
2013-11-13 20:43:38 +04:00
|
|
|
if (rump_sys_modctl(RUMP_MODCTL_LOAD, &ml) == -1)
|
2010-12-13 17:13:21 +03:00
|
|
|
die(sflag, errno, "module load failed");
|
|
|
|
rump_pub_etfs_remove(ETFSKEY);
|
2010-12-14 19:40:05 +03:00
|
|
|
#undef ETFSKEY
|
|
|
|
}
|
|
|
|
|
|
|
|
/* register host drives */
|
|
|
|
for (i = 0; i < curetfs; i++) {
|
2011-02-03 14:21:16 +03:00
|
|
|
struct stat sb;
|
2011-02-04 23:06:23 +03:00
|
|
|
off_t foffset, flen, fendoff;
|
2011-02-17 19:59:46 +03:00
|
|
|
int fd, oflags;
|
2010-12-14 19:40:05 +03:00
|
|
|
|
2011-02-17 19:59:46 +03:00
|
|
|
oflags = etfs[i].flen == DSIZE_E ? 0 : O_CREAT;
|
|
|
|
fd = open(etfs[i].hostpath, O_RDWR | oflags, 0644);
|
2010-12-14 19:40:05 +03:00
|
|
|
if (fd == -1)
|
2011-02-17 19:59:46 +03:00
|
|
|
die(sflag, errno, "etfs hostpath open");
|
2011-02-04 23:06:23 +03:00
|
|
|
|
|
|
|
if (etfs[i].partition) {
|
2013-11-13 21:47:27 +04:00
|
|
|
processlabel(sflag, fd, etfs[i].partition - 'a',
|
|
|
|
&foffset, &flen);
|
2011-02-04 23:06:23 +03:00
|
|
|
} else {
|
|
|
|
foffset = etfs[i].foffset;
|
|
|
|
flen = etfs[i].flen;
|
|
|
|
}
|
|
|
|
|
2011-02-03 14:21:16 +03:00
|
|
|
if (fstat(fd, &sb) == -1)
|
|
|
|
die(sflag, errno, "fstat etfs hostpath");
|
2011-02-17 19:59:46 +03:00
|
|
|
if (flen == DSIZE_E) {
|
2011-02-22 18:51:59 +03:00
|
|
|
if (sb.st_size == 0)
|
|
|
|
die(sflag, EINVAL, "size=host, but cannot "
|
|
|
|
"query non-zero size");
|
2011-02-17 19:59:46 +03:00
|
|
|
flen = sb.st_size;
|
|
|
|
}
|
|
|
|
fendoff = foffset + flen;
|
2011-02-04 23:06:23 +03:00
|
|
|
if (S_ISREG(sb.st_mode) && sb.st_size < fendoff) {
|
|
|
|
if (ftruncate(fd, fendoff) == -1)
|
2011-02-03 14:21:16 +03:00
|
|
|
die(sflag, errno, "truncate");
|
|
|
|
}
|
2010-12-14 19:40:05 +03:00
|
|
|
close(fd);
|
|
|
|
|
2011-02-03 14:21:16 +03:00
|
|
|
if ((error = rump_pub_etfs_register_withsize(etfs[i].key,
|
2011-02-04 23:06:23 +03:00
|
|
|
etfs[i].hostpath, etfs[i].type, foffset, flen)) != 0)
|
2013-12-19 00:48:31 +04:00
|
|
|
die_rumperr(sflag, error, "etfs register");
|
2010-12-13 17:13:21 +03:00
|
|
|
}
|
|
|
|
|
2010-12-11 13:44:55 +03:00
|
|
|
error = rump_init_server(serverurl);
|
Add a rump server which comes with all the drivers currently
available. In terms of modules it maps to:
golem> rump.modstat
NAME CLASS SOURCE REFS SIZE REQUIRES
bpf driver builtin 0 - -
cd9660 vfs builtin 0 - -
cgd driver builtin 0 - -
dm driver builtin 0 - -
efs vfs builtin 0 - -
ext2fs vfs builtin 0 - ffs
fdesc vfs builtin 0 - -
ffs vfs builtin 3 - -
fss driver builtin 0 - -
hfs vfs builtin 0 - -
kernfs vfs builtin 0 - -
ksem misc builtin 0 - -
layerfs misc builtin 2 - -
lfs vfs builtin 0 - ffs
mfs vfs builtin 0 - ffs
msdos vfs builtin 0 - -
nfs vfs builtin 1 - -
nfsserver misc builtin 0 - nfs
nilfs vfs builtin 0 - -
ntfs vfs builtin 0 - -
null vfs builtin 0 - layerfs
pad driver builtin 0 - -
ptyfs vfs builtin 0 - -
puffs vfs builtin 0 - putter
putter driver builtin 1 - -
scsiverbose misc builtin 0 - -
smbfs vfs builtin 0 - -
suser secmodel builtin 0 - -
swsensor driver builtin 0 - -
sysvbfs vfs builtin 0 - -
tmpfs vfs builtin 0 - -
udf vfs builtin 0 - -
umap vfs builtin 0 - layerfs
union vfs builtin 0 - -
usbverbose misc builtin 0 - -
wapbl vfs builtin 0 - -
In terms of interfaces:
golem> rump.ifconfig -C
shmif virt lo carp
and dmesg:
NetBSD 5.99.41 (RUMP-ROAST) #0: Tue Nov 30 15:35:05 CET 2010
pooka@pain-rustique.localhost:/usr/allsrc/src/sys/rump/librump/rumpkern
total memory = unlimited (host limit)
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "rumpclk" frequency 100 Hz quality 0
cpu0 at thinair0: rump virtual cpu
cpu1 at thinair0: rump virtual cpu
root file system type: rumpfs
mainbus0 (root)
ugenhc0 at mainbus0
usb0 at ugenhc0: USB revision 2.0
uhub0 at usb0: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub0: 1 port with 1 removable, self powered
ugenhc1 at mainbus0
usb1 at ugenhc1: USB revision 2.0
uhub1 at usb1: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub1: 1 port with 1 removable, self powered
ugenhc2 at mainbus0
usb2 at ugenhc2: USB revision 2.0
uhub2 at usb2: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub2: 1 port with 1 removable, self powered
ugenhc3 at mainbus0
usb3 at ugenhc3: USB revision 2.0
uhub3 at usb3: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub3: 1 port with 1 removable, self powered
scsitest0 at mainbus0
scsibus0 at scsitest0: 2 targets, 1 lun per target
cd0 at scsibus0 target 1 lun 0: <RUMPHOBO, It's a LIE, 0.00> cdrom removable
Chicony Electronics Chicony Electronics, class 0/0, rev 2.00/1.00, addr 2, uhub0 port 1 not configured
AuthenTec AuthenTec, class 255/255, rev 1.10/6.21, addr 2, uhub1 port 1 not configured
swwdog0: software watchdog initialized
Kernelized RAIDframe activated
pad0: outputs: 44100Hz, 16-bit, stereo
audio0 at pad0: half duplex, playback, capture
There a bunch of other stuff which doesn't show up as any of the
above, plus of course the usb drivers which are probed only if I
have the appropriate hardware plugged into my workstation.
2010-12-05 20:37:32 +03:00
|
|
|
if (error)
|
2013-12-19 00:48:31 +04:00
|
|
|
die_rumperr(sflag, error, "rump server init failed");
|
2010-12-11 13:44:55 +03:00
|
|
|
|
|
|
|
if (!sflag)
|
2010-12-12 15:49:37 +03:00
|
|
|
rump_daemonize_done(RUMP_DAEMONIZE_SUCCESS);
|
2010-12-11 13:44:55 +03:00
|
|
|
|
2010-12-12 21:32:47 +03:00
|
|
|
sem_init(&sigsem, 0, 0);
|
|
|
|
signal(SIGTERM, sigreboot);
|
|
|
|
signal(SIGINT, sigreboot);
|
|
|
|
sem_wait(&sigsem);
|
|
|
|
|
|
|
|
rump_sys_reboot(0, NULL);
|
2010-12-12 21:33:44 +03:00
|
|
|
/*NOTREACHED*/
|
|
|
|
|
2010-12-12 21:32:47 +03:00
|
|
|
return 0;
|
Add a rump server which comes with all the drivers currently
available. In terms of modules it maps to:
golem> rump.modstat
NAME CLASS SOURCE REFS SIZE REQUIRES
bpf driver builtin 0 - -
cd9660 vfs builtin 0 - -
cgd driver builtin 0 - -
dm driver builtin 0 - -
efs vfs builtin 0 - -
ext2fs vfs builtin 0 - ffs
fdesc vfs builtin 0 - -
ffs vfs builtin 3 - -
fss driver builtin 0 - -
hfs vfs builtin 0 - -
kernfs vfs builtin 0 - -
ksem misc builtin 0 - -
layerfs misc builtin 2 - -
lfs vfs builtin 0 - ffs
mfs vfs builtin 0 - ffs
msdos vfs builtin 0 - -
nfs vfs builtin 1 - -
nfsserver misc builtin 0 - nfs
nilfs vfs builtin 0 - -
ntfs vfs builtin 0 - -
null vfs builtin 0 - layerfs
pad driver builtin 0 - -
ptyfs vfs builtin 0 - -
puffs vfs builtin 0 - putter
putter driver builtin 1 - -
scsiverbose misc builtin 0 - -
smbfs vfs builtin 0 - -
suser secmodel builtin 0 - -
swsensor driver builtin 0 - -
sysvbfs vfs builtin 0 - -
tmpfs vfs builtin 0 - -
udf vfs builtin 0 - -
umap vfs builtin 0 - layerfs
union vfs builtin 0 - -
usbverbose misc builtin 0 - -
wapbl vfs builtin 0 - -
In terms of interfaces:
golem> rump.ifconfig -C
shmif virt lo carp
and dmesg:
NetBSD 5.99.41 (RUMP-ROAST) #0: Tue Nov 30 15:35:05 CET 2010
pooka@pain-rustique.localhost:/usr/allsrc/src/sys/rump/librump/rumpkern
total memory = unlimited (host limit)
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "rumpclk" frequency 100 Hz quality 0
cpu0 at thinair0: rump virtual cpu
cpu1 at thinair0: rump virtual cpu
root file system type: rumpfs
mainbus0 (root)
ugenhc0 at mainbus0
usb0 at ugenhc0: USB revision 2.0
uhub0 at usb0: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub0: 1 port with 1 removable, self powered
ugenhc1 at mainbus0
usb1 at ugenhc1: USB revision 2.0
uhub1 at usb1: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub1: 1 port with 1 removable, self powered
ugenhc2 at mainbus0
usb2 at ugenhc2: USB revision 2.0
uhub2 at usb2: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub2: 1 port with 1 removable, self powered
ugenhc3 at mainbus0
usb3 at ugenhc3: USB revision 2.0
uhub3 at usb3: vendor 0x7275 product 0x6d70, class 9/0, rev 0.00/0.00, addr 1
uhub3: 1 port with 1 removable, self powered
scsitest0 at mainbus0
scsibus0 at scsitest0: 2 targets, 1 lun per target
cd0 at scsibus0 target 1 lun 0: <RUMPHOBO, It's a LIE, 0.00> cdrom removable
Chicony Electronics Chicony Electronics, class 0/0, rev 2.00/1.00, addr 2, uhub0 port 1 not configured
AuthenTec AuthenTec, class 255/255, rev 1.10/6.21, addr 2, uhub1 port 1 not configured
swwdog0: software watchdog initialized
Kernelized RAIDframe activated
pad0: outputs: 44100Hz, 16-bit, stereo
audio0 at pad0: half duplex, playback, capture
There a bunch of other stuff which doesn't show up as any of the
above, plus of course the usb drivers which are probed only if I
have the appropriate hardware plugged into my workstation.
2010-12-05 20:37:32 +03:00
|
|
|
}
|
2013-11-13 21:47:27 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (c) 1987, 1988, 1993
|
|
|
|
* The Regents of the University of California. All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. Neither the name of the University nor the names of its contributors
|
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
* @(#)disklabel.h 8.2 (Berkeley) 7/10/94
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define RUMPSERVER_MAXPARTITIONS 22
|
|
|
|
#define RUMPSERVER_DISKMAGIC ((uint32_t)0x82564557) /* magic */
|
|
|
|
#define RUMPSERVER_DEVSHIFT 9
|
|
|
|
|
|
|
|
struct rumpserver_disklabel {
|
|
|
|
uint32_t d_magic; /* the magic number */
|
|
|
|
uint16_t d_type; /* drive type */
|
|
|
|
uint16_t d_subtype; /* controller/d_type specific */
|
|
|
|
char d_typename[16]; /* type name, e.g. "eagle" */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* d_packname contains the pack identifier and is returned when
|
|
|
|
* the disklabel is read off the disk or in-core copy.
|
|
|
|
* d_boot0 and d_boot1 are the (optional) names of the
|
|
|
|
* primary (block 0) and secondary (block 1-15) bootstraps
|
|
|
|
* as found in /usr/mdec. These are returned when using
|
|
|
|
* getdiskbyname(3) to retrieve the values from /etc/disktab.
|
|
|
|
*/
|
|
|
|
union {
|
|
|
|
char un_d_packname[16]; /* pack identifier */
|
|
|
|
struct {
|
|
|
|
char *un_d_boot0; /* primary bootstrap name */
|
|
|
|
char *un_d_boot1; /* secondary bootstrap name */
|
|
|
|
} un_b;
|
|
|
|
} d_un;
|
|
|
|
#define d_packname d_un.un_d_packname
|
|
|
|
#define d_boot0 d_un.un_b.un_d_boot0
|
|
|
|
#define d_boot1 d_un.un_b.un_d_boot1
|
|
|
|
|
|
|
|
/* disk geometry: */
|
|
|
|
uint32_t d_secsize; /* # of bytes per sector */
|
|
|
|
uint32_t d_nsectors; /* # of data sectors per track */
|
|
|
|
uint32_t d_ntracks; /* # of tracks per cylinder */
|
|
|
|
uint32_t d_ncylinders; /* # of data cylinders per unit */
|
|
|
|
uint32_t d_secpercyl; /* # of data sectors per cylinder */
|
|
|
|
uint32_t d_secperunit; /* # of data sectors per unit */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Spares (bad sector replacements) below are not counted in
|
|
|
|
* d_nsectors or d_secpercyl. Spare sectors are assumed to
|
|
|
|
* be physical sectors which occupy space at the end of each
|
|
|
|
* track and/or cylinder.
|
|
|
|
*/
|
|
|
|
uint16_t d_sparespertrack; /* # of spare sectors per track */
|
|
|
|
uint16_t d_sparespercyl; /* # of spare sectors per cylinder */
|
|
|
|
/*
|
|
|
|
* Alternative cylinders include maintenance, replacement,
|
|
|
|
* configuration description areas, etc.
|
|
|
|
*/
|
|
|
|
uint32_t d_acylinders; /* # of alt. cylinders per unit */
|
|
|
|
|
|
|
|
/* hardware characteristics: */
|
|
|
|
/*
|
|
|
|
* d_interleave, d_trackskew and d_cylskew describe perturbations
|
|
|
|
* in the media format used to compensate for a slow controller.
|
|
|
|
* Interleave is physical sector interleave, set up by the
|
|
|
|
* formatter or controller when formatting. When interleaving is
|
|
|
|
* in use, logically adjacent sectors are not physically
|
|
|
|
* contiguous, but instead are separated by some number of
|
|
|
|
* sectors. It is specified as the ratio of physical sectors
|
|
|
|
* traversed per logical sector. Thus an interleave of 1:1
|
|
|
|
* implies contiguous layout, while 2:1 implies that logical
|
|
|
|
* sector 0 is separated by one sector from logical sector 1.
|
|
|
|
* d_trackskew is the offset of sector 0 on track N relative to
|
|
|
|
* sector 0 on track N-1 on the same cylinder. Finally, d_cylskew
|
|
|
|
* is the offset of sector 0 on cylinder N relative to sector 0
|
|
|
|
* on cylinder N-1.
|
|
|
|
*/
|
|
|
|
uint16_t d_rpm; /* rotational speed */
|
|
|
|
uint16_t d_interleave; /* hardware sector interleave */
|
|
|
|
uint16_t d_trackskew; /* sector 0 skew, per track */
|
|
|
|
uint16_t d_cylskew; /* sector 0 skew, per cylinder */
|
|
|
|
uint32_t d_headswitch; /* head switch time, usec */
|
|
|
|
uint32_t d_trkseek; /* track-to-track seek, usec */
|
|
|
|
uint32_t d_flags; /* generic flags */
|
|
|
|
#define NDDATA 5
|
|
|
|
uint32_t d_drivedata[NDDATA]; /* drive-type specific information */
|
|
|
|
#define NSPARE 5
|
|
|
|
uint32_t d_spare[NSPARE]; /* reserved for future use */
|
|
|
|
uint32_t d_magic2; /* the magic number (again) */
|
|
|
|
uint16_t d_checksum; /* xor of data incl. partitions */
|
|
|
|
|
|
|
|
/* filesystem and partition information: */
|
|
|
|
uint16_t d_npartitions; /* number of partitions in following */
|
|
|
|
uint32_t d_bbsize; /* size of boot area at sn0, bytes */
|
|
|
|
uint32_t d_sbsize; /* max size of fs superblock, bytes */
|
|
|
|
struct rumpserver_partition { /* the partition table */
|
|
|
|
uint32_t p_size; /* number of sectors in partition */
|
|
|
|
uint32_t p_offset; /* starting sector */
|
|
|
|
union {
|
|
|
|
uint32_t fsize; /* FFS, ADOS:
|
|
|
|
filesystem basic fragment size */
|
|
|
|
uint32_t cdsession; /* ISO9660: session offset */
|
|
|
|
} __partition_u2;
|
|
|
|
#define p_fsize __partition_u2.fsize
|
|
|
|
#define p_cdsession __partition_u2.cdsession
|
|
|
|
uint8_t p_fstype; /* filesystem type, see below */
|
|
|
|
uint8_t p_frag; /* filesystem fragments per block */
|
|
|
|
union {
|
|
|
|
uint16_t cpg; /* UFS: FS cylinders per group */
|
|
|
|
uint16_t sgs; /* LFS: FS segment shift */
|
|
|
|
} __partition_u1;
|
|
|
|
#define p_cpg __partition_u1.cpg
|
|
|
|
#define p_sgs __partition_u1.sgs
|
|
|
|
} d_partitions[RUMPSERVER_MAXPARTITIONS]; /* actually may be more */
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* for swapping disklabel, so don't care about perf, just portability */
|
|
|
|
#define bs32(x) \
|
|
|
|
((((x) & 0xff000000) >> 24)| \
|
|
|
|
(((x) & 0x00ff0000) >> 8) | \
|
|
|
|
(((x) & 0x0000ff00) << 8) | \
|
|
|
|
(((x) & 0x000000ff) << 24))
|
|
|
|
#define bs16(x) ((((x) & 0xff00) >> 8) | (((x) & 0x00ff) << 8))
|
|
|
|
|
|
|
|
/*
|
|
|
|
* From:
|
|
|
|
* $NetBSD: disklabel_dkcksum.c,v 1.4 2005/05/15 21:01:34 thorpej Exp
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*-
|
|
|
|
* Copyright (c) 1991, 1993
|
|
|
|
* The Regents of the University of California. All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. Neither the name of the University nor the names of its contributors
|
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
static uint16_t
|
|
|
|
rs_dl_dkcksum(struct rumpserver_disklabel *lp, int imswapped)
|
|
|
|
{
|
|
|
|
uint16_t *start, *end;
|
|
|
|
uint16_t sum;
|
|
|
|
uint16_t npart;
|
|
|
|
|
|
|
|
if (imswapped)
|
|
|
|
npart = bs16(lp->d_npartitions);
|
|
|
|
else
|
|
|
|
npart = lp->d_npartitions;
|
|
|
|
|
|
|
|
sum = 0;
|
|
|
|
start = (uint16_t *)(void *)lp;
|
|
|
|
end = (uint16_t *)(void *)&lp->d_partitions[npart];
|
|
|
|
while (start < end) {
|
|
|
|
if (imswapped)
|
|
|
|
sum ^= bs16(*start);
|
|
|
|
else
|
|
|
|
sum ^= *start;
|
|
|
|
start++;
|
|
|
|
}
|
|
|
|
return (sum);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* From:
|
|
|
|
* NetBSD: disklabel_scan.c,v 1.3 2009/01/18 12:13:03 lukem Exp
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*-
|
|
|
|
* Copyright (c) 2002 The NetBSD Foundation, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
* by Roland C. Dowdeswell.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
static int
|
|
|
|
rs_dl_scan(struct rumpserver_disklabel *lp, int *isswapped,
|
|
|
|
char *buf, size_t buflen)
|
|
|
|
{
|
|
|
|
size_t i;
|
|
|
|
int imswapped;
|
|
|
|
uint16_t npart;
|
|
|
|
|
|
|
|
/* scan for the correct magic numbers. */
|
|
|
|
|
|
|
|
for (i=0; i <= buflen - sizeof(*lp); i += 4) {
|
|
|
|
memcpy(lp, buf + i, sizeof(*lp));
|
|
|
|
if (lp->d_magic == RUMPSERVER_DISKMAGIC &&
|
|
|
|
lp->d_magic2 == RUMPSERVER_DISKMAGIC) {
|
|
|
|
imswapped = 0;
|
|
|
|
goto sanity;
|
|
|
|
}
|
|
|
|
if (lp->d_magic == bs32(RUMPSERVER_DISKMAGIC) &&
|
|
|
|
lp->d_magic2 == bs32(RUMPSERVER_DISKMAGIC)) {
|
|
|
|
imswapped = 1;
|
|
|
|
goto sanity;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
sanity:
|
|
|
|
if (imswapped)
|
|
|
|
npart = bs16(lp->d_npartitions);
|
|
|
|
else
|
|
|
|
npart = lp->d_npartitions;
|
|
|
|
/* we've found something, let's sanity check it */
|
|
|
|
if (npart > RUMPSERVER_MAXPARTITIONS
|
|
|
|
|| rs_dl_dkcksum(lp, imswapped))
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
*isswapped = imswapped;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
processlabel(int sflag, int fd, int partition, off_t *foffp, off_t *flenp)
|
|
|
|
{
|
|
|
|
struct rumpserver_disklabel dl;
|
|
|
|
char buf[1<<16];
|
|
|
|
uint32_t foffset, flen;
|
|
|
|
int imswapped;
|
|
|
|
|
|
|
|
if (pread(fd, buf, sizeof(buf), 0) == -1)
|
|
|
|
die(sflag, errno, "could not read disk device");
|
|
|
|
if (rs_dl_scan(&dl, &imswapped, buf, sizeof(buf)))
|
|
|
|
die(sflag, ENOENT, "disklabel not found");
|
|
|
|
|
|
|
|
if (partition >= dl.d_npartitions)
|
|
|
|
die(sflag, ENOENT, "partition not available");
|
|
|
|
|
|
|
|
foffset = dl.d_partitions[partition].p_offset << RUMPSERVER_DEVSHIFT;
|
|
|
|
flen = dl.d_partitions[partition].p_size << RUMPSERVER_DEVSHIFT;
|
|
|
|
if (imswapped) {
|
|
|
|
foffset = bs32(foffset);
|
|
|
|
flen = bs32(flen);
|
|
|
|
}
|
|
|
|
|
|
|
|
*foffp = (off_t)foffset;
|
|
|
|
*flenp = (off_t)flen;
|
|
|
|
}
|