From 873a103fb71d6b7b1993a64535a7fa150317ca3c Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Sat, 7 Feb 2015 10:08:34 -0500 Subject: refactor stdio --- drivers/include/vga.h | 3 +++ drivers/tty.c | 3 +++ 2 files changed, 6 insertions(+) (limited to 'drivers') diff --git a/drivers/include/vga.h b/drivers/include/vga.h index 278601c..b83ec95 100644 --- a/drivers/include/vga.h +++ b/drivers/include/vga.h @@ -31,5 +31,8 @@ enum vga_color_t { #define VGA_MAKE_COLOR(fg, bg) (fg | bg << 4) #define VGA_MAKE_ENTRY(ch, col) (((uint16_t)ch)|((uint16_t)col<<8)) +#define VGA_RGBPACK(r, g, b) ((r << 16)|(g << 8)|(b << 0)) void vga_init(); + +void vga_drawpixel(int x, int y, uint32_t pix); diff --git a/drivers/tty.c b/drivers/tty.c index 6b83232..7bce7e7 100644 --- a/drivers/tty.c +++ b/drivers/tty.c @@ -1,4 +1,5 @@ #include +#include #include "io.h" #include "panic.h" #include "tty.h" @@ -34,6 +35,8 @@ void tty_init(void) } tty_set_color(VGA_MAKE_COLOR(VGA_LIGHT_GRAY, VGA_BLACK)); tty_clear(); + set_putchar(tty_putchar); + set_puts(tty_puts); } static void move_cursor(uint16_t cursor_idx) -- cgit v1.1