diff options
Diffstat (limited to 'kernel/kernel.c')
| -rw-r--r-- | kernel/kernel.c | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/kernel/kernel.c b/kernel/kernel.c index 098fc64..0fb337f 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -22,12 +22,13 @@ #include <stddef.h> // for built-in shell -#include "lib/buffer/ringbuffer.h" #include "task.h" -#include "video/console.h" #include "multiboot.h" #include "terminal/vt52.h" +#include "driver/console.h" + +#include "fs/fifo.h" // // The Foolish structure of Fool OS! @@ -38,15 +39,30 @@ fool_os *get_fool() { return &foolos; } +// +// +// + +// stdio init : TODO: move away! +static vt52_tty tty1; + static void put_kb(uint8_t c) { - vt52_kb(get_fool()->tty1,c); + vt52_kb(&tty1,c); } -void kernel_main(uint32_t eax,uint32_t ebx) +static void stdin_put_char(uint8_t c) { + vt52_kb(&tty1,c); +} + + +static void init_stdio() +{ + fifo in=fifo_init(1); + fifo out=fifo_init(1); // // Setup terminal output / input @@ -56,14 +72,21 @@ void kernel_main(uint32_t eax,uint32_t ebx) screen.update_cursor=update_cursor; term_in input; + input.put_char=stdin_put_char; - vt52_tty tty=vt52_init(&screen,&input); - get_fool()->tty1=&tty; + tty1=vt52_init(&screen,&input); keyboard_init(put_kb); +} + +void kernel_main(uint32_t eax,uint32_t ebx) +{ + + init_stdio(); + // // PR // |
