From owner-freebsd-current Tue Mar 19 20:28:16 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id UAA00192 for current-outgoing; Tue, 19 Mar 1996 20:28:16 -0800 (PST) Received: from ki.net (ki.net [142.77.249.8]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id UAA29941 for ; Tue, 19 Mar 1996 20:27:46 -0800 (PST) Received: (from scrappy@localhost) by ki.net (8.7.4/8.7.4) id XAA08821; Tue, 19 Mar 1996 23:25:49 -0500 (EST) Date: Tue, 19 Mar 1996 23:25:43 -0500 (EST) From: "Marc G. Fournier" To: current@freebsd.org Subject: PATCH: create ttyv* devices for devfs in pcvt 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... Came back to the office tonight figuring to clean up my mods to pcvt_drv.c, and then check out syscons.c, and figured out that syscons.c already has devfs support in it *sigh* And all that work I went to trying to figure out how to do it, and I could have just copied the syscons stuff :( Ah well, a learning experience :) Well, here is a context diff of the changes I made to pcvt_drv.c in order that the ttyv* devices get created properly in devfs, so that you can use devfs on a system with pcvt. If someone can check it over, and commit it to the tree? Or tell me I really don't know what I'm doing? *** pcvt_drv.c.orig Tue Mar 19 16:52:00 1996 --- pcvt_drv.c Tue Mar 19 23:07:24 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,177 ---- { #endif /* PCVT_NETBSD > 9 */ + #ifdef DEVFS + char dev_name[10]; + int vt; + #endif /*DEVFS*/ int i; vt_coldmalloc(); /* allocate memory for screens */ *************** *** 332,337 **** --- 342,355 ---- 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 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