-DSRCS = ../dev/z80pack/devlpr.c ../dev/z80pack/devtty.c ../dev/z80pack/devfd.c
-CSRCS = devices.c main.c
+DSRCS = ../dev/z80pack/devlpr.c ../dev/z80pack/devfd.c
+CSRCS = devices.c main.c devtty.c
ASRCS = crt0.s z80pack.s
ASRCS += tricks.s commonmem.s
#define CMDLINE NULL /* Location of root dev name */
/* Device parameters */
-#define NUM_DEV_TTY 3
+#define NUM_DEV_TTY 1
#define TTYDEV BOOT_TTY /* Device used by kernel for messages, panics */
#define SWAPDEV (256 + 1) /* Device for swapping. (z80pack drive J) */
-#define NBUFS 6 /* Number of block buffers */
+#define NBUFS 5 /* Number of block buffers */
#define NMOUNTS 2 /* Number of mounts at a time */
--- /dev/null
+#include <kernel.h>
+#include <kdata.h>
+#include <printf.h>
+#include <stdbool.h>
+#include <tty.h>
+#include <devtty.h>
+
+__sfr __at 0 tty1stat;
+__sfr __at 1 tty1data;
+
+char tbuf1[TTYSIZ];
+
+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 },
+};
+
+/* Write to system console */
+void kputchar(char c)
+{
+ /* handle CRLF */
+ if(c=='\n')
+ tty_putc(1, '\r');
+ tty_putc(1, c);
+}
+
+char tty_writeready(uint8_t minor)
+{
+ used(minor);
+ return 1;
+}
+
+void tty_putc(uint8_t minor, unsigned char c)
+{
+ used(minor);
+ tty1data = c;
+}
+
+void tty_sleeping(uint8_t minor)
+{
+ used(minor);
+}
+
+/* Called every timer tick */
+void tty_pollirq(void)
+{
+ unsigned char c; /* sdcc bug workaround */
+ while(tty1stat) {
+ c = tty1data;
+ tty_inproc(1, c);
+ }
+}
+
+void tty_setup(uint8_t minor)
+{
+ used(minor);
+}
+
+/* For the moment */
+int tty_carrier(uint8_t minor)
+{
+ used(minor);
+ return 1;
+}