Added config parameter to set up advanced PCI options as comma-separated

values. Now it is possible to disable ACPI or HPET in case the i440FX chipset
is selected.
This commit is contained in:
Volker Ruppert 2020-12-04 17:04:40 +00:00
parent 6692664a3b
commit c12c8324dc
9 changed files with 137 additions and 39 deletions

View File

@ -538,19 +538,35 @@ mouse: enabled=0
#=======================================================================
# PCI:
# This option controls the presence of a PCI chipset in Bochs. Currently it
# supports the i430FX, i440FX and i440BX chipsets. You can also specify the
# devices connected to PCI slots. Up to 5 slots are available. For these
# combined PCI/ISA devices assigning to slot is mandatory if you want to emulate
# the PCI model: cirrus, ne2k and pcivga. These PCI-only devices are also
# supported, but they are auto-assigned if you don't use the slot configuration:
# e1000, es1370, pcidev, pcipnic, usb_ehci, usb_ohci, usb_xhci and voodoo.
# All device models except the network devices ne2k and e1000 can be used only
# once in the slot configuration. In case of the i440BX chipset, slot #5 is the
# AGP slot. Currently only the 'voodoo' device can be assigned to AGP.
# This defines the parameters to set up the Bochs PCI emulation:
#
# ENABLED:
# If Bochs is compiled with PCI support, it is enabled by default.
#
# CHIPSET:
# Currently the chipsets i430FX, i440FX and i440BX (limited) are supported and
# the default is i440FX.
#
# SLOTx:
# It is possible to specify the devices connected to PCI slots. Up to 5 slots
# are available. For combined PCI/ISA devices assigning to slot is mandatory
# if the PCI model should be emulated (cirrus, ne2k and pcivga). Setting up
# slot for PCI-only devices is also supported, but they are auto-assigned if
# not specified (e1000, es1370, pcidev, pcipnic, usb_ehci, usb_ohci, usb_xhci,
# voodoo). All device models except the network devices ne2k and e1000 can be
# used only once in the slot configuration. In case of the i440BX chipset, the
# slot #5 is the AGP slot. Currently only the 'voodoo' device can be assigned
# to AGP.
#
# ADVOPTS:
# With the advanced PCI options it is possible to control the behaviour of the
# PCI chipset. These options can be specified as comma-separated values.
# By default the "Bochs i440FX" chipset enables the ACPI and HPET devices, but
# original i440FX doesn't support them. The options 'noacpi' and 'nohpet' make
# it possible to disable them.
#
# Example:
# pci: enabled=1, chipset=i440fx, slot1=pcivga, slot2=ne2k
# pci: enabled=1, chipset=i440fx, slot1=pcivga, slot2=ne2k, advopts=noacpi
#=======================================================================
pci: enabled=1, chipset=i440fx

View File

@ -9,6 +9,9 @@ Changes after 2.6.11:
- CPU/CPUDB
- Bugfixes for CPU emulation correctness (CPUID/VMX initialization fixes to support Windows Hyper-V as guest in Bochs)
- Memory
- Improved BIOS write support by implementing Intel(tm) flash chip emulation.
- Bochs Debugger and Instrumentation
- Add more symbol lookups to disasm methods
@ -30,6 +33,9 @@ Changes after 2.6.11:
to VRAM are always valid. Fixes GRUB bootloader menu when using Bochs VBE.
- DDC: Added "ddc" parameter to the "vga" option to make it possible
either to disable the DDC feature or to read the monitor EDID from file.
- PCI (general)
- Added config parameter to set up advanced PCI options. Now it is possible
to disable ACPI or HPET in case the i440FX chipset is selected.
- Sound
- Added PC speaker volume control for the lowlevel sound support.

View File

@ -118,6 +118,7 @@ pci
3
4
5
advopts
pcidev
vendor
device

View File

@ -889,6 +889,10 @@ void bx_init_options()
"", BX_PATHNAME_LEN);
deplist->add(devname);
}
bx_param_string_c *advopts = new bx_param_string_c(pci, "advopts", "Advanced PCI Options",
"Set advanced PCI options",
"", BX_PATHNAME_LEN);
deplist->add(advopts);
enabled->set_dependent_list(deplist);
pci->set_options(pci->SHOW_PARENT);
slot->set_options(slot->SHOW_PARENT);
@ -2853,6 +2857,8 @@ static int parse_line_formatted(const char *context, int num_params, char *param
} else {
BX_ERROR(("%s: unknown pci slot number ignored.", context));
}
} else if (!strncmp(params[i], "advopts=", 8)) {
SIM->get_param_string(BXPN_PCI_ADV_OPTS)->set(&params[i][8]);
} else {
PARSE_ERR(("%s: pci: unknown parameter '%s'.", context, params[i]));
}

View File

