--- qemu/roms/seabios/src/boot.c 2018/04/24 17:36:47 1.1 +++ qemu/roms/seabios/src/boot.c 2018/04/24 18:27:14 1.1.1.3 @@ -22,16 +22,16 @@ struct ipl_s IPL; ****************************************************************/ void -boot_setup() +boot_setup(void) { if (! CONFIG_BOOT) return; dprintf(3, "init boot device ordering\n"); memset(&IPL, 0, sizeof(IPL)); + struct ipl_entry_s *ie = &IPL.bev[0]; // Floppy drive - struct ipl_entry_s *ie = &IPL.bev[0]; ie->type = IPL_TYPE_FLOPPY; ie->description = "Floppy"; ie++; @@ -44,11 +44,11 @@ boot_setup() // CDROM if (CONFIG_CDROM_BOOT) { ie->type = IPL_TYPE_CDROM; - ie->description = "CD-Rom"; + ie->description = "DVD/CD"; ie++; } - if (CONFIG_COREBOOT_FLASH) { + if (CONFIG_COREBOOT && CONFIG_COREBOOT_FLASH) { ie->type = IPL_TYPE_CBFS; ie->description = "CBFS"; ie++; @@ -159,9 +159,7 @@ menu_show_floppy(struct ipl_entry_s *ie, int i; for (i = 0; i < Drives.floppycount; i++) { struct drive_s *drive_g = getDrive(EXTTYPE_FLOPPY, i); - printf("%d. Floppy [", menupos + i); - describe_drive(drive_g); - printf("]\n"); + printf("%d. Floppy [%s]\n", menupos + i, drive_g->desc); } return Drives.floppycount; } @@ -173,11 +171,10 @@ menu_show_harddisk(struct ipl_entry_s *i int i; for (i = 0; i < IPL.bcvcount; i++) { struct ipl_entry_s *ie = &IPL.bcv[i]; + struct drive_s *drive_g = (void*)ie->vector; switch (ie->type) { case BCV_TYPE_INTERNAL: - printf("%d. ", menupos + i); - describe_drive((void*)ie->vector); - printf("\n"); + printf("%d. %s\n", menupos + i, drive_g->desc); break; default: menu_show_default(ie, menupos+i); @@ -194,9 +191,7 @@ menu_show_cdrom(struct ipl_entry_s *ie, int i; for (i = 0; i < Drives.cdcount; i++) { struct drive_s *drive_g = getDrive(EXTTYPE_CD, i); - printf("%d. CD-Rom [", menupos + i); - describe_drive(drive_g); - printf("]\n"); + printf("%d. DVD/CD [%s]\n", menupos + i, drive_g->desc); } return Drives.cdcount; } @@ -222,7 +217,7 @@ menu_show_cbfs(struct ipl_entry_s *ie, i // Show IPL option menu. static void -interactive_bootmenu() +interactive_bootmenu(void) { if (! CONFIG_BOOTMENU || ! qemu_cfg_show_boot_menu()) return; @@ -241,6 +236,7 @@ interactive_bootmenu() ; printf("Select boot device:\n\n"); + wait_threads(); int subcount[ARRAY_SIZE(IPL.bev)]; int menupos = 1; @@ -309,19 +305,22 @@ run_bcv(struct ipl_entry_s *ie) // Prepare for boot - show menu and run bcvs. void -boot_prep() +boot_prep(void) { - if (! CONFIG_BOOT) + if (! CONFIG_BOOT) { + wait_threads(); return; + } // XXX - show available drives? // Allow user to modify BCV/IPL order. interactive_bootmenu(); + wait_threads(); // Setup floppy boot order int override = IPL.bev[0].subchoice; - int tmp = Drives.idmap[EXTTYPE_FLOPPY][0]; + struct drive_s *tmp = Drives.idmap[EXTTYPE_FLOPPY][0]; Drives.idmap[EXTTYPE_FLOPPY][0] = Drives.idmap[EXTTYPE_FLOPPY][override]; Drives.idmap[EXTTYPE_FLOPPY][override] = tmp; @@ -346,6 +345,9 @@ call_boot_entry(u16 bootseg, u16 bootip, { dprintf(1, "Booting from %04x:%04x\n", bootseg, bootip); + /* Go back to text, the OS might expect it... (Can't do this any later) */ + disable_bootsplash(); + struct bregs br; memset(&br, 0, sizeof(br)); br.flags = F_IF; @@ -419,7 +421,7 @@ boot_cdrom(struct ipl_entry_s *ie) static void boot_cbfs(struct ipl_entry_s *ie) { - if (! CONFIG_COREBOOT_FLASH) + if (!CONFIG_COREBOOT || !CONFIG_COREBOOT_FLASH) return; int count = ie->subchoice; struct cbfs_file *file = NULL; @@ -450,7 +452,7 @@ do_boot(u16 seq_nr) printf("No bootable device.\n"); // Loop with irqs enabled - this allows ctrl+alt+delete to work. for (;;) - biosusleep(1000000); + wait_irq(); } /* Do the loading, and set up vector as a far pointer to the boot @@ -486,8 +488,8 @@ do_boot(u16 seq_nr) } // Boot Failure recovery: try the next device. -void VISIBLE32 -handle_18() +void VISIBLE32FLAT +handle_18(void) { debug_serial_setup(); debug_enter(NULL, DEBUG_HDL_18); @@ -498,8 +500,8 @@ handle_18() } // INT 19h Boot Load Service Entry Point -void VISIBLE32 -handle_19() +void VISIBLE32FLAT +handle_19(void) { debug_serial_setup(); debug_enter(NULL, DEBUG_HDL_19);