$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])
#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 */
*===========================================================================*/
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);
}
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;
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:
# 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 */