From c9ab8cce4303e31432653f183a2b9d23ac5e2e92 Mon Sep 17 00:00:00 2001 From: Jorrit Herder Date: Fri, 5 Aug 2005 09:43:22 +0000 Subject: [PATCH] Changed minor number of /dev/zero from 6 to 5. (Make sure to update your system accordingly or /dev/zero won't work.) Cleaned up comments in MEMORY driver. --- commands/scripts/MAKEDEV.sh | 2 +- drivers/memory/memory.c | 10 +++++----- include/minix/dmap.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/commands/scripts/MAKEDEV.sh b/commands/scripts/MAKEDEV.sh index d3d34c166..2cffe30d7 100755 --- a/commands/scripts/MAKEDEV.sh +++ b/commands/scripts/MAKEDEV.sh @@ -61,7 +61,7 @@ do $e mknod kmem c 1 2; $e chmod 640 kmem $e mknod null c 1 3; $e chmod 666 null $e mknod boot b 1 4; $e chmod 600 ram - $e mknod zero c 1 6; $e chmod 644 zero + $e mknod zero c 1 5; $e chmod 644 zero $e chgrp kmem ram mem kmem null boot zero ;; fd[0-3]) diff --git a/drivers/memory/memory.c b/drivers/memory/memory.c index 7e2bd28fe..3247cebe9 100644 --- a/drivers/memory/memory.c +++ b/drivers/memory/memory.c @@ -23,7 +23,7 @@ #include "assert.h" -#define NR_DEVS 7 /* number of minor devices */ +#define NR_DEVS 6 /* number of minor devices */ PRIVATE struct device m_geom[NR_DEVS]; /* base and size of each device */ PRIVATE int m_seg[NR_DEVS]; /* segment index of each device */ @@ -72,8 +72,9 @@ PRIVATE char dev_zero[ZERO_BUF_SIZE]; *===========================================================================*/ PUBLIC void main(void) { - m_init(); /* initialize the memory driver */ - driver_task(&m_dtab); /* start driver's main loop */ +/* Main program. Initialize the memory driver and start the main loop. */ + m_init(); + driver_task(&m_dtab); } @@ -95,7 +96,6 @@ PRIVATE struct device *m_prepare(device) int device; { /* Prepare for I/O on a device: check if the minor device number is ok. */ - if (device < 0 || device >= NR_DEVS) return(NIL_DEV); m_device = device; @@ -139,7 +139,7 @@ unsigned nr_req; /* length of request vector */ if (opcode == DEV_GATHER) return(OK); /* always at EOF */ break; - /* Virtual copying. For boot device. */ + /* Virtual copying. For RAM disk, kernel memory and boot device. */ case RAM_DEV: case KMEM_DEV: case BOOT_DEV: diff --git a/include/minix/dmap.h b/include/minix/dmap.h index 1cacb17d4..5465be06f 100644 --- a/include/minix/dmap.h +++ b/include/minix/dmap.h @@ -40,7 +40,7 @@ extern struct dmap { # define KMEM_DEV 2 /* minor device for /dev/kmem */ # define NULL_DEV 3 /* minor device for /dev/null */ # define BOOT_DEV 4 /* minor device for /dev/boot */ -# define ZERO_DEV 6 /* minor device for /dev/zero */ +# define ZERO_DEV 5 /* minor device for /dev/zero */ /* Full device numbers that are special to the boot monitor and FS. */ # define DEV_RAM 0x0100 /* device number of /dev/ram */ -- 2.44.0