#include "usb.h" // usb_setup
#include "smbios.h" // smbios_init
#include "paravirt.h" // qemu_cfg_port_probe
+#include "ps2port.h" // ps2port_setup
void
__set_irq(int vector, void *loc)
pci_setup();
smm_init();
- // Run vga option rom.
+ // Setup interfaces that option roms may need
pmm_setup();
pnp_setup();
- vga_setup();
+ kbd_setup();
+ mouse_setup();
+ init_bios_tables();
+
+ // Run vga option rom (if running synchronously)
+ if (!CONFIG_THREADS || !CONFIG_THREAD_OPTIONROMS)
+ vga_setup();
// Initialize hardware devices
usb_setup();
- kbd_setup();
+ ps2port_setup();
lpt_setup();
serial_setup();
- mouse_setup();
boot_setup();
drive_setup();
ata_setup();
ramdisk_setup();
- // Run option roms (non vga)
- init_bios_tables();
- wait_threads();
- optionrom_setup();
+ // Run option roms
+ if (CONFIG_THREADS && CONFIG_THREAD_OPTIONROMS) {
+ // Run option roms while hw init still in progress.
+ vga_setup();
+ optionrom_setup();
+ wait_threads();
+ } else {
+ // Wait for hw init to finish and run non-vga option roms.
+ wait_threads();
+ optionrom_setup();
+ }
// Run BCVs and show optional boot menu
boot_prep();