From 999422d707721ffb45ae102124adb015e174b8c8 Mon Sep 17 00:00:00 2001 From: Julian Elischer Date: Thu, 20 Apr 1995 03:18:19 +0000 Subject: Reviewed by: no-one yet, but non-intrusive Submitted by: julian@tfs.com Obtained from: written from scratch slight changes to make space for devfs.. (also conditional test code in i386/isa/fd.c) =================================================================== RCS file: /home/ncvs/src/sys/sys/malloc.h,v retrieving revision 1.7 diff -r1.7 malloc.h 113a114,117 > #define M_DEVFSMNT 62 /* DEVFS mount structure */ > #define M_DEVFSBACK 63 /* DEVFS Back node */ > #define M_DEVFSFRONT 64 /* DEVFS Front node */ > #define M_DEVFSNODE 65 /* DEVFS node */ 184c188,192 < NULL, NULL, NULL, NULL, NULL, \ --- > "DEVFS mount", /* 62 M_DEVFSMNT */ \ > "DEVFS back", /* 63 M_DEVFSBACK */ \ > "DEVFS front", /* 64 M_DEVFSFRONT */ \ > "DEVFS node", /* 65 M_DEVFSNODE */ \ > NULL, \ Index: sys/mount.h =================================================================== RCS file: /home/ncvs/src/sys/sys/mount.h,v retrieving revision 1.16 diff -r1.16 mount.h 100c100,101 < #define MOUNT_MAXTYPE 15 --- > #define MOUNT_DEVFS 16 /* existing device Filesystem */ > #define MOUNT_MAXTYPE 16 118a120 > "devfs", /* 15 MOUNT_DEVFS */ \ Index: sys/vnode.h =================================================================== RCS file: /home/ncvs/src/sys/sys/vnode.h,v retrieving revision 1.19 diff -r1.19 vnode.h 61c61 < VT_UNION, VT_MSDOSFS --- > VT_UNION, VT_MSDOSFS, VT_DEVFS --- sys/dev/fdc/fdc.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'sys/dev/fdc') diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index e755f5666d1e..e573e83a81b9 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -43,7 +43,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.56 1995/04/06 07:20:15 rgrimes Exp $ + * $Id: fd.c,v 1.57 1995/04/12 20:47:41 wollman Exp $ * */ @@ -558,6 +558,10 @@ fdattach(struct isa_device *dev) int fdsu, st0, st3, i, unithasfd; struct isa_device *fdup; int ic_type = 0; +#ifdef DEVFS + char name[64]; + caddr_t key; +#endif /* DEVFS */ fdc->fdcu = fdcu; fdc->flags |= FDC_ATTACHED; @@ -702,37 +706,61 @@ fdattach(struct isa_device *dev) fd->type = FD_1200; kdc_fd[fdu].kdc_description = "1.2MB (1200K) 5.25in floppy disk drive"; +#ifdef DEVFS + sprintf(name,"fd%d.1200",fdu); +#endif /* DEVFS */ break; case RTCFDT_144M: printf("1.44MB 3.5in\n"); fd->type = FD_1440; kdc_fd[fdu].kdc_description = "1.44MB (1440K) 3.5in floppy disk drive"; +#ifdef DEVFS + sprintf(name,"fd%d.1440",fdu); +#endif /* DEVFS */ break; case RTCFDT_288M: printf("2.88MB 3.5in - 1.44MB mode\n"); fd->type = FD_1440; kdc_fd[fdu].kdc_description = "2.88MB (2880K) 3.5in floppy disk drive in 1.44 mode"; +#ifdef DEVFS + sprintf(name,"fd%d.1440",fdu); +#endif /* DEVFS */ break; case RTCFDT_360K: printf("360KB 5.25in\n"); fd->type = FD_360; kdc_fd[fdu].kdc_description = "360KB 5.25in floppy disk drive"; +#ifdef DEVFS + sprintf(name,"fd%d.360",fdu); +#endif /* DEVFS */ break; case RTCFDT_720K: printf("720KB 3.5in\n"); fd->type = FD_720; kdc_fd[fdu].kdc_description = "720KB 3.5in floppy disk drive"; +#ifdef DEVFS + sprintf(name,"fd%d.720",fdu); +#endif /* DEVFS */ break; default: printf("unknown\n"); fd->type = NO_TYPE; +#ifdef DEVFS + sprintf(name,"fd%d.xxxx",fdu); +#endif /* DEVFS */ break; } kdc_fd[fdu].kdc_state = DC_IDLE; +#ifdef DEVFS + key = dev_add("/disks/rfloppy",name,(caddr_t)Fdopen,fdu * 8, + 0,0,0,0644); + key = dev_add("/disks/floppy",name,(caddr_t)Fdopen,fdu * 8, + 1,0,0,0644); +#endif /* DEVFS */ if (dk_ndrive < DK_NDRIVE) { sprintf(dk_names[dk_ndrive], "fd%d", fdu); fd->dkunit = dk_ndrive++; -- cgit v1.3