Gleb Natapov [Tue, 7 Dec 2010 11:50:54 +0000 (13:50 +0200)]
Create separate IPL entry for each CD/DVD
Current code creates only one IPL entry of type IPL_TYPE_CDROM even if
there are more then one CDROM drive present. If CDROM that the entry
refers to is not bootable there is no way to retry boot from another
CDROM. Fix this by creating IPL entry for each CDROM drive found. First
CDROM will always be placed in IPL entry 3 for backwards compatibility.
Kevin O'Connor [Sun, 5 Dec 2010 17:52:02 +0000 (12:52 -0500)]
Check if capability enabled in XXX_cmd_data functions.
Make sure to check if CONFIG_AHCI, CONFIG_ATA, CONFIG_USB_MSC is
enabled in their respective cmd_data functions. This reduces the
compile size when they are not enabled.
Kevin O'Connor [Sun, 5 Dec 2010 17:38:33 +0000 (12:38 -0500)]
Require a "_cfuncXX_" symbol prefix for inter-mode c function references.
The compiler can get confused when referencing a C function in a
different mode. (It reasonably assumes that the C function in the
current mode is desired.) To avoid this compiler confusion, introduce
symbol prefixes (_cfunc16_, _cfunc32flat_, _cfunc32seg_) that must be
used on C function symbols that are referenced from other compilation
modes.
This makes it less likely compiler confusion will occur. It will also
makes it easier to implement and use vtable like operation structures.
Gerd Hoffmann [Mon, 29 Nov 2010 08:42:13 +0000 (09:42 +0100)]
add ahci support
This patch adds AHCI support to seabios. Tested with virtual hardware
only (upcoming ahci support in qemu). Coded by looking at the
recommandations in the intel ahci specs, so I don't expect much trouble
on real hardware. Tested booting fedora install from hard disk and a
opensuse live iso from cdrom.
[ v2: disable by default ]
[ v2: add check for malloc failure ]
[ v2: wind up disk write support ]
Gerd Hoffmann [Mon, 29 Nov 2010 08:42:12 +0000 (09:42 +0100)]
ata: make helpers available
Make ata helper functions available outside ata.c, so others (i.e.
upcoming ahci support) can use them. Prefix them with ata_ to avoid
name clashes. Also don't hard-code buffer size for the model name.
Gerd Hoffmann [Mon, 29 Nov 2010 08:42:10 +0000 (09:42 +0100)]
pci: add helper functions for mmio bar access from real mode.
This patch adds helper pci_readl and pci_writel which can be used
to access pci mmio bars from real mode. They work in 32bit mode
too. ahci support needs this, also ohci for bulk transfers, and
probably more devices in the future.
Kevin O'Connor [Thu, 25 Nov 2010 13:52:50 +0000 (08:52 -0500)]
Don't pass return address to transition(32,16,16big) on stack.
It's difficult to have a uniform view of the stack when transition
modes, so pass the return address in a register. As a result, the
transition functions only access memory via the %cs selector now.
Kevin O'Connor [Thu, 21 Oct 2010 01:59:11 +0000 (21:59 -0400)]
mark irq9 active high in DSDT
In PIIX4 SCI (irq9) is active high. Seabios marks it so in interrupt
override table, but some OSes (FreeBSD) require the same information to
be present in DSDT too. Make it so.
Kevin O'Connor [Sat, 25 Sep 2010 16:48:43 +0000 (12:48 -0400)]
Allow rom to grow to 256K.
Enable rom size to be over 128K.
Apparently, only the first 128K of the rom are mirrored to the
0xc0000-0xfffff area under qemu, so make sure to copy the rom (via
make_bios_writable) in the non-init part of the startup code. This
ensure the copy code is itself available.
Kevin O'Connor [Sat, 25 Sep 2010 15:34:06 +0000 (11:34 -0400)]
Move the 32bit init code to high memory at runtime.
Add support for moving the 32bit init code out of the e/f-segments and
into temporary ram. Update the relocations in the code so that it can
live at its new address.
This frees up memory for other uses in the e/f segments.
Kevin O'Connor [Thu, 16 Sep 2010 01:48:16 +0000 (21:48 -0400)]
Try to hard-reboot on rerun of post even on emulators.
Extend the hard-reboot logic to qemu and kvm. On qemu, a reboot will
not reset the memory settings for 0xc0000-0xfffff, so copy that memory
area manually before rebooting. Unfortunately, kvm does not keep a
pristine copy of the BIOS at 0xffff0000, so detect that case and
shutdown the machine.
Kevin O'Connor [Wed, 15 Sep 2010 04:26:19 +0000 (00:26 -0400)]
Enhance build to emit relocation information.
Add support for determining which relocations need to be adjusted to
relocate the "32bit flat init" code. Place those relocations in the
output object.
Kevin O'Connor [Thu, 16 Sep 2010 01:38:16 +0000 (21:38 -0400)]
Separate out init code from the rest of the 32bit flat code.
Enhance tools/layoutrom.py code so that it can detect which sections
are used from the "32bit flat" runtime code. All other "32bit flat"
sections can then be assured to be initialization code only.
This is in preparation for relocating the 32bit initialization code.
Kevin O'Connor [Fri, 3 Sep 2010 01:18:20 +0000 (21:18 -0400)]
Support Samsung SE-S084 USB DVD drive (and probably many others)
A full implementation of ATAPI USB support would need to translate / filter
certain package types or some devices might not work. No previously working
devices break with the patch, so it is fine to commit.
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Kevin O'Connor [Sat, 28 Aug 2010 18:55:32 +0000 (14:55 -0400)]
Enhance tools/readserial.py to support reading from a pipe.
Add option parsing support to tool.
Enable option (-f) to read from a pipe - which is useful when
redirecting qemu's debugging log to a pipe with:
-chardev pipe,id=seabios,path=seabioslog -device isa-debugcon,iobase=0x402,chardev=seabios
Gleb Natapov [Mon, 23 Aug 2010 07:23:45 +0000 (10:23 +0300)]
add write support to virtio-blk
Windows XP does write to sector 0 during installation and prints
mysterious error if write fails. Interestingly if write drops data,
but returns OK to Windows installer installation proceed without
complains and completes successfully.
Lubomir Rintel [Fri, 20 Aug 2010 11:37:54 +0000 (13:37 +0200)]
Don't try to talk to APIC on 486
It only has one cpuid level, therefore it can't report whether it
has an APIC. It probably hasn't; assume that. Without this,
SeaBIOS would get stuck on qemu -M isapc.
Kevin O'Connor [Wed, 4 Aug 2010 01:30:03 +0000 (21:30 -0400)]
Add ACPI SSDT/DSDT support for CPU hotplug.
Move the SSDT defined processors from _PR to _SB namespace.
Extend the dynamically generated SSDT to include per cpu hotplug
methods. These methods just call methods defined in the DSDT. Also
dynamically generate a NTFY method and a CPON array of the
online/available CPUs. Add file src/ssdt-proc.dsl with directions for
generating the per-cpu processor object AML code.
Extend the DSDT to include methods for handling cpu hotplug
notifications and methods for handling cpu status requests originating
from the SSDT methods.
Kevin O'Connor [Fri, 30 Jul 2010 22:51:29 +0000 (18:51 -0400)]
Add tools/trandump.py tool for converting hexdump() output.
Add tool for converting the output from hexdump() back into its
original binary form. This can be useful for use with tools such as
hexdump and objdump.
Kevin O'Connor [Tue, 27 Jul 2010 03:16:12 +0000 (23:16 -0400)]
Don't do "double buffering" in bootsplash code.
Not all vgabios support off screen framebuffers. Instead, decompress
the picture into ram, and then copy it into the framebuffer. This
ensures a fast display time without requiring any special vga support.
When 64bit bar allocation failed, leave it untouched as 32bit bar case.
There is no point to set higher bit to all 1, it is just leftover from
debug code.
Alex Williamson [Mon, 21 Jun 2010 15:46:19 +0000 (09:46 -0600)]
smbios: Allow all fields to be set via qemu_cfg_smbios_load_field()
The protocol we use between qemu and seabios already allows any field
to be specified (via smbios_add_field() in qemu). This patch makes
seabios look for qemu specified values for nearly every field we set
in the types 0,1,3,4,16,17,32 smbios tables. No change in current
default values for any fields.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Kevin O'Connor [Sat, 10 Jul 2010 17:12:37 +0000 (13:12 -0400)]
seabios: pciinit: use pci device initializer helper function.
This patch makes use of pci device initialization helper function
to convert if/switch clause to table driven.
So this makes it easier to add q35 initialization code.
Stefan Hajnoczi [Wed, 7 Jul 2010 12:34:22 +0000 (13:34 +0100)]
virtio: Clear interrupt status register in virtio-blk
The VRING_AVAIL_F_NO_INTERRUPT flag is a hint that interrupts should be
suppressed. It does not guarantee that interrupts will not be raised.
Therefore, make sure to clear the interrupt after each virtio-blk read.
This avoids a stuck interrupt interfering with the OS loaded later in
the boot process.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Isaku Yamahata [Tue, 22 Jun 2010 08:57:49 +0000 (17:57 +0900)]
seabios: pciinit: make pci bar assigner preferchable memory aware.
Make pci bar assigner preferchable memory aware.
This is needed for PCI bridge support because memory space and
prefetchable memory space is filtered independently based on
memory base/limit and prefetchable memory base/limit of pci bridge.
On bus 0, such a distinction isn't necessary so keep existing behavior
by checking bus=0.
With this patch, pci mem assignment area has been decreased.
To make seabios behave as before for compatible reason,
define CONFIG_OLD_PCIMEM_ASSIGNMENT.
This patch introduces foreachpci_in_bus() helper macro for
depth first recursion. foreachpci() is for width first recursion.
The macro will be used later to initialize pci bridge
that requires depth first recursion.
Isaku Yamahata [Mon, 7 Jun 2010 08:19:27 +0000 (17:19 +0900)]
seabios: remove iasl output file when error.
Surprisingly iasl creates output file even when compilation error.
So typing make after an error will succeed.
This patch prevents it by removing the output file when error.
And adds related dependencies to compile when .hex is missing.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Kevin O'Connor [Sun, 6 Jun 2010 15:10:24 +0000 (11:10 -0400)]
Rework malloc to use a "first fit" algorithm.
The existing malloc implementation effectively uses a stack - all new
allocations come from the top of the stack. When allocating memory
with a large alignment, the pad used to align the new memory is
unavailable to other users. Also, memory released by calling free()
is only available to other users when all memory allocated after it is
also freed.
This new malloc scheme uses a first fit approach to finding available
memory. It makes it possible to use alignment padding and freed space
for new allocations.
This helps reduce the required memory in the permanent memory zones
(ZoneHigh and ZoneLow) where users have the need to allocate
structures with high alignment (eg, virtio and usb).