On Sun, Feb 21, 2010 at 04:18:38PM -0700, Brandon Bennett wrote:
> > On Sat, Feb 20, 2010 at 9:05 PM, Kevin O'Connor <kevin(a)koconnor.net> wrote:
> >> Should a kernel fail during boot, I'd suspect it doesn't like one of
> >> the apm/pcibios callbacks, or it doesn't like one of the
> >> smbios/mptable/acpi tables. You could try compiling the SeaBIOS code
> >> (see http://seabios.org/Download ) and increasing the debugging by
> >> modifying src/config.h. Specifically, you could increase
> >> CONFIG_DEBUG_LEVEL, and set DEBUG_HDL_pcibios32 and DEBUG_HDL_apm to
> >> 1. Also, you could try disabling some of the features to see if that
> >> prevents the fault (eg, disabling CONFIG_ACPI / CONFIG_SMBIOS /
> >> CONFIG_MPTABLE).
> >
>
> I have narrowed it down to SMBIOS. If I disable CONFIG_SMBIOS the
> image boots up fine.
Gleb, have you seen this thread?
Some of the recent changes to smbios that look like possible culprits
are:
Make SMBIOS table pass MS SVVP test
Use MaxCountCPUs during building of per cpu tables.
Add malloc_high/fseg() and rework bios table creation to use them.
There were other changes, but the comments indicate they were only
ports of changes already in bochs. I suppose it's also possible the
lack of smbios is turning off some other feature in the guest (eg,
acpi) that's the real culprit.
-Kevin
Without this BIOS fails to remap 0xf0000 memory from ROM to RAM so writes
to F-segment modify ROM content instead of memory copy. Since QEMU does
not reloads ROMs during reset on next boot modified copy of BIOS is used.
Signed-off-by: Gleb Natapov <gleb(a)redhat.com>
diff --git a/hw/piix_pci.c b/hw/piix_pci.c
index 933ad86..0bf435d 100644
--- a/hw/piix_pci.c
+++ b/hw/piix_pci.c
@@ -99,10 +99,6 @@ static void i440fx_update_memory_mappings(PCII440FXState *d)
int i, r;
uint32_t smram, addr;
- if (kvm_enabled()) {
- /* FIXME: Support remappings and protection changes. */
- return;
- }
update_pam(d, 0xf0000, 0x100000, (d->dev.config[I440FX_PAM] >> 4) & 3);
for(i = 0; i < 12; i++) {
r = (d->dev.config[(i >> 1) + (I440FX_PAM + 1)] >> ((i & 1) * 4)) & 3;
--
Gleb.
Hi Stefan,
I'm CC'ing the mailing list.
On Wed, Nov 24, 2010 at 11:45:17AM -0500, Stefan Berger wrote:
> Hi Kevin,
>
> while I am porting the BIOS code for TCG support to SeaBIOS, I am
> wondering about the following:
>
> 'When' is it recommendable to switch from 16 bit to 32bit.
To be honest, this has never really been done before in SeaBIOS, so I
think we'll have to figure this out as we go. Since you need to
access full memory, it looks like it will be required to jump into
32bit mode.
>I am
> asking because the interface I am implementing allows callers to
> pass input and output data structures using es:di and ds:si, with es
> and ds allowed to be loaded with anything possible. So my strategy
> in the Bochs BIOS was to switch to 32 bit even before calling the
> interrupt handler, there doing the case statement for branching into
> the actual functions (switch (regs->al)) and passing 32 bit pointers
> converted from es:di and ds:si to the functions doing the work and
> reading from those memory locations.
This sounds okay to me - it should be possible to implement
handle_1abb(regs) which does a call32(tcg32_1abb, regs). It's
possible to do all the pointer conversion while in 32bit mode.
>The 'thing' is also that
> several ones of the functions that can be called through the
> interrupt interface are also called from the implemented functions.
> Example:
>
> Functions A,B,C can be called via the interrupt handler.
>
> Function B also calls A.
> Function C also calls B.
This shouldn't really be an issue. The build should take care of
this.
>
> This is due to the hierarchical nature of the functions. Also, while
> for example B calls A, B fills a data structure (on the stack) that
> it passes to A. A of course can get the same data structure from the
> user calling the interrupt interface. So, by switching to 32 bit
> mode and converting to 32 bit pointers early I could previously
> avoid a lot of headaches with the segment registers in 16 bit mode
> and reading the data from wherever they may be. Would you have any
> concerns about switching to 32 bit mode early, so that the interrupt
> handler and anything subsequent runs in 32 bit mode?
I can't say for sure what will make sense without seeing the code
first, but it sounds okay to me.
-Kevin
>
> Regards,
> Stefan
>
>
>
Move most of the config settings in config.h to the Kconfig file. The
remaining settings in config.h, are mostly build related.
---
src/Kconfig | 349 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
src/config.h | 104 -----------------
2 files changed, 340 insertions(+), 113 deletions(-)
diff --git a/src/Kconfig b/src/Kconfig
index f753c63..0d99cde 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -1,15 +1,346 @@
# Kconfig SeaBIOS configuration
mainmenu "SeaBIOS Configuration"
+
+menu "General Features"
+
config COREBOOT
- bool "Configure as a coreboot payload."
- default n
+ bool "Build for coreboot"
+ default n
+ help
+ Configure as a coreboot payload.
+
+ config THREADS
+ bool "Parallelize hardware init"
+ default y
+ help
+ Support running hardware initialization in parallel.
+ config THREAD_OPTIONROMS
+ depends on THREADS
+ bool "Hardware init during option ROM execution"
+ default n
+ help
+ Allow hardware init to run in parallel with optionrom execution.
+
+ config RELOCATE_INIT
+ bool "Copy init code to high memory"
+ default y
+ help
+ Support relocating the one time initialization code to high memory.
+
+ config BOOTMENU
+ bool "Bootmenu"
+ default y
+ help
+ Support an interactive boot menu at end of post.
+ config BOOTMENU_WAIT
+ depends on BOOTMENU
+ int "Bootmenu delay"
+ default 2500
+ help
+ Amount of time (in ms) to wait at menu before selecting normal boot.
+ config BOOTSPLASH
+ depends on BOOTMENU
+ bool "Graphical boot splash screen"
+ default y
+ help
+ Support showing a graphical boot splash screen.
+
+ config COREBOOT_FLASH
+ depends on COREBOOT
+ bool "coreboot CBFS support"
+ default y
+ help
+ Support searching coreboot flash format.
+ config LZMA
+ depends on COREBOOT_FLASH
+ bool "CBFS lzma support"
+ default y
+ help
+ Support CBFS files compressed using the lzma decompression
+ algorighm.
+ config FLASH_FLOPPY
+ depends on COREBOOT_FLASH
+ bool "Floppy images in CBFS"
+ default y
+ help
+ Support floppy images in coreboot flash.
+
+endmenu
+
+menu "Hardware support"
+ config ATA
+ depends on DRIVES
+ bool "ATA controllers"
+ default y
+ help
+ Support for IDE disk code.
+ config ATA_DMA
+ depends on ATA
+ bool "ATA DMA"
+ default n
+ help
+ Detect and try to use ATA bus mastering DMA controllers.
+ config ATA_PIO32
+ depends on ATA
+ bool "ATA 32bit PIO"
+ default n
+ help
+ Use 32bit PIO accesses on ATA (minor optimization on PCI transfers).
+ config AHCI
+ depends on DRIVES
+ bool "AHCI controllers"
+ default n
+ help
+ Support for AHCI disk code.
+ config VIRTIO_BLK
+ depends on DRIVES && !COREBOOT
+ bool "VirtIO controllers"
+ default y
+ help
+ Support boot from virtio storage.
+ config FLOPPY
+ depends on DRIVES
+ bool "Floppy controller"
+ default y
+ help
+ Support floppy drive access.
+
+ config PS2PORT
+ depends on KEYBOARD || MOUSE
+ bool "PS/2 port"
+ default y
+ help
+ Support PS2 ports (keyboard and mouse).
+
+ config USB
+ bool "USB"
+ default y
+ help
+ Support USB devices.
+
+ config USB_UHCI
+ depends on USB
+ bool "USB UHCI controllers"
+ default y
+ help
+ Support USB UHCI controllers.
+ config USB_OHCI
+ depends on USB
+ bool "USB OHCI controllers"
+ default y
+ help
+ Support USB OHCI controllers.
+ config USB_EHCI
+ depends on USB
+ bool "USB EHCI controllers"
+ default y
+ help
+ Support USB EHCI controllers.
+ config USB_MSC
+ depends on USB
+ bool "USB drives"
+ default y
+ help
+ Support USB disks.
+ config USB_HUB
+ depends on USB
+ bool "USB hubs"
+ default y
+ help
+ Support USB hubs.
+ config USB_KEYBOARD
+ depends on USB && KEYBOARD
+ bool "USB keyboards"
+ default y
+ help
+ Support USB keyboards.
+ config USB_MOUSE
+ depends on USB && MOUSE
+ bool "USB mice"
+ default y
+ help
+ Support USB mice.
+
+ config EXTRA_PCI_ROOTS
+ bool "Extra root buses"
+ default n
+ help
+ If the target machine has multiple independent root buses,
+ the extra buses may be specified here.
+ config PCI_ROOT1
+ depends on EXTRA_PCI_ROOTS
+ hex "Extra primary PCI root bus number"
+ default 0x00
+ config PCI_ROOT2
+ depends on EXTRA_PCI_ROOTS
+ hex "Extra secondary PCI root bus number"
+ default 0x00
+
+ config USE_SMM
+ depends on !COREBOOT
+ bool "System Management Mode (SMM)"
+ default y
+ help
+ Support System Management Mode (on emulators).
+endmenu
+
+menu "BIOS interfaces"
+ config DRIVES
+ bool "Drive interface"
+ default y
+ help
+ Support int13 disk/floppy drive functions.
+
+ config CDROM_BOOT
+ depends on DRIVES
+ bool "DVD/CDROM booting"
+ default y
+ help
+ Support for booting from a CD. (El Torito spec support.)
+ config CDROM_EMU
+ depends on CDROM_BOOT
+ bool "DVD/CDROM boot drive emulation"
+ default y
+ help
+ Support bootable CDROMs that emulate a floppy/harddrive.
+
+ config PCIBIOS
+ bool "PCIBIOS interface"
+ default y
+ help
+ Support int 1a/b1 PCI BIOS calls.
+ config APMBIOS
+ bool "APM interface"
+ default y
+ help
+ Support int 15/53 APM BIOS calls.
+ config PNPBIOS
+ bool "PnP BIOS interface"
+ default y
+ help
+ Support PnP BIOS entry point.
+ config OPTIONROMS
+ bool "Option ROMS"
+ default y
+ help
+ Support finding and running option roms during POST.
+ config OPTIONROMS_DEPLOYED
+ depends on OPTIONROMS
+ bool "Option roms are already at 0xc0000-0xf0000"
+ default n
+ help
+ Select this if option ROMs are already copied to
+ 0xc0000-0xf0000. This is useful on Bochs and QEMU
+ versions older than 0.12.
+ config PMM
+ depends on OPTIONROMS
+ bool "PMM interface"
+ default y
+ help
+ Support Post Memory Manager (PMM) entry point.
+ config BOOT
+ bool "Boot interface"
+ default y
+ help
+ Support int 19/18 system bootup support.
+ config SERIAL
+ bool "Serial port interface"
+ default y
+ help
+ Support int 14 serial port calls.
+ config LPT
+ bool "Parallel port interface"
+ default y
+ help
+ Support int 17 parallel port calls.
+ config KEYBOARD
+ bool "Keyboard interface"
+ default y
+ help
+ Support int 16 keyboard calls.
+ config KBD_CALL_INT15_4F
+ depends on KEYBOARD
+ bool "Keyboard hook interface"
+ default y
+ help
+ Support calling int155f on each keyboard event.
+ config MOUSE
+ bool "Mouse interface"
+ default y
+ help
+ Support for int15c2 mouse calls.
+
+ config S3_RESUME
+ bool "S3 resume"
+ default y
+ help
+ Support S3 resume handler.
+ config S3_RESUME_VGA_INIT
+ depends on S3_RESUME
+ bool "Run VGA rom on S3 resume"
+ default n
+ help
+ Run the vga rom during S3 resume.
+
+ config VGAHOOKS
+ depends on COREBOOT
+ bool "Hardware specific VGA helpers"
+ default y
+ help
+ Support int 155f BIOS callbacks specific to some Intel and
+ VIA on-board vga devices.
+
+ config DISABLE_A20
+ bool "Disable A20"
+ default n
+ help
+ Disable A20 on 16bit boot.
+endmenu
+
+menu "BIOS Tables"
+ depends on !COREBOOT
+ config PIRTABLE
+ bool "PIR table"
+ default y
+ help
+ Support generation of a PIR table in 0xf000 segment.
+ config MPTABLE
+ bool "MPTable"
+ default y
+ help
+ Support generation of MPTable.
+ config SMBIOS
+ bool "SMBIOS"
+ default y
+ help
+ Support generation of SM BIOS tables. This is also
+ sometimes called DMI.
+ config ACPI
+ bool "ACPI"
+ default y
+ help
+ Support generation of ACPI tables.
+endmenu
+
+menu "Debugging"
config DEBUG_LEVEL
- int "Control how verbose debug output is."
- default 1
+ int "Debug level"
+ default 1
+ help
+ Control how verbose debug output is. The higher the
+ number, the more verbose SeaBIOS will be.
+
config DEBUG_SERIAL
- bool "Send debugging information to serial port"
- default n
- config VGAHOOKS
- bool "Support bios callbacks specific to via vgabios."
- default n
+ bool "Serial port debugging"
+ default n
+ help
+ Send debugging information to serial port.
+
+ config SCREEN_AND_DEBUG
+ bool "Show screen writes on debug ports"
+ default y
+ help
+ Send characters that SeaBIOS writes to the screen to the
+ debug ports.
+endmenu
diff --git a/src/config.h b/src/config.h
index 6356941..fe855ba 100644
--- a/src/config.h
+++ b/src/config.h
@@ -14,89 +14,6 @@
#define CONFIG_APPNAME6 "BOCHS "
#define CONFIG_APPNAME4 "BXPC"
-// Screen writes are also sent to debug ports.
-#define CONFIG_SCREEN_AND_DEBUG 1
-
-// Support running hardware initialization in parallel
-#define CONFIG_THREADS 1
-// Allow hardware init to run in parallel with optionrom execution
-#define CONFIG_THREAD_OPTIONROMS 0
-// Support relocating the one time initialization code to high memory
-#define CONFIG_RELOCATE_INIT 1
-// Support int13 disk/floppy drive functions
-#define CONFIG_DRIVES 1
-// Support floppy drive access
-#define CONFIG_FLOPPY 1
-// Support USB devices
-#define CONFIG_USB 1
-// Support USB UHCI controllers
-#define CONFIG_USB_UHCI 1
-// Support USB OHCI controllers
-#define CONFIG_USB_OHCI 1
-// Support USB EHCI controllers
-#define CONFIG_USB_EHCI 1
-// Support USB disks
-#define CONFIG_USB_MSC 1
-// Support USB hubs
-#define CONFIG_USB_HUB 1
-// Support USB keyboards
-#define CONFIG_USB_KEYBOARD 1
-// Support USB mice
-#define CONFIG_USB_MOUSE 1
-// Support PS2 ports (keyboard and mouse)
-#define CONFIG_PS2PORT 1
-// Support for IDE disk code
-#define CONFIG_ATA 1
-// Detect and try to use ATA bus mastering DMA controllers.
-#define CONFIG_ATA_DMA 0
-// Use 32bit PIO accesses on ATA (minor optimization on PCI transfers)
-#define CONFIG_ATA_PIO32 0
-// Support for AHCI disk code
-#define CONFIG_AHCI 0
-// Support for booting from a CD
-#define CONFIG_CDROM_BOOT 1
-// Support for emulating a boot CD as a floppy/harddrive
-#define CONFIG_CDROM_EMU 1
-// Support int 1a/b1 PCI BIOS calls
-#define CONFIG_PCIBIOS 1
-// Support int 15/53 APM BIOS calls
-#define CONFIG_APMBIOS 1
-// Support PnP BIOS entry point.
-#define CONFIG_PNPBIOS 1
-// Support Post Memory Manager (PMM) entry point.
-#define CONFIG_PMM 1
-// Support int 19/18 system bootup support
-#define CONFIG_BOOT 1
-// Support an interactive boot menu at end of post.
-#define CONFIG_BOOTMENU 1
-// Amount of time (in ms) to wait at menu before selecting normal boot.
-#define CONFIG_BOOTMENU_WAIT 2500
-// Support int 14 serial port calls
-#define CONFIG_SERIAL 1
-// Support int 17 parallel port calls
-#define CONFIG_LPT 1
-// Support int 16 keyboard calls
-#define CONFIG_KEYBOARD 1
-// Support calling int155f on each keyboard event
-#define CONFIG_KBD_CALL_INT15_4F 1
-// Disable A20 on 16bit boot
-#define CONFIG_DISABLE_A20 0
-// Support for int15c2 mouse calls
-#define CONFIG_MOUSE 1
-// If the target machine has multiple independent root buses, the
-// extra buses may be specified here.
-#define CONFIG_PCI_ROOT1 0x00
-#define CONFIG_PCI_ROOT2 0x00
-// Support searching coreboot flash format.
-#define CONFIG_COREBOOT_FLASH 1
-// Support floppy images in the coreboot flash.
-#define CONFIG_FLASH_FLOPPY 1
-// Support the lzma decompression algorighm.
-#define CONFIG_LZMA 1
-// Support finding and running option roms during post.
-#define CONFIG_OPTIONROMS 1
-// Set if option roms are already copied to 0xc0000-0xf0000
-#define CONFIG_OPTIONROMS_DEPLOYED 0
// When option roms are not pre-deployed, SeaBIOS can copy an optionrom
// from flash for up to 2 devices.
#define OPTIONROM_VENDEV_1 0x00000000
@@ -104,24 +21,6 @@
#define OPTIONROM_VENDEV_2 0x00000000
#define OPTIONROM_MEM_2 0x00000000
-// Support generation of a PIR table in 0xf000 segment (for emulators)
-#define CONFIG_PIRTABLE 1
-// Support generation of MPTable (for emulators)
-#define CONFIG_MPTABLE 1
-// Support generation of SM BIOS tables (for emulators)
-#define CONFIG_SMBIOS 1
-// Support finding a UUID (for smbios) via "magic" outl sequence.
-#define CONFIG_UUID_BACKDOOR 1
-// Support generation of ACPI tables (for emulators)
-#define CONFIG_ACPI 1
-// Support S3 resume handler.
-#define CONFIG_S3_RESUME 1
-// Run the vga rom during S3 resume.
-#define CONFIG_S3_RESUME_VGA_INIT 0
-// Support boot splash
-#define CONFIG_BOOTSPLASH 1
-// define it if the (emulated) hardware supports SMM mode
-#define CONFIG_USE_SMM 1
// Maximum number of map entries in the e820 map
#define CONFIG_MAX_E820 32
// Space to reserve in f-segment for dynamic allocations
@@ -135,9 +34,6 @@
#define CONFIG_SUBMODEL_ID 0x00
#define CONFIG_BIOS_REVISION 0x01
-// Support boot from virtio storage
-#define CONFIG_VIRTIO_BLK 1
-
// Various memory addresses used by the code.
#define BUILD_STACK_ADDR 0x7000
#define BUILD_S3RESUME_STACK_ADDR 0x1000
--
1.7.3.5
On Wed, Jan 26, 2011 at 09:38:57PM -0500, Kevin O'Connor wrote:
> Create autoconf.h during the build.
>
> Move a couple of config settings from config.h to Kconfig.
[...]
> --- /dev/null
> +++ b/src/defconfig
> @@ -0,0 +1,6 @@
> +# SeaBIOS default configuration
On closer inspection, it's possible to have Kconfig generate the
default config from the Kconfig file. So, it's not necessary to
commit a "defconfig" file.
-Kevin