Implemented Bochs BIOS option "fastboot" for skipping the boot menu delay.
Prepared "biosdetect" option in the harddrv code. TODO #1: Add support for a comma-separated list of BIOS options. TODO #2: Implement support for at least "biosdetect=none" in the Bochs BIOS.
This commit is contained in:
parent
90dc39eda7
commit
a53b99f5e1
@ -363,8 +363,10 @@ memory: guest=512, host=256
|
||||
# The usage of external large BIOS images (up to 512k) at memory top is
|
||||
# now supported, but we still recommend to use the BIOS distributed with Bochs.
|
||||
# The start address is optional, since it can be calculated from image size.
|
||||
# The Bochs BIOS currently supports only the option "fastboot" to skip the
|
||||
# boot menu delay.
|
||||
#=======================================================================
|
||||
romimage: file=$BXSHARE/BIOS-bochs-latest
|
||||
romimage: file=$BXSHARE/BIOS-bochs-latest, options=fastboot
|
||||
#romimage: file=$BXSHARE/bios.bin-1.7.5 # http://www.seabios.org/SeaBIOS
|
||||
#romimage: file=mybios.bin, address=0xfff80000 # 512k at memory top
|
||||
|
||||
@ -673,7 +675,7 @@ ata3: enabled=0, ioaddr1=0x168, ioaddr2=0x360, irq=9
|
||||
# heads= only valid for disks
|
||||
# spt= only valid for disks
|
||||
# status= only valid for cdroms [inserted|ejected]
|
||||
# biosdetect= type of biosdetection [none|auto], only for disks on ata0 [cmos]
|
||||
# biosdetect= type of biosdetection [auto|cmos|none]
|
||||
# translation=type of translation of the bios, only for disks [none|lba|large|rechs|auto]
|
||||
# model= string returned by identify device command
|
||||
# journal= optional filename of the redolog for undoable, volatile and vvfat disks
|
||||
|
@ -48,6 +48,8 @@ Changes after 2.6.8 release:
|
||||
- USB printer: added support for changing output file at runtime.
|
||||
- Added common USB device option "debug" to turn on BX_DEBUG reporting at
|
||||
connection time.
|
||||
- ROM BIOS
|
||||
- Implemented Bochs BIOS option "fastboot" for skipping the boot menu delay.
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
Changes in 2.6.8 (May 3, 2015):
|
||||
|
@ -2096,6 +2096,9 @@ interactive_bootkey()
|
||||
while (check_for_keystroke())
|
||||
get_keystroke();
|
||||
|
||||
if ((inb_cmos(0x3f) & 0x01) == 0x01) /* check for 'fastboot' option */
|
||||
return;
|
||||
|
||||
printf("Press F12 for boot menu.\n\n");
|
||||
|
||||
delay_ticks_and_check_for_keystroke(11, 5); /* ~3 seconds */
|
||||
@ -7536,7 +7539,7 @@ BX_DEBUG_INT13_FL("floppy f00\n");
|
||||
SET_CF();
|
||||
return;
|
||||
} else {
|
||||
BX_PANIC("int13_diskette_function: read error\n");
|
||||
BX_PANIC("int13_diskette_function: write error\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1395,7 +1395,7 @@ void bx_init_options()
|
||||
"Generic 1234", 41);
|
||||
model->set_ask_format("Enter new model name: [%s]");
|
||||
|
||||
static const char *atadevice_biosdetect_names[] = { "none", "auto", "cmos", NULL };
|
||||
static const char *atadevice_biosdetect_names[] = { "auto", "cmos", "none", NULL };
|
||||
|
||||
bx_param_enum_c *biosdetect = new bx_param_enum_c(menu,
|
||||
"biosdetect",
|
||||
@ -1403,7 +1403,7 @@ void bx_init_options()
|
||||
"Type of bios detection",
|
||||
atadevice_biosdetect_names,
|
||||
BX_ATA_BIOSDETECT_AUTO,
|
||||
BX_ATA_BIOSDETECT_NONE);
|
||||
BX_ATA_BIOSDETECT_AUTO);
|
||||
biosdetect->set_ask_format("Enter bios detection type: [%s]");
|
||||
|
||||
static const char *atadevice_translation_names[] = { "none", "lba", "large", "rechs", "auto", NULL };
|
||||
|
@ -993,10 +993,25 @@ LOC NOTES MEANING
|
||||
|
||||
0x3a S ata translation policy - ata2 + ata3 (see above)
|
||||
|
||||
0x3b S ata biosdetect flags - ata0 + ata1 (unimplemented)
|
||||
bits
|
||||
1-0 ata0-master (0: auto, 1: cmos, 2: none)
|
||||
3-2 ata0-slave
|
||||
5-4 ata1-master
|
||||
7-6 ata1-slave
|
||||
|
||||
0x3c S ata biosdetect flags - ata2 + ata3 (unimplemented)
|
||||
|
||||
0x3d S eltorito boot sequence (see above)
|
||||
bits
|
||||
3-0 boot drive #1
|
||||
7-4 boot drive #2
|
||||
|
||||
0x3f S BIOS options
|
||||
bits
|
||||
0 fastboot (skip boot menu delay)
|
||||
7-1 reserved
|
||||
|
||||
0x5b S extra memory above 4GB
|
||||
0x5c S extra memory above 4GB
|
||||
0x5d S extra memory above 4GB
|
||||
|
@ -3671,7 +3671,6 @@ Examples:
|
||||
romimage: file=bios/BIOS-bochs-latest, address=0xfffe0000
|
||||
romimage: file=$BXSHARE/BIOS-bochs-legacy, address=0xffff0000
|
||||
romimage: file=mybios.bin, address=0xfff80000
|
||||
romimage: file=mybios.bin
|
||||
</screen>
|
||||
The ROM BIOS controls what the PC does when it first powers on. Normally, you
|
||||
can use a precompiled BIOS in the source or binary distribution called
|
||||
@ -3683,6 +3682,8 @@ You can use the environment variable $BXSHARE to specify the location of the BIO
|
||||
The usage of external large BIOS images (up to 512k) at memory top is
|
||||
now supported, but we still recommend to use the BIOS distributed with Bochs.
|
||||
The start address is optional, since it can be calculated from image size.
|
||||
The Bochs BIOS currently supports only the option "fastboot" to skip the
|
||||
boot menu delay.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@ -4071,7 +4072,7 @@ This defines the type and characteristics of all attached ata devices:
|
||||
<row> <entry> heads </entry> <entry> only valid for disks </entry> </row>
|
||||
<row> <entry> spt </entry> <entry> only valid for disks </entry> </row>
|
||||
<row> <entry> status </entry> <entry> only valid for cdroms </entry> <entry> [inserted | ejected] </entry> </row>
|
||||
<row> <entry> biosdetect </entry> <entry> type of biosdetection </entry> <entry> [none | auto], only for disks on ata0 [cmos] </entry> </row>
|
||||
<row> <entry> biosdetect </entry> <entry> type of biosdetection </entry> <entry> [auto | cmos | none] </entry> </row>
|
||||
<row> <entry> translation </entry> <entry> type of translation done by the BIOS (legacy int13), only for disks </entry> <entry> [none | lba | large | rechs | auto] </entry> </row>
|
||||
<row> <entry> model </entry> <entry> string returned by identify device ATA command </entry> </row>
|
||||
<row> <entry> journal </entry> <entry> optional filename of the redolog for undoable, volatile and vvfat disks </entry> </row>
|
||||
|
@ -1,5 +1,5 @@
|
||||
.\"Document Author: Timothy R. Butler - tbutler@uninetsolutions.com"
|
||||
.TH bochsrc 5 "9 Feb 2017" "bochsrc" "The Bochs Project"
|
||||
.TH bochsrc 5 "16 Feb 2017" "bochsrc" "The Bochs Project"
|
||||
.\"SKIP_SECTION"
|
||||
.SH NAME
|
||||
bochsrc \- Configuration file for Bochs.
|
||||
@ -419,12 +419,13 @@ You can use the environment variable $BXSHARE to specify the location of the BIO
|
||||
The usage of external large BIOS images (up to 512k) at memory top is
|
||||
now supported, but we still recommend to use the BIOS distributed with Bochs.
|
||||
The start address is optional, since it can be calculated from image size.
|
||||
The Bochs BIOS currently supports only the option "fastboot" to skip the
|
||||
boot menu delay.
|
||||
|
||||
Examples:
|
||||
romimage: file=bios/BIOS-bochs-latest
|
||||
romimage: file=bios/BIOS-bochs-latest, options=fastboot
|
||||
romimage: file=$BXSHARE/BIOS-bochs-legacy
|
||||
romimage: file=mybios.bin, address=0xfff80000
|
||||
romimage: file=mybios.bin
|
||||
|
||||
.TP
|
||||
.I "vgaromimage:"
|
||||
@ -714,7 +715,7 @@ This defines the type and characteristics of all attached ata devices:
|
||||
heads= only valid for disks
|
||||
spt= only valid for disks
|
||||
status= only valid for cdroms [inserted|ejected]
|
||||
biosdetect= type of biosdetection [none|auto], only for disks on ata0 [cmos]
|
||||
biosdetect= type of biosdetection [auto|cmos|none]
|
||||
translation=type of translation of the bios, only for disks [none|lba|large|rechs|auto]
|
||||
model= string returned by identify device command
|
||||
journal= optional filename of the redolog for undoable, volatile and vvfat disks
|
||||
|
@ -530,9 +530,9 @@ enum {
|
||||
#define BX_ATA_DEVICE_DISK 1
|
||||
#define BX_ATA_DEVICE_CDROM 2
|
||||
|
||||
#define BX_ATA_BIOSDETECT_NONE 0
|
||||
#define BX_ATA_BIOSDETECT_AUTO 1
|
||||
#define BX_ATA_BIOSDETECT_CMOS 2
|
||||
#define BX_ATA_BIOSDETECT_AUTO 0
|
||||
#define BX_ATA_BIOSDETECT_CMOS 1
|
||||
#define BX_ATA_BIOSDETECT_NONE 2
|
||||
|
||||
enum {
|
||||
BX_ATA_TRANSLATION_NONE,
|
||||
|
@ -2,7 +2,7 @@
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002-2016 The Bochs Project
|
||||
// Copyright (C) 2002-2017 The Bochs Project
|
||||
//
|
||||
// I/O port handlers API Copyright (C) 2003 by Frank Cornelis
|
||||
//
|
||||
@ -294,6 +294,11 @@ void bx_devices_c::init(BX_MEM_C *newmem)
|
||||
DEV_cmos_set_reg(0x5d, memory_above_4gb >> 32);
|
||||
}
|
||||
|
||||
// TODO: add support for a comma-separated list of BIOS options
|
||||
if (!strcmp(SIM->get_param_string(BXPN_ROM_OPTIONS)->getptr(), "fastboot")) {
|
||||
DEV_cmos_set_reg(0x3f, 0x01);
|
||||
}
|
||||
|
||||
if (timer_handle != BX_NULL_TIMER_HANDLE) {
|
||||
timer_handle = bx_pc_system.register_timer(this, timer_handler,
|
||||
(unsigned) BX_IODEV_HANDLER_PERIOD, 1, 1, "devices.cc");
|
||||
|
@ -493,8 +493,10 @@ void bx_hard_drive_c::init(void)
|
||||
Bit16u heads = BX_DRIVE(channel,device).hdimage->heads;
|
||||
Bit16u spt = BX_DRIVE(channel,device).hdimage->spt;
|
||||
Bit8u translation = SIM->get_param_enum("translation", base)->get();
|
||||
Bit8u bd = (SIM->get_param_enum("biosdetect", base)->get() & 0x03);
|
||||
|
||||
Bit8u reg = 0x39 + channel/2;
|
||||
Bit8u treg = 0x39 + channel/2;
|
||||
Bit8u breg = 0x3b + channel/2;
|
||||
Bit8u bitshift = 2 * (device+(2 * (channel%2)));
|
||||
|
||||
// Find the right translation if autodetect
|
||||
@ -523,18 +525,20 @@ void bx_hard_drive_c::init(void)
|
||||
|
||||
switch(translation) {
|
||||
case BX_ATA_TRANSLATION_NONE:
|
||||
DEV_cmos_set_reg(reg, DEV_cmos_get_reg(reg) | (0 << bitshift));
|
||||
DEV_cmos_set_reg(treg, DEV_cmos_get_reg(treg) | (0 << bitshift));
|
||||
break;
|
||||
case BX_ATA_TRANSLATION_LBA:
|
||||
DEV_cmos_set_reg(reg, DEV_cmos_get_reg(reg) | (1 << bitshift));
|
||||
DEV_cmos_set_reg(treg, DEV_cmos_get_reg(treg) | (1 << bitshift));
|
||||
break;
|
||||
case BX_ATA_TRANSLATION_LARGE:
|
||||
DEV_cmos_set_reg(reg, DEV_cmos_get_reg(reg) | (2 << bitshift));
|
||||
DEV_cmos_set_reg(treg, DEV_cmos_get_reg(treg) | (2 << bitshift));
|
||||
break;
|
||||
case BX_ATA_TRANSLATION_RECHS:
|
||||
DEV_cmos_set_reg(reg, DEV_cmos_get_reg(reg) | (3 << bitshift));
|
||||
DEV_cmos_set_reg(treg, DEV_cmos_get_reg(treg) | (3 << bitshift));
|
||||
break;
|
||||
}
|
||||
// TODO: biosdetect flag not yet handled by Bochs BIOS
|
||||
DEV_cmos_set_reg(breg, DEV_cmos_get_reg(breg) | (bd << bitshift));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user