IASL stores it's revision in each table header it generates.
That's a problem since guests see a change each time
they move between hypervisors.
We generally fill our own info for tables,
but we forgot to do this for the built-in DSDT.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Gerd Hoffmann [Fri, 18 Oct 2013 10:22:36 +0000 (12:22 +0200)]
Add support for etc/e820 fw_cfg file
The new fw_cfg is simliar to the QEMU_CFG_E820_TABLE entry,
but carries both reservations and RAM regions, so we can use
it instead of the cmos for RAM detection.
Gerd Hoffmann [Fri, 18 Oct 2013 10:18:19 +0000 (12:18 +0200)]
Add qemu_cfg_e820 function.
Move all ram detection and e820 setup to the new function, except for
lowmem detection which must remain in preinit so we can initialize our
memory allocator properly.
Load files through romfile loader and use for acpi tables.
We need the RSDP pointer to hang the rest of the tables off it,
to detect that we simply scan all memory in FSEG.
Add an option to disable this feature (useful for old QEMU versions).
This saves about 1Kbytes.
enabled:
Total size: 134932 Fixed: 61571 Free: 127212 (used 51.5% of 256KiB rom)
disabled:
Total size: 133836 Fixed: 61563 Free: 128308 (used 51.1% of 256KiB rom)
Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
romfile_loader: utility to patch in-memory ROM files
Add ability for a ROM file to point to
it's image in memory. When file is in memory,
add utility that can patch it, storing
pointers to one file within another file.
This is not a lot of code: together with the follow-up patch to load
ACPI tables from ROM, it's about 1K extra.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Kevin O'Connor [Sat, 26 Oct 2013 15:48:06 +0000 (11:48 -0400)]
Convert op->drive_g from a 16bit pointer to a 32 bit "GLOBALFLAT" pointer.
The "drive" structure is always malloc'ed and therefore always starts
off described as a 32-bit "flat" pointer. Instead of switching
to/from 16bit pointers, make all the code use the 32bit pointer. This
eliminates the confusing 16/32 bit pointer switches.
This patch also removes the "_g" suffixes on local variables in
functions that are always called in 32bit mode.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
After changing the parameter from `NotSerialized` to `Serialized`, the
remark is indeed gone and there is no size change.
The remark was added in ACPICA version 20130517 [1] and gives the
following explanation.
If a thread blocks within the method for any reason, and another thread
enters the method, the method will fail because an attempt will be
made to create the same (named) object twice.
In this case, issue a remark that the method should be marked
serialized. ACPICA BZ 909.
vgahooks: add SM720 VGA BIOS hooks for WIN Enterprises MB-60470
Add vgahooks to support the SMI SM720 VGA BIOS used on the
WIN Enterprises MB-60470. The response from smi_157f14() is necessary
for the CRT output to turn on. The response from smi_157f02() is used
to configure which connector(s) output is routed to.
As I lack hardware to test LCD panel output, I've selected CRT-only
output on the MB-60470 as this prevents the CRT output from being scaled
to the resolution of the LCD panel.
Signed-off-by: Jonathan A. Kollasch <jakllsch@kollasch.net>
Testing was done on windows images (win 2008/2012) taken from esx with vmware
tools installed and boot disk configured to use pvscsi.
Also I've used linux (ubuntu 12.04) where pvscsi drivers are installed by
default and booted it using qemu cmd similar to this:
Kevin O'Connor [Tue, 15 Oct 2013 01:52:28 +0000 (21:52 -0400)]
Build different final files for QEMU, coreboot, and CSM.
Build out/bios.bin on QEMU, out/bios.bin.elf on coreboot, and
out/Csm16.bin for CSM. This reduces the chance that one accidentally
builds for an incorrect target.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Thu, 3 Oct 2013 01:28:08 +0000 (21:28 -0400)]
Run ahci code entirely in 32bit mode.
The ahci driver needs to jump into 32bit mode in order to access
portions of the ahci controllers PCI config space. Instead of jumping
into 32bit mode just to toggle the ahci registers, jump into 32bit
mode for all of the driver interactions. This shrinks the size of the
overall code and can lead to further cleanups.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Thu, 3 Oct 2013 00:20:03 +0000 (20:20 -0400)]
Support call16() calls after entering 32bit mode from call32().
When transitioning to 32bit via call32() track the stack segment
register and support restoring it on call16() requests. This permits
call16() to work properly.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Thu, 19 Sep 2013 01:04:03 +0000 (21:04 -0400)]
Move dma code to new file hw/dma.c.
Move the DMA controller code in resume.c and hw/floppy.c to a new file
hw/dma.c. This centralizes the DMA controller code into one place.
Also, don't unmask the floppy DRQ during floppy setup - there is no
reason to unmask the DRQ prior to a command being programmed into the
DMA controller.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This patch simplifies seabios cross-builds on !x86 platforms.
It adds a CROSS_PREFIX variable which is used to set CC, LD &
friends to the cross build binaries. It also moves the common
command definitions up in the Makefile to make sure CC is set
correctly when probing compiler flags using $(call cc-option ...)
Recent git versions place the submodule git repos into the
.git/modules directory of the toplevel repo. In that case
.git of the seabios tree isn't a directory, but a regular
file, saying where the gitdir is.
Extent the git check to also allow .git being a regular file,
so buildversion.sh works correctly when called within the qemu
submodule.
Gerd Hoffmann [Mon, 3 Jun 2013 14:30:18 +0000 (16:30 +0200)]
usb: add xhci support
$subject says all. Support for usb3 streams is not implemented yet,
otherwise it is fully functional. Tested all usb devices supported
by qemu (keyboard, storage, usb hubs), except for usb attached scsi
in usb3 mode (which needs streams).
Tested on qemu only, tagged with QEMU_HARDWARE because of that.
Testing with physical hardware to be done.
This patch adds support for detecting whenever SeaBIOS runs on qemu
or not. This is done by looking at the northbridge (pci device 00:00.0)
and check the subsystem id. Most pci devices emulated by qemu -- the
two northbridges i440fx and q35 included -- have a subsystem id of
"1af4:1100".
In case the subsystem ID matches set PF_QEMU, log a message (including
the northbridge found while being at it) and also check for kvm.
Kevin O'Connor [Sat, 24 Aug 2013 17:43:09 +0000 (13:43 -0400)]
Update kconfig to latest version.
Update kconfig (from Linux v2.6.38-rc2) to the latest version (from
Linux v3.11-rc6).
This is a copy of kconfig from Linux with only the changes necessary
to work with the SeaBIOS build (the equivalent of the earlier SeaBIOS 0da7bfdf commit) and the changes necessary to always emit symbols
(SeaBIOS b623e7c5 commit).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Sat, 17 Aug 2013 14:13:14 +0000 (10:13 -0400)]
Rename tools/ directory to scripts/ directory.
It's common for other projects (eg, QEMU, Linux) to put build scripts
into a "scripts/" directory. There's no reason for SeaBIOS to be
different, so rename the "tools/" directory to "scripts/".
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Thu, 8 Aug 2013 03:03:47 +0000 (23:03 -0400)]
Add config option to support memory allocations in 9-segment.
Internal "low memory" allocations are currently placed in the UMB
region (0xc0000-0xf0000). However, there have been reports of some
real machines that do not support DMA to this area of memory. So, add
a compile time config option (off by default) to support placing all
internal low-memory allocations at the end of the 640K real-memory
area (0x90000-0xa0000).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Qemu commit 9ee59f3 removed the bochs bios apm interface emulation at
port 0x8900. That broke poweroff via APM. Fix it by powering off the
machine using the acpi pm control register.
Old code is left in, so seabios wil try both poweroff methods. Cleaning
that eventually up is left for another patch, after checking it isn't
needed. Qemu never implemented "Standby" and "Suspend", only
"Shutdown", so it looks like there might be non-qemu use cases (bochs
probably).
Easiest way to test this is the syslinux poweroff module; modern linux
distros usually have CONFIG_APM turned off.
Reported-by: Sebastian Herbszt <herbszt@gmx.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
commit 2b568ebb20b08c7881d976b5bc9f59a425bae5e6
acpi_extract: detect DeviceOp
added new directives to acpi_extract.py, but didn't
document them.
Add documentation at top of file.
Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Kevin O'Connor [Fri, 2 Aug 2013 18:13:50 +0000 (14:13 -0400)]
Support custom boot menu prompt and custom boot menu key.
Allow configuration of the boot menu prompt and boot menu key (via the
romfile interface). Some machines don't have an F12 key, so make this
configurable.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Mon, 22 Jul 2013 00:01:07 +0000 (20:01 -0400)]
Add missing mathcp_setup() call to CSM code.
It looks like when mathcp_setup() got moved from interface_init() to
platform_hardware_setup() in 3a735baa the corresponding change was not
made to the CSM code. Update it now.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Sun, 21 Jul 2013 20:38:18 +0000 (16:38 -0400)]
Default unused UMB areas to be read-only.
It looks like MSDOS 6 wants the UMB area to be read-only in order for
it to use it. FreeDOS doesn't care, but it always maps a page from
high mem when it does use the area. So, add an option to control
whether unused UMB ram is marked read-only and default it to read-only
as that seems to be more compatible.
This also fixes an off-by-one bug in the shadow range checking code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Sat, 20 Jul 2013 17:06:35 +0000 (13:06 -0400)]
Improve accuracy of internal timers.
The TICKS_PER_DAY setting is a bios standard and needs to be 1573040
for compatibility. However, there are actually ~1573042.24 ticks in a
day. So, only use TICKS_PER_DAY when working with the BDA
timer_counter - not when calculating any internal times.
The PIT hz is actually 143181800 / 12 (~1193181.667). This can be
accurately encoded as PMTIMER hz / 3. Because the PIT hz is usually
multiplied and divided by other numbers, we can use the PMTIMER hz and
defer the division by 3 to improve accuracy.
When doing division for delay time calculations, always round up the
division so the delay is never less than the requested time.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Q35 support was originally written before these commits in seabios, PIIX
got updated, Q35 didn't. QEMU uses the same clock for both so there's
no reason for these bits to differ. Sync them up.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Gerd Hoffmann [Mon, 24 Jun 2013 09:24:57 +0000 (11:24 +0200)]
coreboot: add cbmem console support
Add support for logging to the coreboot cbmem console.
Limitation: only supported in 32bit mode. Use 'cbmem -c'
to see the logs (coreboot and seabios) after bootup.