foo
authorJohn Tsiombikas <nuclear@member.fsf.org>
Tue, 13 Aug 2024 06:49:03 +0000 (09:49 +0300)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Tue, 13 Aug 2024 06:54:12 +0000 (09:54 +0300)
kern/src/con.c
kern/src/dbg.h
kern/src/main.c
kern/src/ser.c

index 633462e..2c2965d 100644 (file)
@@ -10,7 +10,7 @@ static struct file *devfile;
 void con_init(void)
 {
        if(!(devfile = dev_open(CONDEV, 0, O_RDWR))) {
-               panic("can't open console device %d,%d\n", CONDEV, 0);
+               //panic("can't open console device %d,%d\n", CONDEV, 0);
        }
 }
 
index 638f8ee..55896dc 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef DBG_H_
 #define DBG_H_
 
-void panic(const char *fmt, ...) __attribute__((noreturn));
+__attribute__((noreturn))
+void panic(const char *fmt, ...);
 
 #endif /* DBG_H_ */
index 9022900..b59e371 100644 (file)
@@ -13,7 +13,6 @@ void kmain(void)
        con_init();
 
        printf("eightysix kernel %s\n", VERSTR);
-       printf("foo: %04x\n", 0xabc);
 
        init_intr();
 }
index 2c6fd74..cfd28bd 100644 (file)
@@ -1,5 +1,25 @@
 #include "ser.h"
 
+#define UART1_BASE     0x3f8
+#define UART2_BASE     0x2f8
+
+#define UART_DATA      0
+#define UART_DIVLO     0
+#define UART_DIVHI     1
+#define UART_FIFO      2
+#define UART_LCTL      3
+#define UART_MCTL      4
+#define UART_LSTAT     5
+
+#define DIV_9600                       (115200 / 9600)
+#define DIV_38400                      (115200 / 38400)
+#define LCTL_8N1                       0x03
+#define LCTL_DLAB                      0x80
+#define FIFO_ENABLE_CLEAR      0x07
+#define MCTL_DTR_RTS_OUT2      0x0b
+#define LST_TRIG_EMPTY         0x20
+
+
 int ser_init(void)
 {
        return -1;      /* TODO */