@ -3985,22 +3985,44 @@ or 'f12'.
<section><title>pci</title>
<para>
This defines the parameters to set up the Bochs PCI emulation:
</para>
<para>
Examples:
<screen>
pci: enabled=1, chipset=i440fx # default if compiled with PCI support
pci: enabled=1, chipset=i440fx, slot1=pcivga, slot2=ne2k
pci: enabled=1, chipset=i440fx, slot1=pcivga, slot2=ne2k, advopts=noacpi
pci: enabled=1, chipset=i440bx, slot5=voodoo, slot1=e1000
</screen>
This option controls the presence of a PCI chipset in Bochs. Currently it
supports the i430FX, i440FX and i440BX chipsets. You can also specify the
devices connected to PCI slots. Up to 5 slots are available. For these
combined PCI/ISA devices assigning to slot is mandatory if you want to emulate
the PCI model: cirrus, ne2k and pcivga. These PCI-only devices are also
supported, but they are auto-assigned if you don't use the slot configuration:
e1000, es1370, pcidev, pcipnic, usb_ehci, usb_ohci, usb_xhci and voodoo.
All device models except the network devices ne2k and e1000 can be used only
once in the slot configuration. In case of the i440BX chipset, slot #5 is the
AGP slot. Currently only the 'voodoo' device can be assigned to AGP.
</para>
<para><command>enabled</command></para>
<para>
If Bochs is compiled with PCI support, it is enabled by default.
</para>
<para><command>chipset</command></para>
<para>
Currently the chipsets i430FX, i440FX and i440BX (limited) are supported and
the default is i440FX.
</para>
<para><command>slot<replaceable>X</replaceable></command></para>
<para>
It is possible to specify the devices connected to PCI slots. Up to 5 slots
are available. For combined PCI/ISA devices assigning to slot is mandatory
if the PCI model should be emulated (cirrus, ne2k and pcivga). Setting up
slot for PCI-only devices is also supported, but they are auto-assigned if
not specified (e1000, es1370, pcidev, pcipnic, usb_ehci, usb_ohci, usb_xhci,
voodoo). All device models except the network devices ne2k and e1000 can be
used only once in the slot configuration. In case of the i440BX chipset, the
slot #5 is the AGP slot. Currently only the 'voodoo' device can be assigned
to AGP.
</para>
<para><command>advopts</command></para>
<para>
With the advanced PCI options it is possible to control the behaviour of the
PCI chipset. These options can be specified as comma-separated values.
By default the "Bochs i440FX" chipset enables the ACPI and HPET devices, but
original i440FX doesn't support them. The options 'noacpi' and 'nohpet' make
it possible to disable them.
</para>
</section>
@ -4968,7 +4990,7 @@ Example:
usb_ohci: enabled=1, port1=printer:printdata.bin
</screen>
This option controls the presence of the USB OHCI host controller with a
2-port hub. The portX parameter accepts the same device types with the same
2-port hub. The port<replaceable>X</replaceable> parameter accepts the same device types with the same
syntax as the UHCI controller (see the <link linkend="bochsopt-usb-uhci">usb_uhci option</link>).
The optionsX parameter is also available on OHCI.</para>
</section>
@ -4980,7 +5002,7 @@ Example:
usb_ehci: enabled=1, port1=tablet, options1="speed:high"
</screen>
This option controls the presence of the USB EHCI host controller with a
6-port hub. The portX parameter accepts the same device types with the same
6-port hub. The port<replaceable>X</replaceable> parameter accepts the same device types with the same
syntax as the UHCI controller (see the <link linkend="bochsopt-usb-uhci">usb_uhci option</link>).
The optionsX parameter is also available on EHCI.</para>
</section>
@ -4992,7 +5014,7 @@ Example:
usb_xhci: enabled=1, port1="disk:usbdisk.img"
</screen>
This option controls the presence of the USB xHCI host controller with a 4-port
hub. The portX parameter accepts the same device types with the same syntax as
hub. The port<replaceable>X</replaceable> parameter accepts the same device types with the same syntax as
the UHCI controller (see the <link linkend="bochsopt-usb-uhci">usb_uhci option</link>).
The optionsX parameter is also available on xHCI. NOTE: port 1 and 2 are USB3 and
only support super-speed devices, but port 3 and 4 are USB2 and support speed

View File

