NetBSD/usr.bin/rump_allserver/rump_allserver.c

70 lines
2.1 KiB
C
Raw Normal View History

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
/* $NetBSD: rump_allserver.c,v 1.1 2010/12/05 17:37:33 pooka Exp $ */
/*-
* Copyright (c) 2010 Antti Kantee. 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.
*
* 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.1 2010/12/05 17:37:33 pooka Exp $");
#endif /* !lint */
#include <sys/types.h>
#include <rump/rump.h>
#include <err.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
static void
usage(void)
{
fprintf(stderr, "usage: %s [args] bindurl\n", getprogname());
exit(1);
}
int
main(int argc, char *argv[])
{
int error;
setprogname(argv[0]);
if (argc != 2)
usage();
error = rump_init();
if (error)
errx(1, "rump init failed: %s", strerror(error));
error = rump_init_server(argv[1]);
if (error)
errx(1, "rump server init failed: %s", strerror(error));
pause();
}