Eric Biederman | 6aa31cc | 2003-06-10 21:22:07 +0000 | [diff] [blame] | 1 | static void outb(unsigned char value, unsigned short port) |
| 2 | { |
| 3 | __builtin_outb(value, port); |
| 4 | } |
| 5 | |
| 6 | static unsigned char inb(unsigned short port) |
| 7 | { |
| 8 | return __builtin_inb(port); |
| 9 | } |
| 10 | |
| 11 | static void __console_tx_byte(unsigned char byte) |
| 12 | { |
| 13 | while(inb(0x3f8 + 0x05)) |
| 14 | ; |
| 15 | outb(byte, 0x3f8 + 0x00); |
| 16 | } |
| 17 | |
| 18 | static void __console_tx_string(int loglevel, const char *str) |
| 19 | { |
| 20 | if (8 > loglevel) { |
| 21 | unsigned char ch; |
| 22 | while((ch = *str++) != '\0') { |
| 23 | __console_tx_byte(ch); |
| 24 | } |
| 25 | } |
| 26 | } |
| 27 | static void console_init(void) |
| 28 | { |
| 29 | static const char console_test[] = |
| 30 | "\r\n\r\nLinuxBIOS-" |
| 31 | "1.1.0" |
| 32 | ".0Fallback" |
| 33 | " " |
| 34 | "Mon Jun 9 18:15:20 MDT 2003" |
| 35 | " starting...\r\n"; |
| 36 | __console_tx_string(6, console_test); |
| 37 | } |