int hmain(void) { struct platform_info *pinfo = &platform_info; /* Both red and green led is already truned on at boot.S. */ do_initcall(); print_version(); if (pinfo->is_autoboot) { if (pinfo->is_autoboot(pinfo)) autoboot(); else mediaboot(); } led_off(LED_RED); if (strcmp(CONFIG_DEFAULT_CONSOLE, "none") == 0) change_console(CONFIG_STANDARD_CONSOLE); passwd_authentication(); hermit_command_loop(); }
static void armadillo8x0_setup_console(struct platform_info *pinfo) { char console[128]; int ret; int autoboot = armadillo8x0_is_autoboot(pinfo); #if defined(CONFIG_CMD_SETENV) ret = get_param_value("console", console, 128); if (ret == 0 && strcmp(console, "none") == 0) if (!autoboot) ret = 1; if (ret) #endif hsprintf(console, "%s", CONFIG_DEFAULT_CONSOLE); /* we must set up to STANDARD_CONSOLE to match our hardware. FIXME: this is redundant and just using a side effect of the function to initialize it */ change_console(CONFIG_STANDARD_CONSOLE); ret = change_console(console); if (ret && !autoboot) change_console(CONFIG_STANDARD_CONSOLE); }
/* * This routine is the bottom half of the keyboard interrupt * routine, and runs with all interrupts enabled. It does * console changing, led setting and copy_to_cooked, which can * take a reasonably long time. * * Aside from timing (which isn't really that important for * keyboard interrupts as they happen often), using the software * interrupt routines for this thing allows us to easily mask * this when we don't want any of the above to happen. Not yet * used, but this allows for easy and efficient race-condition * prevention later on. */ static void kbd_bh(void * unused) { static unsigned char old_leds = 0xff; unsigned char leds = kbd_table[fg_console].ledstate; if (leds != old_leds) { old_leds = leds; if (!send_data(0xed) || !send_data(leds)) send_data(0xf4); /* re-enable kbd if any errors */ } if (want_console >= 0) { if (want_console != fg_console) { last_console = fg_console; change_console(want_console); } want_console = -1; } poke_blanked_console(); cli(); if ((inb_p(0x64) & kbd_read_mask) == 0x01) fake_keyboard_interrupt(); sti(); }