From: Alan Cox Date: Wed, 10 Dec 2014 23:23:49 +0000 (+0000) Subject: zx128: put devices in the same order as other platforms, hook microdrive X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=32c09a392af279c243b24e590215625d7bda2478;p=FUZIX.git zx128: put devices in the same order as other platforms, hook microdrive 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 ! --- diff --git a/Kernel/platform-zx128/config.h b/Kernel/platform-zx128/config.h index cfd0cbfd..69dea05c 100644 --- a/Kernel/platform-zx128/config.h +++ b/Kernel/platform-zx128/config.h @@ -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 */ diff --git a/Kernel/platform-zx128/devices.c b/Kernel/platform-zx128/devices.c index 22c06fdb..a27e93d1 100644 --- a/Kernel/platform-zx128/devices.c +++ b/Kernel/platform-zx128/devices.c @@ -4,14 +4,19 @@ #include #include #include +#include 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 */ };