NetBSD/usr.bin/rump_allserver/rump_allserver.c

420 lines
9.3 KiB
C
Raw Normal View History

/* $NetBSD: rump_allserver.c,v 1.21 2011/02/22 15:51:59 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
/*-
* 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.
*/
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: rump_allserver.c,v 1.21 2011/02/22 15:51:59 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>
#include <sys/disklabel.h>
2010-12-12 21:32:47 +03:00
#include <sys/signal.h>
#include <sys/module.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 <rump/rump.h>
2010-12-12 21:32:47 +03:00
#include <rump/rump_syscalls.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 <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 <err.h>
#include <errno.h>
#include <fcntl.h>
2010-12-12 21:32:47 +03:00
#include <semaphore.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>
#include <string.h>
#include <unistd.h>
#include <util.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
static void
usage(void)
{
2011-01-03 15:18:25 +03:00
fprintf(stderr, "usage: %s [-s] [-c ncpu] [-d drivespec] [-l libs] "
"[-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);
}
static void
die(int sflag, int error, const char *reason)
{
warnx("%s: %s", reason, strerror(error));
if (!sflag)
rump_daemonize_done(error);
exit(1);
}
2010-12-12 21:32:47 +03:00
static sem_t sigsem;
static void
sigreboot(int sig)
{
sem_post(&sigsem);
}
static const char *const disktokens[] = {
#define DKEY 0
"key",
#define DFILE 1
"hostpath",
#define DSIZE 2
#define DSIZE_E -1
"size",
#define DOFFSET 3
"offset",
#define DLABEL 4
"disklabel",
#define DTYPE 5
"type",
NULL
};
struct etfsreg {
const char *key;
const char *hostpath;
off_t flen;
off_t foffset;
char partition;
enum rump_etfs_type type;
};
struct etfstype {
const char *name;
enum rump_etfs_type type;
} etfstypes[] = {
{ "blk", RUMP_ETFS_BLK },
{ "chr", RUMP_ETFS_CHR },
{ "reg", RUMP_ETFS_REG },
};
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[])
{
const char *serverurl;
char **modarray = NULL;
unsigned nmods = 0, curmod = 0, i;
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;
int ch, sflag;
int ncpu;
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]);
sflag = 0;
while ((ch = getopt(argc, argv, "c:d:l:m:r:sv")) != -1) {
switch (ch) {
case 'c':
ncpu = atoi(optarg);
/* XXX: MAXCPUS is from host, not from kernel */
if (ncpu < 1 || ncpu > MAXCPUS)
err(1, "CPU count needs to be between "
"1 and %d\n", MAXCPUS);
setenv("RUMP_NCPU", optarg, 1);
break;
case 'd': {
char *options, *value;
char *key, *hostpath;
long long flen, foffset;
char partition;
int ftype;
flen = foffset = 0;
partition = 0;
key = hostpath = NULL;
ftype = -1;
options = optarg;
while (*options) {
switch (getsubopt(&options,
__UNCONST(disktokens), &value)) {
case DKEY:
if (key != NULL) {
fprintf(stderr,
"key already given\n");
usage();
}
key = value;
break;
case DFILE:
if (hostpath != NULL) {
fprintf(stderr,
"hostpath already given\n");
usage();
}
hostpath = value;
break;
case DSIZE:
if (flen != 0) {
fprintf(stderr,
"size already given\n");
usage();
}
if (strcmp(value, "host") == 0) {
if (foffset != 0) {
fprintf(stderr,
"cannot specify "
"offset with "
"size=host\n");
usage();
}
flen = DSIZE_E;
} else {
/* XXX: off_t max? */
flen = strsuftoll("-d size",
value, 0, LLONG_MAX);
}
break;
case DOFFSET:
if (foffset != 0) {
fprintf(stderr,
"offset already given\n");
usage();
}
if (flen == DSIZE_E) {
fprintf(stderr, "cannot "
"specify offset with "
"size=host\n");
usage();
}
/* XXX: off_t max? */
foffset = strsuftoll("-d offset", value,
0, LLONG_MAX);
break;
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;
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;
default:
fprintf(stderr, "invalid dtoken\n");
usage();
break;
}
}
if (key == NULL || hostpath == NULL ||
(flen == 0 && partition == 0)) {
fprintf(stderr, "incomplete drivespec\n");
usage();
}
if (ftype == -1)
ftype = RUMP_ETFS_BLK;
if (netfs - curetfs == 0) {
etfs = realloc(etfs, (netfs+16)*sizeof(*etfs));
if (etfs == NULL)
err(1, "realloc etfs");
netfs += 16;
}
etfs[curetfs].key = key;
etfs[curetfs].hostpath = hostpath;
etfs[curetfs].flen = flen;
etfs[curetfs].foffset = foffset;
etfs[curetfs].partition = partition;
etfs[curetfs].type = ftype;
curetfs++;
break;
}
case 'l':
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) {
errx(1, "dlopen %s failed: %s",
pb, dlerror());
}
}
break;
case 'm':
if (nmods - curmod == 0) {
modarray = realloc(modarray,
(nmods+16) * sizeof(char *));
if (modarray == NULL)
err(1, "realloc");
nmods += 16;
}
modarray[curmod++] = optarg;
break;
case 'r':
setenv("RUMP_MEMLIMIT", optarg, 1);
break;
case 's':
sflag = 1;
break;
case 'v':
setenv("RUMP_VERBOSE", "1", 1);
break;
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();
serverurl = argv[0];
if (!sflag) {
error = rump_daemonize_begin();
if (error)
errx(1, "rump daemonize: %s", strerror(error));
}
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)
die(sflag, error, "rump init failed");
/* load modules */
for (i = 0; i < curmod; i++) {
struct modctl_load ml;
#define ETFSKEY "/module.mod"
if ((error = rump_pub_etfs_register(ETFSKEY,
modarray[0], RUMP_ETFS_REG)) != 0)
die(sflag, error, "module etfs register failed");
memset(&ml, 0, sizeof(ml));
ml.ml_filename = ETFSKEY;
if (rump_sys_modctl(MODCTL_LOAD, &ml) == -1)
die(sflag, errno, "module load failed");
rump_pub_etfs_remove(ETFSKEY);
#undef ETFSKEY
}
/* register host drives */
for (i = 0; i < curetfs; i++) {
char buf[1<<16];
struct disklabel dl;
struct stat sb;
off_t foffset, flen, fendoff;
int fd, oflags;
oflags = etfs[i].flen == DSIZE_E ? 0 : O_CREAT;
fd = open(etfs[i].hostpath, O_RDWR | oflags, 0644);
if (fd == -1)
die(sflag, errno, "etfs hostpath open");
if (etfs[i].partition) {
int partition = etfs[i].partition - 'a';
pread(fd, buf, sizeof(buf), 0);
if (disklabel_scan(&dl, 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
<< DEV_BSHIFT;
flen = dl.d_partitions[partition].p_size
<< DEV_BSHIFT;
} else {
foffset = etfs[i].foffset;
flen = etfs[i].flen;
}
if (fstat(fd, &sb) == -1)
die(sflag, errno, "fstat etfs hostpath");
if (flen == DSIZE_E) {
if (sb.st_size == 0)
die(sflag, EINVAL, "size=host, but cannot "
"query non-zero size");
flen = sb.st_size;
}
fendoff = foffset + flen;
if (S_ISREG(sb.st_mode) && sb.st_size < fendoff) {
if (ftruncate(fd, fendoff) == -1)
die(sflag, errno, "truncate");
}
close(fd);
if ((error = rump_pub_etfs_register_withsize(etfs[i].key,
etfs[i].hostpath, etfs[i].type, foffset, flen)) != 0)
die(sflag, error, "etfs register");
}
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)
die(sflag, error, "rump server init failed");
if (!sflag)
2010-12-12 15:49:37 +03:00
rump_daemonize_done(RUMP_DAEMONIZE_SUCCESS);
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
}