From 688238a50c61993db8667552cdae624e73310239 Mon Sep 17 00:00:00 2001 From: Yinghai Lu Date: Fri, 14 Jan 2005 21:54:16 +0000 Subject: CONFIG_PCI_ROM_RUN git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1874 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/console/vga_console.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/console') diff --git a/src/console/vga_console.c b/src/console/vga_console.c index 8dcbe07db1..0e0b17af85 100644 --- a/src/console/vga_console.c +++ b/src/console/vga_console.c @@ -10,11 +10,15 @@ #include #include -void beep(int ms); +//extern void beep(int ms); static char *vidmem; /* The video buffer, should be replaced by symbol in ldscript.ld */ int vga_line, vga_col; +extern int vga_inited; // it will be changed in pci_rom.c + +static int vga_console_inited = 0; + #define VIDBUFFER 0xB8000; static void memsetw(void *s, int c, unsigned int n) @@ -29,7 +33,6 @@ static void memsetw(void *s, int c, unsigned int n) static void vga_init(void) { - // these are globals vga_line = 0; vga_col = 0; @@ -56,6 +59,15 @@ static void vga_scroll(void) static void vga_tx_byte(unsigned char byte) { + if (!vga_inited) { + return; + } + + if(!vga_console_inited) { + vga_init(); + vga_console_inited = 1; + } + if (byte == '\n') { vga_line++; vga_col = 0; @@ -71,8 +83,8 @@ static void vga_tx_byte(unsigned char byte) } else if (byte == '\a') { //beep - beep(500); - +// beep(500); + ; } else { vidmem[((vga_col + (vga_line *COLS)) * 2)] = byte; vidmem[((vga_col + (vga_line *COLS)) * 2) +1] = VGA_ATTR_CLR_WHT; @@ -94,8 +106,8 @@ static void vga_tx_byte(unsigned char byte) write_crtc((vga_col + (vga_line *COLS)) & 0x0ff, CRTC_CURSOR_LO); } -struct console_driver { - .init = vga_init, +static struct console_driver vga_console __console ={ + .init = 0, .tx_byte = vga_tx_byte, .rx_byte = 0, .tst_byte = 0, -- cgit v1.2.3