zx128: put devices in the same order as other platforms, hook microdrive
authorAlan Cox <alan@linux.intel.com>
Wed, 10 Dec 2014 23:23:49 +0000 (23:23 +0000)
committerAlan Cox <alan@linux.intel.com>
Wed, 10 Dec 2014 23:23:49 +0000 (23:23 +0000)
We'll need some CONFIG options to select between Microdrive, floppy etc as
I don't think the average Russian Spectrum/Clone came with a Microdrive !

Kernel/platform-zx128/config.h
Kernel/platform-zx128/devices.c

index cfd0cbf..69dea05 100644 (file)
@@ -45,7 +45,7 @@
 #define UDATA_BLOCKS   0       /* We swap the stash not the uarea */
 #define UDATA_SWAPSIZE 0
 
-#define BOOT_TTY (1)  /* Set this to default device for stdio, stderr */
+#define BOOT_TTY (513)  /* Set this to default device for stdio, stderr */
                           /* In this case, the default is the first TTY device */
 
 /* We need a tidier way to do this from the loader */
index 22c06fd..a27e93d 100644 (file)
@@ -4,14 +4,19 @@
 #include <tty.h>
 #include <devsys.h>
 #include <devtty.h>
+#include <devmdv.h>
 
 struct devsw dev_tab[] =  /* The device driver switch table */
 {
-// minor    open         close        read      write       ioctl
-// -----------------------------------------------------------------
-  /* 0: /dev/tty       TTY devices */
+  /* 0: /dev/fd                Floppy disc block devices, or microdrive etc */
+  {  mdv_open,     mdv_close,    mdv_read,   mdv_write,   no_ioctl },
+  /* 1: /dev/hd                Hard disc block devices */
+  {  no_open,      no_close,    no_rdwr,   no_rdwr,   no_ioctl },
+  /* 2: /dev/tty       TTY devices */
   {  tty_open,     tty_close,   tty_read,  tty_write,  tty_ioctl },
-  /* 1: /dev/mem etc   System devices (one offs) */
+  /* 3: /dev/lpr       Printer devices */
+  {  no_open,     no_close,   no_rdwr,   no_rdwr,  no_ioctl  },
+  /* 4: /dev/mem etc   System devices (one offs) */
   {  no_open,      no_close,    sys_read, sys_write, sys_ioctl  },
   /* Pack to 7 with nxio if adding private devices and start at 8 */
 };