aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-06-05build: Avoid absolute paths during "whole-program" compiling.Kevin O'Connor1-2/+2
The build currently does a textual include of all files in order to use the -fwhole-compile optimization. Update it to use relative file paths instead of absolute file paths. This makes the section names in the resulting binary more readable. It also makes the build easier on some Windows hosts. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-04Move most of the VAR16FIXED() defs to misc.c.Kevin O'Connor6-11/+12
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-04Remove old Bochs bios fixed address string at 0xfff00.Kevin O'Connor2-5/+0
There is no indication that the address 0xff00 is a BIOS standard, so don't emit the old Bochs copyright string at that fixed address. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-04Don't enable thread preemption during S3 resume vga option rom execution.Kevin O'Connor1-1/+1
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-04smp: Replace QEMU SMP init assembler code with C; run only in 32bit mode.Kevin O'Connor5-57/+78
Change the multi-processor init code to trampoline into 32bit mode on each of the additional processors. Implement an atomic lock so that each processor performs its initialization serially. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-04smm: Use a C struct to define the layout of the SMM area.Kevin O'Connor3-16/+55
Describe the memory layout using a struct instead of hard coded offsets. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-04smm: Replace SMI assembler code with C code.Kevin O'Connor3-43/+49
Convert the SMI handler from assembly to C. This makes the handler easier to understand and enhance. The new handler will use references to the reserved memory at 0xf0000-0x100000. If the physical memory in that range is modified at runtime, then the SMI handler will cease to function properly (and may allow unintended code to run in SMM mode). However, that area is marked as reserved and is normally made read-only at runtime, so there is little risk in relying on it. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-04smm: unify SMM handlersPaolo Bonzini1-16/+11
The next patch will add shared code between the initial handler for SMBASE relocation and the actual SMI handler. Combine the code of the two handlers for simplicity. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-06-04smm: complete SMM setupPaolo Bonzini3-1/+16
SMI generation requires two bits to be set in PIIX4, one for APMC interrupts specifically and a general one. For Q35 it is the same, plus it is a good thing to lock SMIs after enabling them. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-06-04piix: add and use dev-piix.hPaolo Bonzini5-26/+44
Move all definitions for PIIX registers to a single header file, like there is one already for Q35, and make the naming more consistent. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-06-04Move cdemu call interface and disk_ret helper code to disk.c.Kevin O'Connor5-60/+52
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-04cdemu: store internal cdemu fields in standard "el-torito" spec format.Kevin O'Connor6-76/+38
Store the fields necessary to export the "el-torito" spec information directly in an internal copy of the "el-torito" struct. This simplifies the interface and obviates the need for an internal home grown struct with the same info. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-04edd: Separate out ATA and virtio specific parts of fill_edd().Kevin O'Connor1-81/+88
This also changes DTYPE_VIRTIO_SCSI drives to report that they are using a "SCSI" bus instead of an "ATA" bus - it was obviously incorrect before. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-04edd: Use sectors==-1 to detect removable media.Kevin O'Connor1-3/+2
Don't look for DTYPE_ATA_ATAPI to determine if a removable media (such as a cdrom) is present, instead look for a -1 in the sector count. This improves the results for cdroms on controllers other than ATA ATAPI. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-04edd: Move EDD get drive parameters (int 1348) logic from disk.c to block.c.Kevin O'Connor3-179/+184
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-02Update EFI_COMPATIBILITY16_TABLE to match 0.98 spec updateDavid Woodhouse2-0/+26
Unless CONFIG_MALLOC_UPPERMEMORY is turned off, we expect to use the space between the top of option ROMs and the bottom of our own BIOS code as a stack. OVMF was previously marking the whole region from 0xC0000 to 0xFFFFF read-only before invoking our Legacy16Boot method. Read-only stack considered harmful. Version 0.98 of the CSM spec adds the UmaAddress and UmaSize fields which allow the CSM to specify a memory region that needs to be writeable, so provide that information. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2014-05-28vgabios: Return from handle_1011() if handler found.Kevin O'Connor1-9/+9
Fix cut-and-paste error in handle_1011() causing spurious debug_stub() calls when CONFIG_VGA_STDVGA_PORTS is enabled. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-05-27python3 fixes for vgabios and csm builds.rel-1.7.5Kevin O'Connor2-19/+19
Avoid using chr() as this produces unicode strings on python3. Make sure to only use ord() on slices as the python3 bytearray type returns an integer on a non-slice array access. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-05-20Allow using full io region on q35.Gerd Hoffmann2-7/+14
If qemu is new enough to support acpi table loading, then go move pmbase out of the way. This allows to use the whole 0x1000 -> 0xffff io address space on q35. piix has hotplug ports in the 0xa000 -> 0xafff area, so we can't do the same there. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-05-20acpi: remove PORT_ACPI_PM_BASE constantGerd Hoffmann6-19/+19
Use the new acpi_pm_base variable instead. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-05-20smm: remove code to handle ACPI disable/enablePaolo Bonzini1-25/+0
This is handled already in QEMU, no need to do it in SMM. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-05-13vgabios: Add debug message if x86emu leal check triggers.Kevin O'Connor1-0/+10
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-05-09acpi: Fix acpi dsdt compile warning.rel-1.7.5-rc1Kevin O'Connor2-2/+1
The _EJ0 method should not return a value. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-05-08Fix int 1589 calls when CONFIG_ENTRY_EXTRASTACK is enabled.Kevin O'Connor3-3/+13
The int 1589 call is entered in real mode and returns in protected mode. However, the code to use the "extra stack" does not support that. Fix this by never using the "extra stack" on int 1589 calls. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-05-08build: Make sure romlayout.o is recompiled on Kconfig change.Kevin O'Connor1-1/+1
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-05-08xhci: Use msleep() instead of mdelay() for port status delay.Kevin O'Connor1-1/+1
Use msleep() so that interrupts and other threads can occur during the delay. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-05-08ld: don't hardcode "-melf_i386"Roger Pau Monne1-2/+3
On FreeBSD, the name of the emulation is "-melf_i386_fbsd", so allow SeaBIOS to fetch the emulation to use from the environment variables. This allows SeaBIOS to compile on FreeBSD with gcc. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Cc: Ian Campbell <ian.campbell@citrix.com>
2014-05-06If an int 1587 call is made from an option rom, stay in bigreal mode.Kevin O'Connor5-7/+17
Modify the int 1587 handler to check if the POST phase is still running. If it is, use bigreal mode segment limits so that the caller remains in bigreal mode when the 1587 handler completes. This helps with SeaVGABIOS' use of "direct" framebuffer accesses (an option rom may attempt to display text during its option rom execution which can cause SeaVGABIOS to make the int 1587 calls). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-05-06SMBIOS: Check for aggregate tables & entry point in fw_cfgGabriel L. Somlo3-2/+138
Check fw_cfg for the presence of an aggregate set of smbios tables (etc/smbios/smbios-tables) and an entry point structure (etc/smbios/smbios-anchor), and, if found, use them instead of generating entries locally. We ensure the presence of a type 0 (bios information) structure by generating it locally if necessary, which is expected to be the common case. Signed-off-by: Gabriel L. Somlo <somlo@cmu.edu> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-04-16hw/pci: check if pci2pci bridges implement optional limit registersMarcel Apfelbaum3-7/+37
<I/O Base Register, I/O Limit Register> pair and <Prefetchable Memory Base Register, Prefetchable Memory Limit Register> pair are both optional. Do not reserve ranges if the above registers are not implemented. Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
2014-04-16hw/pci: reserve IO and mem for pci-2-pci bridges with no devices attachedMarcel Apfelbaum3-0/+23
If a pci-2-pci bridge supports hot-plug functionality but there are no devices connected to it, reserve IO/mem in order to be able to attach devices later. Do not waste space, use minimum allowed. Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
2014-04-14vgabios: Define PlatformRunningOn to make compile happy.Kevin O'Connor1-0/+3
With CONFIG_COREBOOT=y, CONFIG_QEMU_HARDWARE=y, CONFIG_VGA_COREBOOT=y, CONFIG_DEBUG_IO=y the compile would break because this variable was missing. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-04-12Factor out smbios table walking from display_uuid to smbios_next().Kevin O'Connor1-62/+46
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-04-11Minor - replace some tab characters that slipped into the code.Kevin O'Connor6-10/+10
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-04-11vgabios: Initial support for coreboot native vga vgabios.Kevin O'Connor7-4/+251
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-04-11coreboot: Make coreboot table searching available to other code.Kevin O'Connor2-23/+38
Make the coreboot table searching code available to code outside coreboot.c, and make it runnable from 16bit mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-04-11vgabios: PMM scan was incorrectly depending on a zero %ds segment.Kevin O'Connor1-6/+6
Make sure the PMM scanning code uses the GET_FARVAR macro. (The existing code only worked because SeaBIOS happens to call the vgabios in bigreal mode with %ds == %ss = 0.) Also, the scan doesn't require bigreal mode - use accesses relative to the SEG_BIOS segment so that the scan can work in regular real mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-04-11Set the color attribute when calling vgabios print character.Kevin O'Connor1-0/+1
Set the color attribute in case the SeaBIOS console code is used while the vgabios is in a graphics mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-04-11vgabios: Add support for manipulating framebuffers in high memory.Kevin O'Connor2-0/+112
Add code for manipulating "direct" style linear RGB framebuffers that may be in high memory. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-04-11vgabios: Introduce text_address().Kevin O'Connor3-36/+24
Factor out code that calculates the text mode address of a given character. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-04-11vgabios: Rewrite vgafb.c graphics operations to set of 4 standard operators.Kevin O'Connor2-367/+306
The vgabios graphics manipulations can all be implemented on top of 4 basic primitives: read 8 pixels, write 8 pixels, move pixels, and clear pixels. Implement these four operators for all the graphics modes and rewrite the graphics functions in vgafb.c to use them. This simplifies the graphics code as the high level logic no longer needs to be implemented for each graphical framebuffer type. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-04-11vgabios: Split vgafb_scroll() into separate move and clear functions.Kevin O'Connor3-122/+178
Rewrite the low-level scroll code so that it is implemented using two basic operations: move text and clear text. This simplifies the low-level code as it no longer needs to handle up scrolling vs down scrolling. Determining the direction of the scroll is now done in the higher level (vgabios.c) code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-04-11vgabios: Add option to control use of standard VGA IO ports.Kevin O'Connor4-13/+50
Add option CONFIG_VGA_STDVGA_PORTS. When this option is disabled, the main BIOS code will not attempt to access any of the legacy VGA IO ports. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-04-08Minor - remove unused includes from pci.c.Kevin O'Connor2-5/+2
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-04-07apm: Remove old Bochs mechanism for shutdown/suspend/standby.Kevin O'Connor2-29/+6
Remove the old mechanism that used port 0x8900 to send apm signals. Recent versions of QEMU no longer support this port. Bochs and QEMU only ever supported shutdown anyway, and shutdown is already available via an ACPI mechanism. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-04-07Document no new changes to pirtable.c, mptable.c, acpi.c, and smbios.c.Kevin O'Connor4-0/+4
Add a note to the code that generates the pir, mptable, smbios, and smbios tables that no new changes are expected. Going forward, it is expected that if any changes are needed to these bios tables that SeaBIOS will get the tables passed in from upstream. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-04-07Use biostables.c for copying bios tables even when generating them.Kevin O'Connor6-65/+43
Use the biostables.c copy_pir(), copy_smbios(), copy_acpi_rsdp(), and copy_mptable() code even when using the legacy bios table generation code. This unifies the final bios table deployment code between qemu, coreboot, and csm. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-04-07Move PirAddr definition from pirtable.c to biostables.c.Kevin O'Connor3-3/+4
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-04-07smbios: Move smbios parsing logic from smbios.c to biostables.c.Kevin O'Connor3-72/+73
After this change, src/fw/smbios.c only contains the legacy code for generating SMBIOS tables. This change only contains code movement - no logic is changed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-04-07acpi: Move acpi parsing logic from acpi.c to biostables.c / paravirt.c.Kevin O'Connor4-149/+160
After this change, src/fw/acpi.c only contains the legacy code for generating ACPI tables. This change only contains code movement - no logic is changed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>