From 76ee8424420b8d6178728d952cb9c485aed42883 Mon Sep 17 00:00:00 2001 From: Holger Veit Date: Wed, 26 May 1993 00:00:00 +0000 Subject: [PATCH] New device support patch, if_ed, sio, tw, codrv Add support for more drivers to the conf.c, files.i386, and MAKEDEV files. Note that this patch does not add the actual drivers, it just adds support for them. NOTE: We are patching an installed file (/dev/MAKEDEV), this will need to be propogated to /usr/src/etc when that patch is done. AUTHOR: Holger Veit (holger.veit@gmd.de) (codrv support) AUTHOR: Rodney W. Grimes (rgrimes@agora.rain.com) 386BSD-Patchkit: patch00160 --- dev/MAKEDEV | 88 ++++++++++++++++++++----- usr/src/sys.386bsd/i386/conf/files.i386 | 19 +++++- usr/src/sys.386bsd/i386/i386/conf.c | 87 ++++++++++++++++++++---- 3 files changed, 165 insertions(+), 29 deletions(-) diff --git a/dev/MAKEDEV b/dev/MAKEDEV index 75e2488002..490dd81b49 100644 --- a/dev/MAKEDEV +++ b/dev/MAKEDEV @@ -36,18 +36,21 @@ # fd* "floppy" disk drives (3 1/2", 5 1/4") # as* "SCSI" disk/tape/CDROM drives # sd* "NEW type scsi disks" +# cd* "NEW type cdrom disks" # # Console ports: -# vga stock pccons vga (note it has no keyboard name or minor!) -# vgaco codrv vga -# kbdco codrv kbd +# pc* devices for stock pccons (cleans up co devices) +# co* devices for codrv (cleans up pc devices) +# vty* virtual console devices for codrv (cleans up pc devices) # # Terminal ports: # com* standard PC COM ports # tty* alias for PC COM ports, this is what the system really wants +# sio* fast interrupt PC COM ports # # Pseudo terminals: # pty* set of 16 master and slave pseudo terminals +# vty* virtual terminals using codrv console # # Printers: # lpt* stock lp @@ -57,12 +60,13 @@ # # Special purpose devices: # bpf* packet filter -# speaker pc speaker # dcf* dcf clock +# speaker pc speaker +# tw* xten power controller # # PATCHES MAGIC LEVEL PATCH THAT GOT US HERE # -------------------- ----- ---------------------- -# CURRENT PATCH LEVEL: 2 00135 +# CURRENT PATCH LEVEL: 3 00160 # -------------------- ----- ---------------------- # # 16 Feb 93 Julian Elischer ADDED for SCSI system @@ -74,6 +78,10 @@ # 08 Apr 93 Rodney W. Grimes Cleanup chgrp, chown and chmod stuff # Added duplicate name tty=com, # added speaker, dcf +# 22 Apr 93 Holger Veit device create for co,pc,vty +# 26 May 93 Rodney W. Grimes Redid all to be in bdev/cdev order. +# 26 May 93 Gene Stark Added tw xten power controller +# Rodney W. Grimes Added sio serial port (fast interrupt) # PATH=/sbin:/bin/:/usr/bin:/usr/sbin: @@ -83,8 +91,11 @@ do case $i in all) - sh MAKEDEV std wt0 fd0 fd1 wd0 wd1 as0 as1 sd0 sd1 tty0 tty1 pty0 st0 - sh MAKEDEV ch0 cd0 lpt0 lpt1 lpt2 lpa0 lpa1 lpa2 speaker + sh MAKEDEV std # standard + sh MAKEDEV wd0 wd1 fd0 fd1 wt0 sd0 sd1 as0 as1 st0 cd0 # bdev + sh MAKEDEV pty0 tty0 tty1 tty2 tty3 pc0 lpt0 lpt1 lpt2 # cdev + sh MAKEDEV ch0 tw0 bpf0 co0 vty04 dcf0 lpa0 lpa1 lpa2 # cdev + sh MAKEDEV speaker mse0 sio0 sio1 sio2 sio3 # cdev ;; std) rm -f console drum mem kmem null tty klog stdin stdout stderr @@ -269,20 +280,58 @@ lpt*) chown root.wheel lpt$unit ;; -# Note: the stock pccons driver does not have a minor for the keyboard -vga|vgaco|kbdco) +tw*) + unit=`expr $i : 'tw\(.*\)'` + rm -f tw$unit + mknod tw$unit c 19 $unit + chown root.wheel tw$unit + ;; + +# hv 22-apr-93 use this to create the necessary devices for codrv +# this will cleanup /dev/vga left from pccons +co*) chr=21 - device=`expr ${i} : '\(.*\)co'` - case ${i} in - vga) name=vga; chr=12; minor=0;; - kbdco) name=kbdco; chr=21; minor=0;; - vgaco) name=vgaco; chr=21; minor=128;; - esac - rm -f ${name} + name=vga + rm -rf ${name} + mknod ${name} c ${chr} 128 + ln ${name} ${name}co + chmod 644 ${name} + chown root.wheel ${name} + + chr=21 + name=kbd + rm -rf ${name} + mknod ${name} c ${chr} 128 + ln ${name} ${name}co + chmod 644 ${name} + chown root.wheel ${name} + ;; + +# hv 22-apr-93 use this to create the necessary video device for +# pccons driver +pc*) + chr=12 + minor=0 + name=vga + rm -f ${name} kbd kbdco vgaco ttyv[0-9][0-9] mknod ${name} c ${chr} ${minor} chown root.wheel $name ;; +# hv 22-apr-93 use this to create virtual consoles for codrv +# /dev/ttyv00-12 +# use as MAKEDEV vtyNN to create NN entries +vty*) + chr=12 + units=`expr $i : 'vty\(.*\)'` + umask 0 + eval `echo ${chr} ${units} | awk ' { c=$1; n=$2 } END { + for (i = 0; i < n; i++) + printf("rm -f ttyv%01x; mknod ttyv%01x c %d %d;", \ + i, i, c, i); }'` + umask 77 + ;; + bpf*) unit=`expr $i : 'bpf\(.*\)'` rm -f bpf$unit @@ -312,6 +361,13 @@ speaker) chown root.wheel speaker ;; +sio*) + unit=`expr $i : '...\(.*\)'` + rm -f sio0$unit + mknod sio0$unit c 28 $unit + chown uucp.wheel sio0$unit + ;; + local) umask 0 sh MAKEDEV.local diff --git a/usr/src/sys.386bsd/i386/conf/files.i386 b/usr/src/sys.386bsd/i386/conf/files.i386 index 7aa53e2b86..578472cc73 100644 --- a/usr/src/sys.386bsd/i386/conf/files.i386 +++ b/usr/src/sys.386bsd/i386/conf/files.i386 @@ -1,7 +1,7 @@ # # PATCHES MAGIC LEVEL PATCH THAT GOT US HERE # -------------------- ----- ---------------------- -# CURRENT PATCH LEVEL: 2 00135 +# CURRENT PATCH LEVEL: 3 00160 # -------------------- ----- ---------------------- # # 17 Feb 93 Julian Elischer Added files for scsi @@ -9,6 +9,11 @@ # 25 Mar 93 Sean Eric Fagan Added microtime.s routine # 08 Apr 93 Rodney W. Grimes Cleaned up the tabs, sorted file names # Added ix, speaker, dcfclock +# 23 Apr 93 Holger Veit Added codrv +# 26 May 93 Rodney W. Grimes Rename of Bruce Evans com driver to sio +# Gene Stark Add xten power controler driver (tw) +# David Greenman Add ethernet driver (SMC/WD/3COM) (ed) +# Rick Macklem Add bus mouse driver (mse) # i386/i386/autoconf.c standard device-driver i386/i386/cons.c standard @@ -30,10 +35,18 @@ i386/isa/aha1742.c optional ahb device-driver i386/isa/as.c optional as device-driver i386/isa/bt742a.c optional bt device-driver i386/isa/clock.c standard +i386/isa/codrv/co_cons.c optional co device-driver +i386/isa/codrv/co_kbd.c optional co device-driver +i386/isa/codrv/co_vga.c optional co device-driver +i386/isa/codrv/co_codrv1.c optional co device-driver +i386/isa/codrv/co_vty.c optional vty +i386/isa/codrv/co_pc3.c optional vtemul +i386/isa/codrv/co_mini.c optional vtemul i386/isa/com.c optional com device-driver i386/isa/dcfclk.c optional dcfclk device-driver i386/isa/fd.c optional fd device-driver i386/isa/if_ec.c optional ec device-driver +i386/isa/if_ed.c optional ed device-driver i386/isa/if_is.c optional is device-driver i386/isa/if_ix.c optional ix device-driver i386/isa/if_ne.c optional ne device-driver @@ -41,9 +54,12 @@ i386/isa/if_we.c optional we device-driver i386/isa/isa.c optional isa device-driver i386/isa/lpa.c optional lpa device-driver i386/isa/lpt.c optional lpt device-driver +i386/isa/mse.c optional mse device-driver i386/isa/npx.c optional npx device-driver i386/isa/pccons.c optional pc device-driver +i386/isa/sio.c optional sio device-driver i386/isa/spkr.c optional speaker +i386/isa/tw.c optional tw device-driver i386/isa/ultra14f.c optional uha device-driver i386/isa/wd.c optional wd device-driver i386/isa/wt.c optional wt device-driver @@ -52,3 +68,4 @@ scsi/ch.c optional ch scsi/scsiconf.c optional scbus scsi/sd.c optional sd scsi/st.c optional st + diff --git a/usr/src/sys.386bsd/i386/i386/conf.c b/usr/src/sys.386bsd/i386/i386/conf.c index 077fc6bd8b..0189092fc0 100644 --- a/usr/src/sys.386bsd/i386/i386/conf.c +++ b/usr/src/sys.386bsd/i386/i386/conf.c @@ -37,7 +37,7 @@ * * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE * -------------------- ----- ---------------------- - * CURRENT PATCH LEVEL: 4 00135 + * CURRENT PATCH LEVEL: 5 00160 * -------------------- ----- ---------------------- * * 10 Feb 93 Jordan K. Hubbard Added select entry for com driver @@ -49,6 +49,11 @@ * 10 Mar 83 Rodney W. Grimes General clean up of the above patches * 06 Apr 93 Rodney W. Grimes Fixed NLPT for LPA driver case, added * spkr, dcfclock + * 23 Apr 93 Holger Veit added codrv + * 25 May 93 Bruce Evans New fast interrupt serial driver (sio) + * Gene Stark Xten power controller info added (tw) + * Rick Macklem Bus mouse driver (mse) + * */ static char rcsid[] = "$Header: /usr/src/sys.386bsd/i386/i386/RCS/conf.c,v 1.2 92/01/21 14:21:57 william Exp Locker: toor $"; @@ -261,6 +266,30 @@ int lptopen(),lptclose(),lptwrite(),lptioctl(); #define lptioctl enxio #endif +#include "co.h" +#if NCO > 0 +int coopen(),coclose(),coread(),coioctl(),coselect(),comap(); +#define pcmmap comap +#else +#define coopen enxio +#define coclose enxio +#define coread enxio +#define coioctl enxio +#define coselect enxio +#define comap enxio +#endif + +#include "tw.h" +#if NTW > 0 +int twopen(),twclose(),twread(),twwrite(),twselect(); +#else +#define twopen enxio +#define twclose enxio +#define twread enxio +#define twwrite enxio +#define twselect enxio +#endif + int fdopen(); #include "bpfilter.h" @@ -300,10 +329,38 @@ int lpaopen(),lpaclose(),lpawrite(),lpaioctl(); #if NSPEAKER > 0 int spkropen(),spkrclose(),spkrwrite(),spkrioctl(); #else -#define spkropen enxio -#define spkrclose enxio -#define spkrwrite enxio -#define spkrioctl enxio +#define spkropen enxio +#define spkrclose enxio +#define spkrwrite enxio +#define spkrioctl enxio +#endif + +#include "mse.h" +#if NMSE > 0 +int mseopen(),mseclose(),mseread(),mseselect(); +#else +#define mseopen enxio +#define mseclose enxio +#define mseread enxio +#define mseselect enxio +#endif + +#include "sio.h" +#if NSIO > 0 +int sioopen(),sioclose(),sioread(),siowrite(),sioioctl(),sioselect(), + siostop(); +#define sioreset enxio +extern struct tty sio_tty[]; +#else +#define sioopen enxio +#define sioclose enxio +#define sioread enxio +#define siowrite enxio +#define sioioctl enxio +#define siostop enxio +#define sioreset enxio +#define sioselect enxio +#define sio_tty NULL #endif struct cdevsw cdevsw[] = @@ -345,7 +402,7 @@ struct cdevsw cdevsw[] = enodev, enodev, nullop, NULL, seltrue, enodev, enodev }, { pcopen, pcclose, pcread, pcwrite, /*12*/ - pcioctl, nullop, nullop, &pccons, /* vga */ + pcioctl, nullop, nullop, &pccons, /* pc */ ttselect, pcmmap, NULL }, #if NSD > 0 { sdopen, sdclose, rawread, rawwrite, /*13*/ @@ -371,15 +428,15 @@ struct cdevsw cdevsw[] = { enxio, enxio, enxio, enxio, /*18*/ enxio, enxio, enxio, NULL, /* scsi generic */ enxio, enxio, enxio }, - { enxio, enxio, enxio, enxio, /*19*/ - enxio, enxio, enxio, NULL, /* xten power ctrlr*/ - enxio, enxio, enxio }, + { twopen, twclose, twread, twwrite, /*19*/ + enodev, nullop, nullop, NULL, /* tw */ + twselect, enodev, enodev }, { enxio, enxio, enxio, enxio, /*20*/ enxio, enxio, enxio, NULL, /* soundblaster?*/ enxio, enxio, enxio }, - { enxio, enxio, enxio, enxio, /*21*/ - enxio, enxio, enxio, NULL, /* codrv */ - enxio, enxio, enxio }, + { coopen, coclose, coread, enxio, /*21*/ + coioctl, nullop, nullop, NULL, /* co */ + coselect, comap, NULL }, { fdopen, enxio, enxio, enxio, /*22*/ enxio, enxio, enxio, NULL, /* fd (!=Fd) */ enxio, enxio, enxio }, @@ -395,6 +452,12 @@ struct cdevsw cdevsw[] = { spkropen, spkrclose, enxio, spkrwrite, /*26*/ spkrioctl, enxio, enxio, NULL, /* spkr */ enxio, enxio, enxio }, + { mseopen, mseclose, mseread, nullop, /*27*/ + nullop, enodev, nullop, NULL, /* mse */ + mseselect, enodev, NULL }, + { sioopen, sioclose, sioread, siowrite, /*28*/ + sioioctl, siostop, sioreset, sio_tty, /* sio */ + sioselect, enodev, NULL }, /* * If you need a cdev major number, please contact the 386bsd patchkit * coordinator by sending mail to "patches@cs.montana.edu". -- 2.20.1