px4plus: Add initial (untested) video, and adjust memory maps etc
authorAlan Cox <alan@etchedpixels.co.uk>
Sat, 1 Nov 2014 15:38:06 +0000 (15:38 +0000)
committerAlan Cox <alan@etchedpixels.co.uk>
Sat, 1 Nov 2014 15:38:06 +0000 (15:38 +0000)
Add an init.c for code we can discard.

Kernel/platform-px4plus/Makefile
Kernel/platform-px4plus/config.h
Kernel/platform-px4plus/crt0.s
Kernel/platform-px4plus/devices.c
Kernel/platform-px4plus/devtty.c
Kernel/platform-px4plus/init.c [new file with mode: 0644]
Kernel/platform-px4plus/px4plus.s
Kernel/platform-px4plus/uzi.lnk

index cdbf530..068d17b 100644 (file)
@@ -1,13 +1,19 @@
 
 CSRCS = devlpr.c devtty.c devfd.c
-CSRCS += devices.c main.c
+CSRCS += devices.c
 
-ASRCS = crt0.s px4plus.s
+CCSRCS = main.c
+
+CDSRCS = init.c
+
+ASRCS = crt0.s px4plus.s video.s
 ASRCS += tricks.s commonmem.s
 
 COBJS = $(CSRCS:.c=.rel)
+CCOBJS = $(CCSRCS:.c=.rel)
+CDOBJS = $(CDSRCS:.c=.rel)
 AOBJS = $(ASRCS:.s=.rel)
-OBJS  = $(COBJS) $(AOBJS)
+OBJS  = $(COBJS) $(CCOBJS) $(CDOBJS) $(AOBJS)
 
 JUNK = $(CSRCS:.c=.lst) $(CSRCS:.c=.asm) $(CSRCS:.c=.sym) $(ASRCS:.s=.lst) $(ASRCS:.s=.sym) $(CSRCS:.c=.rst) $(ASRCS:.s=.rst)
 
@@ -16,6 +22,12 @@ all: $(OBJS)
 $(COBJS): %.rel: %.c
        $(CROSS_CC) $(CROSS_CCOPTS) -c $<
 
+$(CCOBJS): %.rel: %.c
+       $(CROSS_CC) $(CROSS_CCOPTS) -c --codeseg COMMONMEM $<
+
+$(CDOBJS): %.rel: %.c
+       $(CROSS_CC) $(CROSS_CCOPTS) -c --codeseg DISCARD $<
+
 $(AOBJS): %.rel: %.s
        $(CROSS_AS) $(ASOPTS) $<
 
index 264ad1a..bf0b80e 100644 (file)
@@ -8,6 +8,12 @@
 #define CONFIG_MULTI
 /* Single tasking */
 #undef CONFIG_SINGLETASK
+/* Video terminal, not a serial tty */
+#define CONFIG_VT
+/* We want the 8x8 font for now (actually we want 6x8) */
+#define CONFIG_FONT8X8
+/* And we only want 128 symbols of it (1K) for now */
+#define CONFIG_FONT8X8SMALL
 /* CP/M emulation */
 #undef CONFIG_CPM_EMU
 /* Fixed banking */
@@ -26,7 +32,7 @@
    timer available, so needs some tweaking */
 #define TICKSPERSEC 100   /* Ticks per second */
 #define PROGBASE    ((char *)(0x0100))  /* also data base */
-#define PROGTOP     ((char *)(0x7D00))  /* Top of program, base of U_DATA */
+#define PROGTOP     ((char *)(0x4000))  /* Top of program for debug */
 
 #define SWAP_SIZE   0x40       /* 32K in blocks (we actually don't need the low 256) */
 #define SWAPBASE    0x0000     /* We swap the lot in one, include the */
 #define NBUFS    6        /* Number of block buffers */
 #define NMOUNTS         2        /* Number of mounts at a time */
 
