pentagon: bring back pieces from the pentagon1024
authorAlan Cox <alan@linux.intel.com>
Tue, 5 Mar 2019 23:06:16 +0000 (23:06 +0000)
committerAlan Cox <alan@linux.intel.com>
Tue, 5 Mar 2019 23:06:16 +0000 (23:06 +0000)
There is still much to be done to support older Pentagons but keep the tree in
sync

Kernel/platform-pentagon/Makefile
Kernel/platform-pentagon/README
Kernel/platform-pentagon/config.h
Kernel/platform-pentagon/devtty.c [deleted file]
Kernel/platform-pentagon/fuzix.lnk
Kernel/platform-pentagon/rules.mk

index 0b5adba..e6395b3 100644 (file)
@@ -1,9 +1,9 @@
-CSRCS = devtty.c devices.c main.c
+CSRCS = devices.c main.c
 CDSRCS = discard.c
 DSRCS = ../dev/devide.c ../dev/devsd.c ../dev/blkdev.c
 DDSRCS = ../dev/devide_discard.c ../dev/devsd_discard.c ../dev/mbr.c
 DZSRCS = ../dev/zx/nemoide.c ../dev/zx/zxmmc.c ../dev/zx/zxkeyboard.c
-DZSRCS += ../dev/zx/devinput.c ../dev/zx/bankbig.c
+DZSRCS += ../dev/zx/devinput.c ../dev/zx/bankbig.c ../dev/zx/zxtty.c
 DDZSRCS =
 ASRCS = crt0.s pentagon.s zxvideo.s
 ASRCS += tricks.s commonmem.s
index e69cea9..f2646bc 100644 (file)
@@ -56,14 +56,18 @@ to page 2 due to the memory manager liits.
 
 To Do:
 -      Debug the rest
--      Write SMUC and Nemo ATA driver code
+-      Write SMUC driver code
 -      Work out what we need to do for Pentagon v Scorpion etc
 -      Floppy driver
