2 * Bootstrap code for the INTEL
6 #include <console/console.h>
8 #include <pc80/mc146818rtc.h>
11 /* initialize the console */
12 void console_init(void)
14 struct console_driver *driver;
15 if(get_option(&console_loglevel, "debug_level"))
16 console_loglevel=CONFIG_DEFAULT_CONSOLE_LOGLEVEL;
18 for(driver = console_drivers; driver < econsole_drivers; driver++) {
25 static void __console_tx_byte(unsigned char byte)
27 struct console_driver *driver;
28 for(driver = console_drivers; driver < econsole_drivers; driver++) {
29 driver->tx_byte(byte);
33 void console_tx_flush(void)
35 struct console_driver *driver;
36 for(driver = console_drivers; driver < econsole_drivers; driver++) {
37 if (!driver->tx_flush)
43 void console_tx_byte(unsigned char byte)
46 __console_tx_byte('\r');
47 __console_tx_byte(byte);
50 unsigned char console_rx_byte(void)
52 struct console_driver *driver;
53 for(driver = console_drivers; driver < econsole_drivers; driver++) {
57 if (driver == econsole_drivers)
59 while (!driver->tst_byte());
60 return driver->rx_byte();
63 int console_tst_byte(void)
65 struct console_driver *driver;
66 for(driver = console_drivers; driver < econsole_drivers; driver++)
68 return driver->tst_byte();
73 * Write POST information
75 void post_code(uint8_t value)
77 #if !defined(CONFIG_NO_POST) || CONFIG_NO_POST==0
78 #if CONFIG_SERIAL_POST==1
79 printk_emerg("POST: 0x%02x\n", value);
85 /* Report a fatal error */
86 void __attribute__((noreturn)) die(const char *msg)
88 printk_emerg("%s", msg);