Kevin O'Connor [Mon, 9 Dec 2013 22:27:54 +0000 (17:27 -0500)]
vgabios: Avoid memory references via %esp register in vgabios.
Win7 interprets the vgabios and it does not properly handle memory
references relative to the %esp register. Commit 4a8b58cb introduced
some of these %esp references - rework that assembler to avoid these
instructions and make win7 happy.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Sat, 7 Dec 2013 17:48:11 +0000 (12:48 -0500)]
floppy: Fix accesses to DOR register.
The DOR register is a write-only register (even though QEMU and at
least some real hardware permit read/write acess). So, do not read
from the DOR port. Introduce a VARLOW variable (FloppyDOR) to store
the current state.
When resetting the controller, make sure to enable both the controller
and interrupts. Also, make sure the controller is really reset (by
writing a 0 to DOR first) to ensure an IRQ is received on reset.
Also, add some additional dprintf statements to the floppy init path.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Sat, 7 Dec 2013 16:46:37 +0000 (11:46 -0500)]
floppy: Fix incorrect LBA to CHS translation.
The floppy LBA to CHS translation was incorrect for the last sector of
a given cylinder. This wasn't a problem under QEMU as it came to the
same results anyway, but it causes errors of real floppy controllers.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Fri, 6 Dec 2013 18:52:16 +0000 (13:52 -0500)]
Separate out sec32init sections even when not doing code relocation.
The current code does not boot on QEMU with 256K roms when code
relocation is disabled, because QEMU only maps the last 128K of the
rom to low memory. The seabios make_bios_writable() call copies the
full rom to low memory.
This patch separates out the init sections even if code relocations
are disabled. This effectively ensures that make_bios_writable() code
is in the last 128K of the rom.
This also introduces a new build symbol (final_readonly_start) which
stores the address of where the final runtime read-only memory begins.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Sun, 1 Dec 2013 00:16:15 +0000 (19:16 -0500)]
vgabios: Support allocating an extra stack for vgabios calls and default on.
Add code to allocate an extra stack for the main vgabios int 0x10
entry point. The allocation is done via the PMM spec and uses a PCI
v3 permanent low memory region request. This request will work with
SeaBIOS - it is unknown how many other main BIOS implementations
support this PMM call.
The extra stack is useful for old DOS programs that call the VGABIOS
and expect it to work with very small amounts of stack space.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Sat, 30 Nov 2013 17:52:44 +0000 (12:52 -0500)]
vgabios: Work around lack of support for "calll" in x86emu emulation.
Replace 32 bit call instructions with 16 bit call instructions in the
vgabios to workaround problems in old versions of x86emu. This change
allows fc13 and fc14 to boot. (Other x86emu emulation bugs still
prevent fc11 and fc12 from booting.)
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Sat, 30 Nov 2013 15:52:45 +0000 (10:52 -0500)]
vgabios: Support custom fonts in vga framebuffer text writing.
Obtain the font data from int 0x43 and int 0x1f, and obtain the font
height from the BDA. This enables application overrides for the font
data.
This patch also unifies the variable naming between the
planar/CGA/linear character writing functions and uses the same names
that the screen scrolling functions use.
This patch also optimizes the inner loop of the CGA font writing to
reduce overall stack usage.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Gerd Hoffmann [Tue, 26 Nov 2013 13:10:25 +0000 (14:10 +0100)]
ahci: alloc structs in high memory
With ahci running in 32bit mode we can also allocate the
(ahci private) data structures in high memory. This
reduces the real mode memory footprint as we only need
to move struct ahci_port_s (which contains struct drive_s)
to fseg in case the port probe was successful.
Gerd Hoffmann [Tue, 26 Nov 2013 11:48:20 +0000 (12:48 +0100)]
pci: map 64-bit BARs at location provided by emulator
Currently 64-bit PCI BARs are unconditionally mapped by BIOS right
over 4G + RamSizeOver4G location, which doesn't allow to reserve
extra space before 64-bit PCI window. For memory hotplug an extra
RAM space might be reserved after present 64-bit RAM end and BIOS
should map 64-bit PCI BARs after it.
Introduce "etc/reserved-memory-end" romfile to provide BIOS a hint
where it should start mapping of 64-bit PCI BARs. If romfile is
missing, BIOS reverts to legacy behavior and starts mapping after
high memory.
Based-on-patch-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-By: Igor Mammedov <imammedo@redhat.com>
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>