summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1995-04-20 03:18:19 +0000
committerjulian <julian@FreeBSD.org>1995-04-20 03:18:19 +0000
commit266ce25fcbbdf2996fd32fc626b3cccf02ccff2f (patch)
treee7f4818ef7c815a901cb73a58287d1f8a9a2e504
parent59f6d93fbd478a4e96d6b280a877eeb9d4e2b2a9 (diff)
downloadFreeBSD-src-266ce25fcbbdf2996fd32fc626b3cccf02ccff2f.zip
FreeBSD-src-266ce25fcbbdf2996fd32fc626b3cccf02ccff2f.tar.gz
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
-rw-r--r--sys/dev/fdc/fdc.c30
-rw-r--r--sys/i386/isa/fd.c30
-rw-r--r--sys/isa/fd.c30
-rw-r--r--sys/sys/malloc.h12
-rw-r--r--sys/sys/mount.h6
-rw-r--r--sys/sys/vnode.h4
6 files changed, 103 insertions, 9 deletions
diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c
index e755f56..e573e83 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++;
diff --git a/sys/i386/isa/fd.c b/sys/i386/isa/fd.c
index e755f56..e573e83 100644
--- a/sys/i386/isa/fd.c
+++ b/sys/i386/isa/fd.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++;
diff --git a/sys/isa/fd.c b/sys/isa/fd.c
index e755f56..e573e83 100644
--- a/sys/isa/fd.c
+++ b/sys/isa/fd.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++;
diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h
index 8ef7be4..e7c96f2 100644
--- a/sys/sys/malloc.h
+++ b/sys/sys/malloc.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)malloc.h 8.3 (Berkeley) 1/12/94
- * $Id: malloc.h,v 1.6 1995/02/02 08:49:45 davidg Exp $
+ * $Id: malloc.h,v 1.7 1995/03/12 13:25:01 ugen Exp $
*/
#ifndef _SYS_MALLOC_H_
@@ -111,6 +111,10 @@
#define M_MSDOSFSMNT 59 /* MSDOSFS mount structure */
#define M_MSDOSFSNODE 60 /* MSDOSFS vnode private part */
#define M_MSDOSFSFAT 61 /* MSDOSFS file allocation table */
+#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 */
#define M_TEMP 74 /* misc temporary data buffers */
#define M_TTYS 75 /* tty data structures */
#define M_GZIP 76 /* Gzip trees */
@@ -181,7 +185,11 @@
"MSDOSFS mount",/* 59 M_MSDOSFSMNT */ \
"MSDOSFS node", /* 60 M_MSDOSFSNODE */ \
"MSDOSFS FAT", /* 61 M_MSDOSFSFAR */ \
- 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, \
NULL, NULL, NULL, NULL, NULL, \
NULL, NULL, \
"temp", /* 74 M_TEMP */ \
diff --git a/sys/sys/mount.h b/sys/sys/mount.h
index c06e737..6e68401 100644
--- a/sys/sys/mount.h
+++ b/sys/sys/mount.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)mount.h 8.13 (Berkeley) 3/27/94
- * $Id: mount.h,v 1.15 1995/03/16 20:23:48 wollman Exp $
+ * $Id: mount.h,v 1.16 1995/04/10 18:52:40 wollman Exp $
*/
#ifndef _SYS_MOUNT_H_
@@ -97,7 +97,8 @@ struct statfs {
#define MOUNT_AFS 13 /* Andrew Filesystem */
#define MOUNT_CD9660 14 /* ISO9660 (aka CDROM) Filesystem */
#define MOUNT_UNION 15 /* Union (translucent) Filesystem */
-#define MOUNT_MAXTYPE 15
+#define MOUNT_DEVFS 16 /* existing device Filesystem */
+#define MOUNT_MAXTYPE 16
#define INITMOUNTNAMES { \
"none", /* 0 MOUNT_NONE */ \
@@ -116,6 +117,7 @@ struct statfs {
"afs", /* 13 MOUNT_AFS */ \
"cd9660", /* 14 MOUNT_CD9660 */ \
"union", /* 15 MOUNT_UNION */ \
+ "devfs", /* 15 MOUNT_DEVFS */ \
0, /* 16 MOUNT_SPARE */ \
}
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index 24d0952..a56e09e 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)vnode.h 8.7 (Berkeley) 2/4/94
- * $Id: vnode.h,v 1.18 1995/03/29 05:09:44 davidg Exp $
+ * $Id: vnode.h,v 1.19 1995/04/09 06:03:33 davidg Exp $
*/
#ifndef _SYS_VNODE_H_
@@ -58,7 +58,7 @@ enum vtype { VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO, VBAD };
enum vtagtype {
VT_NON, VT_UFS, VT_NFS, VT_MFS, VT_PC, VT_LFS, VT_LOFS, VT_FDESC,
VT_PORTAL, VT_NULL, VT_UMAP, VT_KERNFS, VT_PROCFS, VT_AFS, VT_ISOFS,
- VT_UNION, VT_MSDOSFS
+ VT_UNION, VT_MSDOSFS, VT_DEVFS
};
/*
OpenPOWER on IntegriCloud