+#define VT_WIDTH       30
+#define VT_HEIGHT      8
+#define VT_RIGHT       29
+#define VT_BOTTOM      7
+
+
+#define PFTABSIZE      4       /* All we have room for right now */
index 30dccdb..d559e89 100644 (file)
         .area _BSEG
         .area _BSS
         .area _HEAP
-        ; note that areas below here may be overwritten by the heap at runtime, so
-        ; put initialisation stuff in here
-        .area _INITIALIZER
         .area _GSINIT
         .area _GSFINAL
 
        .area _DISCARD
        .area _UDATA
+       ; This is fixed up by the compile tool but we need it somewhere
+       ; so the copier can fix it up !
+        .area _INITIALIZER
+
+       .area _FONT
+       .area _VIDEO
 
         ; imported symbols
         .globl _fuzix_main
         .globl init_early
         .globl init_hardware
-        .globl s__INITIALIZER
-        .globl s__COMMONMEM
-        .globl l__COMMONMEM
         .globl s__DATA
         .globl l__DATA
         .globl kstack_top
index 2c00459..87a2f8b 100644 (file)
@@ -35,14 +35,6 @@ bool validdev(uint16_t dev)
         return true;
 }
 
-void device_init(void)
-{
-  int i;
-  /* Add 4 swaps (128K) to use the entire RAM drive */
-  for (i = 0; i < MAX_SWAPS; i++)
-    swapmap_add(i);
-}
-
 __sfr __at 0x19 ioctrlr;
 
 /* FIXME: find correct initial value */
index 074bfc3..16cfe7a 100644 (file)
@@ -3,6 +3,7 @@
 #include <printf.h>
 #include <stdbool.h>
 #include <tty.h>
+#include <vt.h>
 #include <devtty.h>
 
 /* Console is only port we provide, port 2 there but used for floppies */
@@ -31,8 +32,8 @@ static bool tty_writeready(uint8_t minor)
 
 void tty_putc(uint8_t minor, unsigned char c)
 {
-    minor;c;
-    /* Fixme: wire in VT code */
+    minor;
+    vtoutput(&c, 1);
 }
 
 void tty_setup(uint8_t minor)
diff --git a/Kernel/platform-px4plus/init.c b/Kernel/platform-px4plus/init.c
new file mode 100644 (file)
index 0000000..b0c4623
--- /dev/null
@@ -0,0 +1,17 @@
+#include <kernel.h>
+#include <version.h>
+#include <kdata.h>
+#include <tty.h>
+#include <devices.h>
+#include <devfd.h>
+#include <devsys.h>
+#include <devlpr.h>
+#include <devtty.h>
+
+void device_init(void)
+{
+  int i;
+  /* Add 4 swaps (128K) to use the entire RAM drive */
+  for (i = 0; i < MAX_SWAPS; i++)
+    swapmap_add(i);
+}
index c540534..6077976 100644 (file)
@@ -31,6 +31,7 @@
             ; imported symbols
             .globl _ramsize
             .globl _procmem
+           .globl _vtinit
 
            .globl unix_syscall_entry
             .globl null_handler
@@ -85,6 +86,7 @@ init_hardware:
            ld a, #0xB          ; OVF (timer), RXRDY (gapnio), 7508
            out (0x04), a
 
+           call _vtinit
             im 1 ; set CPU interrupt mode
             ret
 
index 6923d9d..0a99a7b 100644 (file)
@@ -1,9 +1,11 @@
 -mwxuy
 -i uzi.ihx
--b _DISCARD=0x5000
+-b _DISCARD=0x4000
 -b _UDATA=0xFD00
 -b _CODE=0x6000
 -b _DATA=0xE000
+-b _FONT=0x5000
+-b _INITIALIZER=0x3000
 -k /usr/share/sdcc/lib/z80
 -l z80
 platform-px4plus/crt0.rel
@@ -34,4 +36,8 @@ swap.rel
 devsys.rel
 platform-px4plus/devlpr.rel
 platform-px4plus/devtty.rel
+vt.rel
+font8x8.rel
+platform-px4plus/video.rel
+platform-px4plus/init.rel
 -e