pcw8256: resync with the core updates
authorAlan Cox <alan@etchedpixels.co.uk>
Fri, 31 Oct 2014 17:07:28 +0000 (17:07 +0000)
committerAlan Cox <alan@etchedpixels.co.uk>
Fri, 31 Oct 2014 17:07:28 +0000 (17:07 +0000)
Kernel/Makefile
Kernel/platform-pcw8256/config.h
Kernel/platform-pcw8256/crt0.s
Kernel/platform-pcw8256/devices.c
Kernel/platform-pcw8256/devtty.c
Kernel/platform-pcw8256/devtty.h

index e2c0e5d..493b111 100644 (file)
@@ -1,6 +1,6 @@
 TARGET_LIST = platform-nc100 platform-micropack platform-pcw8256 platform-socz80 platform-spec3 platform-trs80 platform-z80pack platform-z80pack-lite 
 
-export TARGET= z80pack
+export TARGET= pcw8256
 export CPU = z80
 #export TARGET = 6809test
 #export CPU = 6809
index a1aa984..6305948 100644 (file)
@@ -15,6 +15,8 @@
 #define MAX_MAPS 16
 #define MAX_SWAPS 16
 
+#define CONFIG_BANKS   4       /* 4 banks 16K page size */
+
 /* VT layer required */
 #define CONFIG_VT
 /* We want the 8x8 font */
index 67616cb..0cd6a89 100644 (file)
@@ -4,6 +4,7 @@
                ; when they are first seen.     
                .area _CODE
                .area _CODE2
+               .area _DISCARD
                .area _CONST
                .area _DATA
                .area _INITIALIZED
index d54c4dd..50d4a56 100644 (file)
@@ -2,10 +2,7 @@
 #include <version.h>
 #include <kdata.h>
 #include <devfd.h>
-#include <devmem.h>
-#include <devzero.h>
-#include <devnull.h>
-#include <devproc.h>
+#include <devsys.h>
 #include <devlpr.h>
 #include <tty.h>
 #include <devtty.h>