@ -1,5 +1,5 @@
.\"Document Author: Timothy R. Butler - tbutler@uninetsolutions.com"
.TH bochsrc 5 "29 Nov 2020" "bochsrc" "The Bochs Project"
.TH bochsrc 5 "4 Dec 2020" "bochsrc" "The Bochs Project"
.\"SKIP_SECTION"
.SH NAME
bochsrc \- Configuration file for Bochs.
@ -595,19 +595,39 @@ Examples:
.TP
.I "pci:"
This option controls the presence of a PCI chipset in Bochs. Currently it
supports the i430FX, i440FX and i440BX chipsets. You can also specify the
devices connected to PCI slots. Up to 5 slots are available. For these
combined PCI/ISA devices assigning to slot is mandatory if you want to emulate
the PCI model: cirrus, ne2k and pcivga. These PCI-only devices are also
supported, but they are auto-assigned if you don't use the slot configuration:
e1000, es1370, pcidev, pcipnic, usb_ehci, usb_ohci, usb_xhci and voodoo.
All device models except the network devices ne2k and e1000 can be used only
# once in the slot configuration. In case of the i440BX chipset, slot #5 is the
AGP slot. Currently only the 'voodoo' device can be assigned to AGP.
This defines the parameters to set up the Bochs PCI emulation:
enabled
If Bochs is compiled with PCI support, it is enabled by default.
chipset
Currently the chipsets i430FX, i440FX and i440BX (limited) are supported and
the default is i440FX.
slotX
It is possible to specify the devices connected to PCI slots. Up to 5 slots
are available. For combined PCI/ISA devices assigning to slot is mandatory
if the PCI model should be emulated (cirrus, ne2k and pcivga). Setting up
slot for PCI-only devices is also supported, but they are auto-assigned if
not specified (e1000, es1370, pcidev, pcipnic, usb_ehci, usb_ohci, usb_xhci,
voodoo). All device models except the network devices ne2k and e1000 can be
used only once in the slot configuration. In case of the i440BX chipset, the
slot #5 is the AGP slot. Currently only the 'voodoo' device can be assigned
to AGP.
advopts
With the advanced PCI options it is possible to control the behaviour of the
PCI chipset. These options can be specified as comma-separated values.
By default the "Bochs i440FX" chipset enables the ACPI and HPET devices, but
original i440FX doesn't support them. The options 'noacpi' and 'nohpet' make
it possible to disable them.
Example:
pci: enabled=1, chipset=i440fx, slot1=pcivga, slot2=ne2k
pci: enabled=1, chipset=i440fx, slot1=pcivga, slot2=ne2k, advopts=noacpi
.TP
.I "clock:"

View File

@ -179,6 +179,28 @@ void bx_devices_c::init(BX_MEM_C *newmem)
pci.enabled = SIM->get_param_bool(BXPN_PCI_ENABLED)->get();
if (pci.enabled) {
#if BX_SUPPORT_PCI
if (chipset == BX_PCI_CHIPSET_I430FX) {
pci.advopts = (BX_PCI_ADVOPT_NOHPET | BX_PCI_ADVOPT_NOACPI);
} else {
pci.advopts = 0;
}
options = SIM->get_param_string(BXPN_PCI_ADV_OPTS)->getptr();
argc = bx_split_option_list("PCI advanced options", options, argv, 16);
for (i = 0; i < argc; i++) {
if (!strcmp(argv[i], "noacpi")) {
if (chipset == BX_PCI_CHIPSET_I440FX) {
pci.advopts = BX_PCI_ADVOPT_NOACPI;
} else {
BX_ERROR(("Disabling ACPI not supported by PCI chipset"));
}
} else if (!strcmp(argv[i], "nohpet")) {
pci.advopts = BX_PCI_ADVOPT_NOHPET;
} else {
BX_ERROR(("Unknown advanced PCI option '%s'", argv[i]));
}
free(argv[i]);
argv[i] = NULL;
}
PLUG_load_plugin(pci, PLUGTYPE_CORE);
PLUG_load_plugin(pci2isa, PLUGTYPE_CORE);
#if BX_SUPPORT_PCIUSB
@ -194,10 +216,10 @@ void bx_devices_c::init(BX_MEM_C *newmem)
SIM->get_param_bool(BXPN_UHCI_ENABLED)->set(1);
}
#endif
if (chipset != BX_PCI_CHIPSET_I430FX) {
if ((pci.advopts & BX_PCI_ADVOPT_NOACPI) == 0) {
PLUG_load_plugin(acpi, PLUGTYPE_STANDARD);
}
if (chipset == BX_PCI_CHIPSET_I440FX) {
if ((pci.advopts & BX_PCI_ADVOPT_NOHPET) == 0) {
PLUG_load_plugin(hpet, PLUGTYPE_STANDARD);
}
#else

View File

@ -108,6 +108,9 @@ class cdrom_base_c;
#define BX_PCI_BAR_TYPE_MEM 1
#define BX_PCI_BAR_TYPE_IO 2
#define BX_PCI_ADVOPT_NOACPI 0x01
#define BX_PCI_ADVOPT_NOHPET 0x02
typedef struct {
Bit8u type;
Bit32u size;
@ -563,6 +566,7 @@ private:
struct {
bx_bool enabled;
#if BX_SUPPORT_PCI
Bit32u advopts;
Bit8u handler_id[0x101]; // 256 PCI devices/functions + 1 AGP device
struct {
bx_pci_device_c *handler;

View File

@ -97,6 +97,7 @@
#define BXPN_CMOSIMAGE_RTC_INIT "clock_cmos.cmosimage.rtc_init"
#define BXPN_PCI_ENABLED "pci.enabled"
#define BXPN_PCI_CHIPSET "pci.chipset"
#define BXPN_PCI_ADV_OPTS "pci.advopts"
#define BXPN_PCIDEV_VENDOR "pci.pcidev.vendor"
#define BXPN_PCIDEV_DEVICE "pci.pcidev.device"
#define BXPN_SEL_DISPLAY_LIBRARY "display.display_library"