Date: Tue, 19 Mar 1996 23:25:43 -0500 (EST) From: "Marc G. Fournier" <scrappy@ki.net> To: current@freebsd.org Subject: PATCH: create ttyv* devices for devfs in pcvt Message-ID: <Pine.BSF.3.91.960319231835.255A-100000@ki.net>
next in thread | raw e-mail | index | archive | help
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 <sys/devfsext.h>
+ #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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.960319231835.255A-100000>