@@ -14,51 +11,31 @@ struct devsw dev_tab[] =  /* The device driver switch table */
 {
 // minor    open         close        read      write       ioctl
 // -----------------------------------------------------------------
-  /* Floppy disk block devices  */
-  {  0,  fd_open,     no_close,    fd_read,   fd_write,   no_ioctl },   //   0   /dev/fd0
-  {  1,  fd_open,     no_close,    fd_read,   fd_write,   no_ioctl },   //   1   /dev/fd1
-  {  2,  fd_open,     no_close,    fd_read,   fd_write,   no_ioctl },   //   2   /dev/rd2
-  {  3,  fd_open,     no_close,    fd_read,   fd_write,   no_ioctl },   //   3   /dev/rd3
-
-  /* Disk devices (not all used) */
-  {  0,  fd_open,     no_close,    fd_read,   fd_write,   no_ioctl },   //   4   /dev/sd0 
-  {  1,  fd_open,     no_close,    fd_read,   fd_write,   no_ioctl },   //   5   /dev/sd1 
-  {  2,  fd_open,     no_close,    fd_read,   fd_write,   no_ioctl },   //   6   /dev/sd2 
-  {  3,  fd_open,     no_close,    fd_read,   fd_write,   no_ioctl },   //   7   /dev/sd3 
-  {  4,  fd_open,     no_close,    fd_read,   fd_write,   no_ioctl },   //   8   /dev/sd4 
-  {  5,  fd_open,     no_close,    fd_read,   fd_write,   no_ioctl },   //   9   /dev/sd5 
-  {  6,  fd_open,     no_close,    fd_read,   fd_write,   no_ioctl },   //  10   /dev/sd6 
-  {  7,  fd_open,     no_close,    fd_read,   fd_write,   no_ioctl },   //  11   /dev/sd7 
-  {  8,  fd_open,     no_close,    fd_read,   fd_write,   no_ioctl },   //  12   /dev/sd8 
-  {  9,  fd_open,     no_close,    fd_read,   fd_write,   no_ioctl },   //  13   /dev/sd9 
-  { 10,  fd_open,     no_close,    fd_read,   fd_write,   no_ioctl },   //  14   /dev/sd10
-  { 11,  fd_open,     no_close,    fd_read,   fd_write,   no_ioctl },   //  15   /dev/sd11
-
-  /* devices below here are not mountable (as per NDEVS) */
-  {  0, lpr_open,     lpr_close,   no_rdwr,   lpr_write,  no_ioctl  },  //  16   /dev/lp  
-  {  0, tty_open,     tty_close,   tty_read,  tty_write,  tty_ioctl },  //  17   /dev/tty
-  {  1, tty_open,     tty_close,   tty_read,  tty_write,  tty_ioctl },  //  18   /dev/tty1
-  {  2, tty_open,     tty_close,   tty_read,  tty_write,  tty_ioctl },  //  19   /dev/tty2
-  {  3, tty_open,     tty_close,   tty_read,  tty_write,  tty_ioctl },  //  20   /dev/tty3
-  {  4, tty_open,     tty_close,   tty_read,  tty_write,  tty_ioctl },  //  21   /dev/tty4
-  {  0, no_open,      no_close,    null_read, null_write, no_ioctl  },  //  22   /dev/null
-  {  0, no_open,      no_close,    zero_read, no_rdwr,    no_ioctl  },  //  23   /dev/zero
-  {  0, no_open,      no_close,    mem_read,  mem_write,  no_ioctl  },  //  24   /dev/kmem
-  {  0, no_open,      no_close,    proc_read, no_rdwr, proc_ioctl}      //  25   /dev/proc
-  // {  0,  mt_open,  mt_close, mt_read,  mt_write,   nogood }          // 26 /dev/mt  
-  /* Add more tty channels here if available, incrementing minor# */
+  /* 0: /dev/fd                Floppy disc block devices  */
+  {  fd_open,     no_close,    fd_read,   fd_write,   no_ioctl },
+  /* 1: /dev/hd                Hard disc block devices (absent) */
+  {  nxio_open,     no_close,    no_rdwr,   no_rdwr,   no_ioctl },
+  /* 2: /dev/tty       TTY devices */
+  {  tty_open,     tty_close,   tty_read,  tty_write,  tty_ioctl },
+  /* 3: /dev/lpr       Printer devices */
+  {  lpr_open,     lpr_close,   no_rdwr,   lpr_write,  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 */
 };
 
-bool validdev(uint8_t dev)
+bool validdev(uint16_t dev)
 {
-    if(dev >= (sizeof(dev_tab)/sizeof(struct devsw)))
-        return false;
+    /* This is a bit uglier than needed but the right hand side is
+       a constant this way */
+    if(dev > ((sizeof(dev_tab)/sizeof(struct devsw)) << 8) + 255)
+       return false;
     else
         return true;
 }
 
 void device_init(void)
 {
-  tty_init();
+  tty_init_port();
   fd_probe();
 }
index 78a9912..55d9270 100644 (file)
@@ -80,7 +80,7 @@ static bool tty_writeready(uint8_t minor)
 
 extern void bugout(uint16_t c);
 
-void tty_putc(uint8_t minor, char c)
+void tty_putc(uint8_t minor, unsigned char c)
 {
     if (minor == 1) {
         bugout(c);
@@ -107,9 +107,22 @@ void tty_irq(void)
     }
 }
 
+/* Called to set baud rate etc */
+void tty_setup(uint8_t minor)
+{
+    minor;
+}
+
+/* For the moment */
+int tty_carrier(uint8_t minor)
+{
+    minor;
+    return 1;
+}
+
 /* Pending better ioctl bits set up for 9600 8N1 */
 
-void tty_init(void)
+void tty_init_port(void)
 {
     ctcmode = 0x36;
     ctc0 = 0x00;
index e219ce8..e359342 100644 (file)
@@ -3,6 +3,6 @@
 
 void tty_putc(uint8_t minor, char c);
 bool tty_writeready(uint8_t minor);
-void tty_init(void);
+void tty_init_port(void);
 void tty_irq(void);
 #endif