VirtualBox

Changeset 155 in vbox for trunk


Ignore:
Timestamp:
Jan 18, 2007 5:41:16 PM (18 years ago)
Author:
vboxsync
Message:

Hack to allow configurable boot delay (up to 15 seconds).

Location:
trunk/src/VBox/Devices/PC
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/BIOS/logo.c

    r1 r155  
    10971097    return;
    10981098}
     1099
     1100
     1101void delay_boot(secs)
     1102  Bit16u secs;
     1103{
     1104    Bit16u i;
     1105
     1106    if (!secs)
     1107        return;
     1108
     1109    // Set PIT to 1ms ticks
     1110    wait_init();
     1111
     1112    printf("Delaying boot for %d seconds:", secs);
     1113    for (i = secs; i > 0; i--)
     1114    {
     1115        printf(" %d", i);
     1116        wait(1000);
     1117    }
     1118    printf("\n");
     1119    // Restore PIT ticks
     1120    wait_uninit();
     1121}
     1122
  • trunk/src/VBox/Devices/PC/BIOS/rombios.c

    r100 r155  
    78187818  if (read_byte(ebda_seg, &EbdaData->uForceBootDrive))
    78197819      bootseq = read_byte(ebda_seg, &EbdaData->uForceBootDrive);
     7820  /* Boot delay hack. */
     7821  if (bseqnr == 1)
     7822      delay_boot((inb_cmos(0x3c) & 0xf0) >> 4); /* Implemented in logo.c */
    78207823#endif /* VBOX */
    78217824
  • trunk/src/VBox/Devices/PC/DevPcBios.cpp

    r31 r155  
    9393    /** The DMI tables. */
    9494    uint8_t        au8DMIPage[0x1000];
    95 
     95    /** The boot countdown (in seconds). */
     96    uint8_t        uBootDelay;
    9697} DEVPCBIOS, *PDEVPCBIOS;
    9798
     
    316317    uint8_t reg38 = /* pcbiosCmosRead(pDevIns, 0x38) | */ getBiosBootCode(pData, 2) << 4;
    317318    /* This is an extension. Bochs BIOS normally supports only 3 boot devices. */
    318     uint8_t reg3c = /* pcbiosCmosRead(pDevIns, 0x3c) | */ getBiosBootCode(pData, 3);
     319    uint8_t reg3c = getBiosBootCode(pData, 3) | (pData->uBootDelay << 4);
    319320    pcbiosCmosWrite(pDevIns, 0x3d, reg3d);
    320321    pcbiosCmosWrite(pDevIns, 0x38, reg38);
     
    873874                              "LogoTime\0"
    874875                              "LogoFile\0"
    875                               "ShowBootMenu\0"))
     876                              "ShowBootMenu\0"
     877                              "DelayBoot\0"))
    876878        return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES,
    877879                                N_("Invalid configuraton for  device pcbios device"));
     
    11731175    if (pu8LanBoot)
    11741176        rc = PDMDevHlpROMRegister(pDevIns, VBOX_LANBOOT_SEG << 4, cbFileLanBoot, pu8LanBoot, "Net Boot ROM");
     1177
     1178    rc = CFGMR3QueryU8(pCfgHandle, "DelayBoot", &pData->uBootDelay);
     1179    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
     1180    {
     1181        pData->uBootDelay = 0;
     1182        rc = VINF_SUCCESS;
     1183    }
     1184    else
     1185    {
     1186        if (VBOX_FAILURE(rc))
     1187            return PDMDEV_SET_ERROR(pDevIns, rc,
     1188                                    N_("Configuration error: Querying \"DelayBoot\" as integer failed"));
     1189        if (pData->uBootDelay > 15)
     1190            pData->uBootDelay = 15;
     1191    }
    11751192
    11761193    return rc;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette