From: Will Sowerbutts Date: Sun, 22 Feb 2015 21:41:29 +0000 (+0000) Subject: p112, n8vem-mark4: Drop BOOT_TTY in favour of TTYDEV. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=b13624d8e751966c929b377da8a0b7f7649c671f;p=FUZIX.git p112, n8vem-mark4: Drop BOOT_TTY in favour of TTYDEV. --- diff --git a/Kernel/platform-n8vem-mark4/config.h b/Kernel/platform-n8vem-mark4/config.h index 43f605d9..c6699f1f 100644 --- a/Kernel/platform-n8vem-mark4/config.h +++ b/Kernel/platform-n8vem-mark4/config.h @@ -63,12 +63,10 @@ #define NUM_DEV_TTY 3 /* PropIO as the console */ - #define BOOT_TTY (512 + 3) + #define TTYDEV (512+3) /* System console (used by kernel, init) */ #else #define NUM_DEV_TTY 2 /* ASCI0 as the console */ - #define BOOT_TTY (512 + 1) + #define TTYDEV (512+1) /* System console (used by kernel, init) */ #endif - -#define TTYDEV BOOT_TTY /* Device used by kernel for messages, panics */ diff --git a/Kernel/platform-n8vem-mark4/devtty.c b/Kernel/platform-n8vem-mark4/devtty.c index 55089ed5..950bdf74 100644 --- a/Kernel/platform-n8vem-mark4/devtty.c +++ b/Kernel/platform-n8vem-mark4/devtty.c @@ -89,7 +89,7 @@ ttyready_t tty_writeready(uint8_t minor) /* kernel writes to system console -- never sleep! */ void kputchar(char c) { - tty_putc(TTYDEV - 512, c); + tty_putc(TTYDEV & 0xFF, c); if(c == '\n') - tty_putc(TTYDEV - 512, '\r'); + tty_putc(TTYDEV & 0xFF, '\r'); } diff --git a/Kernel/platform-p112/config.h b/Kernel/platform-p112/config.h index 07789f6f..5297e932 100644 --- a/Kernel/platform-p112/config.h +++ b/Kernel/platform-p112/config.h @@ -27,9 +27,6 @@ #define PROGTOP 0xF800 /* Top of program, base of U_DATA copy */ #define PROC_SIZE 64 /* Memory needed per process */ -#define BOOT_TTY (512 + 1)/* 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 */ #define CMDLINE (0x0081) /* Location of root dev name */ #define BOOTDEVICENAMES "hd#,fd" @@ -37,7 +34,7 @@ /* Device parameters */ #define NUM_DEV_TTY 5 -#define TTYDEV BOOT_TTY /* Device used by kernel for messages, panics */ +#define TTYDEV (512+1) /* System console (used by kernel, init) */ #define NBUFS 10 /* Number of block buffers */ #define NMOUNTS 4 /* Number of mounts at a time */ diff --git a/Kernel/platform-p112/devtty.c b/Kernel/platform-p112/devtty.c index 928776d2..c11c3031 100644 --- a/Kernel/platform-p112/devtty.c +++ b/Kernel/platform-p112/devtty.c @@ -116,6 +116,7 @@ void tty_pollirq_com1(void) while(true){ iir = TTY_COM1_IIR; lsr = TTY_COM1_LSR; + /* IIR bits * 3 2 1 0 * ------- @@ -300,7 +301,7 @@ void tty_putc(uint8_t minor, unsigned char c) /* kernel writes to system console -- never sleep! */ void kputchar(char c) { - tty_putc(1, c); + tty_putc(TTYDEV & 0xFF, c); if(c == '\n') - tty_putc(1, '\r'); + tty_putc(TTYDEV & 0xFF, '\r'); }