/* WILDBOAR $Wildboar: ioconf.c.i386,v 1.8 1996/02/13 13:01:15 shigeya Exp $ * * -+- * This modified module is part of Wildboar software kit. * This work derived from BSDI original distribution. * * This software component, or modified part of this component is * Copyright(c)1993,1994,1995,1996 Yoichi Shinoda, Yoshitaka Tokugawa, * WIDE Project, Wildboar Project and Foretune. ALL OF THE MODIFICATION * COPYRIGHTS AND ORIGINAL WORK COPYRIGHTS ARE RESERVED. * Even the original components' Copyright notice is different, * since this software component is beta quality, and how to distribute * the software is still unknown, you should NEVER provide this module * to anyone. If you need to provide this module to anybody else, You * should contact Wildboar project to get written permission, or ask * the person to contact Wildboar project. * If you NEVER agreed the condition and saw this notice, the person * give you the copy is already violated the condition. * +-+ */ /*- * Copyright (c) 1994, 1995 Berkeley Software Design, Inc. * All rights reserved. * The Berkeley Software Design Inc. software License Agreement specifies * the terms and conditions for redistribution. * * BSDI $Id: ioconf.c.i386,v 1.1.1.1 1997/12/11 14:46:15 itojun Exp $ */ /* template ioconf.c for i386 */ #include #include #include #include #include #include %CONFIG extern struct devsw cnsw, cttysw, mmsw, swapsw, logsw, devfdsw; extern struct devsw ptssw, ptcsw; extern struct devsw pcsw, kbdsw; %DECLSW struct devsw *devsw[] = { &cnsw, /* 0 = virtual console */ &cttysw, /* 1 = controlling terminal */ &mmsw, /* 2 = /dev/{null,mem,kmem,...} */ %DEVSW(wd), /* 3 = st506/rll/esdi/ide disk */ &swapsw, /* 4 = /dev/drum (swap pseudo-device) */ %DEVSW(pty, &ptssw), /* 5 = pseudo-tty slave */ %DEVSW(pty, &ptcsw), /* 6 = pseudo-tty master */ &logsw, /* 7 = /dev/klog */ %DEVSW(com), /* 8 = serial communications ports */ %DEVSW(fd), /* 9 = floppy disk */ %DEVSW(wt), /* 10 = QIC-02/36 cartridge tape */ %DEVSW(rc), /* 11 = RISCom/N8 async mux */ %DEVSW(pccons, &pcsw), /* 12 = vga console */ %DEVSW(pcaux), /* 13 = console/keyboard aux port */ %DEVSW(bpfilter), /* 14 = berkeley packet filter */ &devfdsw, /* 15 = file descriptor devices */ %DEVSW(vga), /* 16 = VGA display for X */ %DEVSW(pccons, &kbdsw), /* 17 = Keyboard device (excl from cn) */ %DEVSW(sd), /* 18 = SCSI disk pseudo-device (sd) */ %DEVSW(st), /* 19 = SCSI tape pseudo-device */ %DEVSW(lp), /* 20 = printer on a parallel port */ %DEVSW(bms), /* 21 = Microsoft Bus Mouse */ NULL, /* 22 = Midi device (RETIRED) */ %DEVSW(mcd), /* 23 = Mitsumi CD-ROM */ %DEVSW(ms), /* 24 = Maxpeed Async Mux */ %DEVSW(lms), /* 25 = Logitec Bus Mouse */ %DEVSW(digi), /* 26 = DigiBoard PC/X[ei] */ %DEVSW(si), /* 27 = Specialix multiplexor */ NULL, /* 28 = SoundBlaster Pro (RETIRED) */ %DEVSW(aimc), /* 29 = Chase IOPRO control driver */ %DEVSW(aim), /* 30 = Chase IOPRO data driver */ %DEVSW(eqnx), /* 31 = Equinox tty */ %DEVSW(cd), /* 32 = Concatenated disk pseudo-device */ %DEVSW(snd), /* 33 = Voxware sound system */ %DEVSW(sr), /* 34 = SCSI removeable disks (clone of sd) */ %DEVSW(rp), /* 35 = Comtrol Rocketport */ %DEVSW(cy), /* 36 = Cyclades async mux */ NULL, /* 37 = (unused) */ NULL, /* 38 = (unused) */ NULL, /* 39 = (unused) */ NULL, /* 40 = (unused) */ NULL, /* 41 = (unused) */ NULL, /* 42 = (unused) */ NULL, /* 43 = (unused) */ NULL, /* 44 = (unused) */ NULL, /* 45 = (unused) */ NULL, /* 46 = (unused) */ NULL, /* 47 = (unused) */ NULL, /* 48 = (unused) */ NULL, /* 49 = (unused) */ %DEVSW(apm), /* 50 = APM Interface module */ %DEVSW(cs), /* 51 = PCMCIA CS Interface module */ %DEVSW(fvc), /* 52 = Focus Video Capture */ %DEVSW(mc), /* 53 = PCMCIA SRAM Drive */ %DEVSW(scc), /* 54 = IBM Smart Capture Card */ %DEVSW(hss), /* 55 = Hitachi Speech Syntehsis Card */ }; #define NDEVSW (sizeof(devsw) / sizeof(*devsw)) int ndevsw = NDEVSW; #ifdef COMPAT_DEV /* cross-correlation to devsw[] above, from old bdevsw index */ /* (i.e., devsw[blktodev[i]] is the driver for old block device i) */ int blktodev[7] = { 3, /* 0 = wd = 3 */ 4, /* 1 = swap = 4 */ 9, /* 2 = floppy = 9 */ 10, /* 3 = wt = 10 */ 18, /* 4 = sd = 18 */ 19, /* 5 = st = 19 */ 23, /* 6 = mcd = 23 */ }; #endif /* * Swapdev is a fake device implemented * in vm_swap.c used only internally to get to swstrategy. * It cannot be provided to the users, because the * swstrategy routine munches the b_dev and b_blkno entries * before calling the appropriate driver. This would horribly * confuse, e.g. the hashing routines. Instead, /dev/drum is * provided as a character (raw) device. */ dev_t swapdev = makedev(4, 0); /* * Routine that identifies /dev/mem and /dev/kmem. * * A minimal stub routine can always return 0. */ iskmemdev(dev) dev_t dev; { return (major(dev) == 2 && (minor(dev) == 0 || minor(dev) == 1)); } iszerodev(dev) dev_t dev; { return (major(dev) == 2 && minor(dev) == 12); } #ifdef COMPAT_DEV #include int devcompat(dev, type) dev_t dev; int type; { int maj, min, unit = 0; if (dev > USHRT_MAX) return (dev); maj = dev >> 8; min = dev & 0xff; if (type == VBLK && maj < sizeof(blktodev) / sizeof(blktodev[0])) maj = blktodev[maj]; switch (maj) { case 3: /* 0 = wd = 3 */ case 9: /* 2 = floppy = 9 */ case 18: /* 4 = sd = 18 */ case 23: /* 6 = mcd = 23 */ unit = min >> 3; /* drive */ min &= 0x7; /* partition */ break; case 10: /* 3 = wt = 10 */ case 19: /* 5 = st = 19 */ unit = min & 3; /* unit */ min >>= 2; /* rewind, density */ break; } return (dv_makedev(maj, unit, min)); } #endif