+-      Optimizations for switching (runticks expiry on non-preempt case
+       should we clear runticks - pro it gets us better perf, anti it reduces
+       responsiveness.
+-      Parent first support
+
 
 -      Why does ls /bin lose the lowest pixel row of the 'yes' command ?
        (Seems we lose the bottom line of the left most char - off by one bug
         in zxvid ?)
--      Enable interrupts during swap
 -      6 or 5bit wide fonts (42, 51 column)
 -      Optimize zxvid - especially scrolling
 -      Move vtborder to common
index 7bbd4bf..41063b2 100644 (file)
@@ -29,6 +29,8 @@
 #define CONFIG_DYNAMIC_BUFPOOL
 #define CONFIG_DYNAMIC_SWAP
 
+/* Tell the spectrum devtty layer where graphics is mapped */
+#define CONFIG_GFXBASE 0x4000
 /* Custom banking */
 
 /* A 1MB machine has 64 blocks and the kernel plus system pages eat
diff --git a/Kernel/platform-pentagon/devtty.c b/Kernel/platform-pentagon/devtty.c
deleted file mode 100644 (file)
index 61003df..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-#include <kernel.h>
-#include <kdata.h>
-#include <printf.h>
-#include <stdbool.h>
-#include <devtty.h>
-#include <keycode.h>
-#include <vt.h>
-#include <tty.h>
-#include <graphics.h>
-#include <input.h>
-#include <devinput.h>
-
-static char tbuf1[TTYSIZ];
-
-uint8_t vtattr_cap = VTA_INVERSE|VTA_FLASH|VTA_UNDERLINE;
-uint8_t vtborder;
-uint8_t curattr = 7;
-
-static tcflag_t console_mask[4] = {
-       _ISYS,
-       _OSYS,
-       _CSYS,
-       _LSYS
-};
-
-tcflag_t *termios_mask[NUM_DEV_TTY + 1] = {
-       NULL,
-       console_mask
-};
-
-
-struct s_queue ttyinq[NUM_DEV_TTY + 1] = {     /* ttyinq[0] is never used */
-       {NULL, NULL, NULL, 0, 0, 0},
-       {tbuf1, tbuf1, tbuf1, TTYSIZ, 0, TTYSIZ / 2},
-};
-
-/* tty1 is the screen */
-
-/* Output for the system console (kprintf etc) */
-void kputchar(char c)
-{
-       if (c == '\n')
-               tty_putc(0, '\r');
-       tty_putc(0, c);
-}
-
-/* Both console and debug port are always ready */
-ttyready_t tty_writeready(uint8_t minor)
-{
-       minor;
-       return TTY_READY_NOW;
-}
-
-void tty_putc(uint8_t minor, unsigned char c)
-{
-       minor;
-       vtoutput(&c, 1);
-}
-
-int tty_carrier(uint8_t minor)
-{
-       minor;
-       return 1;
-}
-
-void tty_setup(uint8_t minor, uint8_t flags)
-{
-       minor;
-}
-
-void tty_sleeping(uint8_t minor)
-{
-       minor;
-}
-
-void tty_data_consumed(uint8_t minor)
-{
-}
-
-
-/* This is used by the vt asm code, but needs to live in the kernel */
-uint16_t cursorpos;
-
-static struct display specdisplay = {
-       0,
-       256, 192,
-       256, 192,
-       0xFF, 0xFF,
-       FMT_SPECTRUM,
-       HW_UNACCEL,
-       GFX_VBLANK|GFX_MAPPABLE|GFX_TEXT,
-       0
-};
-
-static struct videomap specmap = {
-       0,
-       0,
-       0x4000,
-       6912,
-       0,
-       0,
-       0,
-       MAP_FBMEM|MAP_FBMEM_SIMPLE
-};
-
-/*
- *     Graphics ioctls. Very minimal for this platform. It's a single fixed
- *     mode with direct memory mapping.
- */
-int gfx_ioctl(uint8_t minor, uarg_t arg, char *ptr)
-{
-       if (minor != 1 || arg >> 8 != 0x03)
-               return vt_ioctl(minor, arg, ptr);
-       switch(arg) {
-       case GFXIOC_GETINFO:
-               return uput(&specdisplay, ptr, sizeof(struct display));
-       case GFXIOC_MAP:
-               return uput(&specmap, ptr, sizeof(struct videomap));
-       case GFXIOC_UNMAP:
-               return 0;
-       case GFXIOC_WAITVB:
-               /* Our system clock is vblank */
-               timer_wait++;
-               psleep(&timer_interrupt);
-               timer_wait--;
-               chksigs();
-               if (udata.u_cursig) {
-                       udata.u_error = EINTR;
-                       return -1;
-               }
-               return 0;
-       }
-       return -1;
-}
-
-void vtattr_notify(void)
-{
-       /* Attribute byte fixups: not hard as the colours map directly
-          to the spectrum ones */
-       if (vtattr & VTA_INVERSE)
-               curattr =  ((vtink & 7) << 3) | (vtpaper & 7);
-       else
-               curattr = (vtink & 7) | ((vtpaper & 7) << 3);
-       if (vtattr & VTA_FLASH)
-               curattr |= 0x80;
-       /* How to map the bright bit - we go by either */
-       if ((vtink | vtpaper) & 0x10)
-               curattr |= 0x40;
-}
index 736ab54..195c964 100644 (file)
@@ -40,7 +40,7 @@ platform-pentagon/bankbig.rel
 swap.rel
 devsys.rel
 devinput.rel
-platform-pentagon/devtty.rel
+platform-pentagon/zxtty.rel
 platform-pentagon/devide.rel
 platform-pentagon/devide_discard.rel
 platform-pentagon/devsd.rel
index 58567b3..c0539a6 100644 (file)
@@ -2,6 +2,8 @@
 #      ZX128 uses banked kernel images
 #
 CROSS_CCOPTS += --external-banker
+
+CFLAGS += -Idev/zx/
 #
 # Tell the core code we are using the banked helpers
 #