From owner-freebsd-current Wed Mar 20 12:19:14 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id MAA00903 for current-outgoing; Wed, 20 Mar 1996 12:19:14 -0800 (PST) Received: from ki.net (root@ki.net [142.77.249.8]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id MAA00595 for ; Wed, 20 Mar 1996 12:15:49 -0800 (PST) Received: (from scrappy@localhost) by ki.net (8.7.4/8.7.4) id PAA05142; Wed, 20 Mar 1996 15:15:23 -0500 (EST) Date: Wed, 20 Mar 1996 15:15:21 -0500 (EST) From: "Marc G. Fournier" To: current@freebsd.org Subject: DEVFS PATCH: New, more complete patch Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Hi... After making changes to a couple of things pointed out to me by Julian and by Joerg, here is a single patch against the current source tree (as of 6am this morning). to apply, cd to /usr/src/sys and run patch -p < patchfile What is changed: uses devfs_add_devswf instead of devfs_add_devsw cleaned up #ifdef indentations (was informed it is not appropriate in a kernel source There is a patch for sys/syslog.h as well, changing the path for _PATH_LOG to be /var/run/log instead of /dev/log, since its a socket, not a device (suggested by Joerg), so don't forget to recompile syslogd before rebooting with devfs mounted as /dev. Right now, my machine is running using devfs mounted onto /dev instead of the "normal /dev", and I've yet to hit a command that is missing a device (syslogd, ps, pstat, vmstat all seem to work fine). Here is what is currently supported by devfs, according to what it has probed on my machine: bpf0 ptyp9 rfd0 ttyp5 ttypt bpf1 ptypa rfd0.1440 ttyp6 ttypu bpf2 ptypb rsd0 ttyp7 ttypv bpf3 ptypc rsd0a ttyp8 ttyv0 console ptypd rsd0b ttyp9 ttyv1 drum ptype rsd0c ttypa ttyv2 fd ptypf rsd0e ttypb ttyv3 fd0 ptypg rsd0f ttypc ttyv4 fd0.1440 ptyph sd0 ttypd ttyv5 io ptypi sd0a ttype ttyv6 klog ptypj sd0b ttypf ttyv7 kmem ptypk sd0c ttypg ttyv8 lkm ptypl sd0e ttyph ttyv9 mem ptypm sd0f ttypi ttyva null ptypn spkr ttypj ttyvb ptyp0 ptypo stderr ttypk ttyvc ptyp1 ptypp stdin ttypl ttyvd ptyp2 ptypq stdout ttypm ttyve ptyp3 ptypr tty ttypn ttyvf ptyp4 ptyps ttyp0 ttypo urandom ptyp5 ptypt ttyp1 ttypp zero ptyp6 ptypu ttyp2 ttypq ptyp7 ptypv ttyp3 ttypr ptyp8 random ttyp4 ttyps ----[ cd /usr/src/sys; patch -p < ]---- *** /usr/src.orig/sys/i386/isa/pcvt/pcvt_drv.c Mon Jan 15 23:00:09 1996 --- i386/isa/pcvt/pcvt_drv.c Wed Mar 20 13:28:39 1996 *************** *** 82,87 **** --- 82,94 ---- #define EXTERN /* allocate mem */ #include "pcvt_hdr.h" /* global include */ + #ifdef DEVFS + #include + #if !defined(MAXCONS) + #define MAXCONS 16 + #endif + static void *pcvt_devfs_token[MAXCONS]; + #endif /*DEVFS*/ extern int getchar __P((void)); *************** *** 101,108 **** #if PCVT_FREEBSD > 205 static struct kern_devconf kdc_vt[]; ! static inline void ! vt_registerdev(struct isa_device *id, const char *name); static char vt_description[]; #define VT_DESCR_LEN 40 #endif /* PCVT_FREEBSD > 205 */ --- 108,114 ---- #if PCVT_FREEBSD > 205 static struct kern_devconf kdc_vt[]; ! static inline void vt_registerdev(struct isa_device *id, const char *name); static char vt_description[]; #define VT_DESCR_LEN 40 #endif /* PCVT_FREEBSD > 205 */ *************** *** 162,167 **** --- 168,176 ---- { #endif /* PCVT_NETBSD > 9 */ + #ifdef DEVFS + int vt; + #endif /*DEVFS*/ int i; vt_coldmalloc(); /* allocate memory for screens */ *************** *** 332,337 **** --- 341,354 ---- cdevsw_add(&dev, &pcdevsw, NULL); } + + #ifdef DEVFS + for(vt = 0; vt < MAXCONS; vt++) { + pcvt_devfs_token[vt] = + devfs_add_devswf(&pcdevsw, vt, + DV_CHR, 0, 0, 0600, "ttyv%n", vt ); + } + #endif DEVFS #endif /* PCVT_FREEBSD > 205 */ #if PCVT_NETBSD > 9 *** /usr/src.orig/sys/kern/subr_log.c Thu Dec 14 04:57:44 1995 --- kern/subr_log.c Wed Mar 20 13:34:12 1996 *************** *** 254,261 **** cdevsw_add(&dev,&log_cdevsw,NULL); log_devsw_installed = 1; #ifdef DEVFS ! log_devfs_token = devfs_add_devsw( ! "/", "log", &log_cdevsw, 0, DV_CHR, 0, 0, 0600); #endif } } --- 254,262 ---- cdevsw_add(&dev,&log_cdevsw,NULL); log_devsw_installed = 1; #ifdef DEVFS ! log_devfs_token = ! devfs_add_devswf(&log_cdevsw, 0, DV_CHR, 0, 0, ! 0600, "klog"); #endif } } *** /usr/src.orig/sys/sys/syslog.h Sun Aug 21 00:42:00 1994 --- sys/sys/syslog.h Wed Mar 20 13:14:04 1996 *************** *** 37,43 **** #ifndef _SYS_SYSLOG_H_ #define _SYS_SYSLOG_H_ ! #define _PATH_LOG "/dev/log" /* * priorities/facilities are encoded into a single 32-bit quantity, where the --- 37,43 ---- #ifndef _SYS_SYSLOG_H_ #define _SYS_SYSLOG_H_ ! #define _PATH_LOG "/var/run/log" /* * priorities/facilities are encoded into a single 32-bit quantity, where the *** /usr/src.orig/sys/vm/vm_swap.c Sun Mar 3 16:46:20 1996 --- vm/vm_swap.c Wed Mar 20 13:38:49 1996 *************** *** 52,57 **** --- 52,61 ---- #include #include + #ifdef DEVFS + #include + static void *drum_devfs_token; + #endif /*DEVFS*/ static void swstrategy __P((struct buf *)); *************** *** 297,302 **** --- 301,310 ---- dev = makedev(BDEV_MAJOR,0); bdevsw_add(&dev,&sw_bdevsw,NULL); sw_devsw_installed = 1; + #ifdef DEVFS + drum_devfs_token = + devfs_add_devswf(&sw_cdevsw, 0, DV_CHR, 0, 0, 0640, "drum" ); + #endif /*DEVFS*/ } } Marc G. Fournier | POP Mail Telnet Acct DNS Hosting System | WWW Services Database Services | Knowledge, Administrator | | Information and scrappy@ki.net | WWW: http://www.ki.net | Communications, Inc