p112, n8vem-mark4: Drop BOOT_TTY in favour of TTYDEV.
authorWill Sowerbutts <will@sowerbutts.com>
Sun, 22 Feb 2015 21:41:29 +0000 (21:41 +0000)
committerWill Sowerbutts <will@sowerbutts.com>
Wed, 25 Feb 2015 23:48:07 +0000 (23:48 +0000)
Kernel/platform-n8vem-mark4/config.h
Kernel/platform-n8vem-mark4/devtty.c
Kernel/platform-p112/config.h
Kernel/platform-p112/devtty.c

index 43f605d..c6699f1 100644 (file)
        #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 */
index 55089ed..950bdf7 100644 (file)
@@ -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');
 }
index 07789f6..5297e93 100644 (file)
@@ -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 */
 
index 928776d..c11c303 100644 (file)
@@ -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');
 }