2 * Bootstrap code for the INTEL
6 #include <console/console.h>
8 #include <pc80/mc146818rtc.h>
11 static int initialized;
13 /* initialize the console */
14 void console_init(void)
16 struct console_driver *driver;
18 if (get_option("debug_level", &console_loglevel))
19 console_loglevel = DEFAULT_CONSOLE_LOGLEVEL;
21 for(driver = console_drivers; driver < econsole_drivers; driver++) {
29 static void __console_tx_byte(unsigned char byte)
31 struct console_driver *driver;
32 for(driver = console_drivers; driver < econsole_drivers; driver++) {
33 driver->tx_byte(byte);
37 void console_tx_flush(void)
39 struct console_driver *driver;
40 for(driver = console_drivers; driver < econsole_drivers; driver++) {
41 if (!driver->tx_flush)
47 void console_tx_byte(unsigned char byte)
52 __console_tx_byte('\r');
53 __console_tx_byte(byte);
56 unsigned char console_rx_byte(void)
58 struct console_driver *driver;
61 for(driver = console_drivers; driver < econsole_drivers; driver++) {
65 if (driver == econsole_drivers)
67 while (!driver->tst_byte());
68 return driver->rx_byte();
71 int console_tst_byte(void)
73 struct console_driver *driver;
76 for(driver = console_drivers; driver < econsole_drivers; driver++)
78 return driver->tst_byte();
83 * Write POST information
85 void post_code(uint8_t value)
87 #if !defined(NO_POST) || NO_POST==0
88 #if CONFIG_SERIAL_POST==1
89 printk_emerg("POST: 0x%02x\n", value);
95 /* Report a fatal error */
96 void die(const char *msg)
98 printk_emerg("%s", msg);
100 while (1); /* Halt */