diff options
author | Yinghai Lu <yinghailu@gmail.com> | 2005-01-14 21:54:16 +0000 |
---|---|---|
committer | Yinghai Lu <yinghailu@gmail.com> | 2005-01-14 21:54:16 +0000 |
commit | 688238a50c61993db8667552cdae624e73310239 (patch) | |
tree | 83900b5d768037f6f76b16b873a764ae398af767 /src/console | |
parent | 8e51b8a3723c4ef47da1eceee23ca845b6ce002f (diff) | |
download | coreboot-688238a50c61993db8667552cdae624e73310239.tar.xz |
CONFIG_PCI_ROM_RUN
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1874 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/console')
-rw-r--r-- | src/console/vga_console.c | 24 |
1 files changed, 18 insertions, 6 deletions
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 <pc80/vga.h> #include <console/console.h> -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, |