Age | Commit message (Collapse) | Author | Files | Lines |
|
Add a mechanism (VARLOW declaration) to make a variable reside in the
low memory (e-segment) area. This is useful for runtime variables
that need to be accessed from 16bit code and need to be modifiable
during runtime.
Move the 16bit "extra stack" from the EBDA to the low memory area
using this declaration mechanism. Also increase the size of this
stack from 512 bytes to 2048 bytes.
This also reworks tools/layoutrom.py a bit.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Use the e-segment for ZoneLow allocations. There is plenty of
e-segment space (there has been since SeaBIOS supported code
relocation), while using the 9-segment space can impact old real-mode
applications.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Original patch from Rudolf Marek.
Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Enable SeaBIOS to work on 386/486 machines that don't have CPUID
instruction.
Based on patch by Rudolf Marek.
Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
this will be used later.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
|
|
Use call32() to jump into handle_pmm(). This reduces the amount of
16bit code needed.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Detect a resume/reboot by inspecting HaveRunPost instead of inspecting
the cmos reset code. Inspecting a global variable is both simpler and
safer.
Move the reboot logic from post.c to resume.c - this makes the code in
post.c simpler as it is now only called once on machine startup. This
also makes it easier to ensure all POST initialization code resides in
the relocatable "init" sections.
Also, rename _start() to handle_post() so that it is more in keeping
with the entry_xxx() and handle_xxx() function naming.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
Do vga type and parameter detection during setup and store the
necessary info in global variables for the 16bit code. This
simplifies the "vgahook" 16bit code.
|
|
It's easier to understand the code when it is in the same file as its
callers.
|
|
SeaBIOS is called by Xen's hvmloader which does the basic platform
setup (PCI, APIC, etc) and provides the various BIOS tables. Therefore
avoid re-doing that setup and copy out the tables as necessary. A
simple data structure is defined to pass the addresses of these
tables.
This patch also establishes the basic infrastructure to make
hypercalls, although it currently only uses it to query the hypervisor
version.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
|
|
I'd like to use it for Xen support.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
|
|
Don't try to register payloads until after malloc has been setup.
|
|
Introduce function nullTrailingSpace() that nulls blank characters
from the end of a string. Use this function in the ATA, USB MSC, and
bootorder code.
|
|
The description field is only available during the POST phase - it is
confusing to have it live in a structure available through all phases.
The description was only used by the boot menu code - pass each drive
description directly to the bootlist code.
Add a helper (znprintf) to automatically malloc_tmp the required
space.
Also, fixup ramdisk handling - it was using an incorrect floppy
priority.
|
|
|
|
|
|
Support passing a parameter to the 32bit function, as well as
returning the result of the function back to the 16bit code.
Also, make call32 available outside of stacks.c.
|
|
This patch adds helper functions to manage pci area.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
|
|
Now that a soft-reboot forces a hard-reboot, it is no longer necessary
to manually reset global variables.
|
|
|
|
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.
|
|
When the bootsplash picture is shown, it's not possible to see text.
So, only display the picture while prompting the user for the boot
menu.
|
|
VESA structs must be in first 1Meg - so use malloc_tmplow().
Use 'struct segoff_s' for segment/offset pairs in vesa structs.
Don't call start/finish_preempt() around jpeg_decode() - the preempt
only works when calling functions in 16bit mode.
Some indentation and debug output enhancements.
|
|
Add macro to improve readability of GDT limit definitions.
|
|
move out piix4 specific smram logic to dev-i440fx.c.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
|
|
pam register offset is north bridge specific.
So determine the offset based on found north bridge.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
|
|
move out cpu_to_le{32, 16} from acpi.c to util.h.
Those will be used by other files later.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
|
|
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.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
|
|
Support displaying a jpeg file (stored in cbfs) during bootup.
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
|
|
Make the qemu_cfg optionrom extraction code use an interface more
similar to the cbfs file interface.
Introduce a set of "romfile_" wrappers that select between cbfs and
qemu cfg interface. Use these new wrappers in the optionrom code.
|
|
|
|
It appears real machines sometimes have a flaky RTC, so avoid using
the RTC irq during boot. Instead, use a delay based on the standard
timer irq.
This also optimizes CONFIG_THREAD_OPTIONROMS users as it is no longer
necessary to use preemption - the wait_irq() call handles task
switching natively.
|
|
Move the timer based counting code in serial.c to clock.c.
Rework the interface to make it similar to the tsc based timers.
|
|
|
|
If wait_irq() is called from 32bit code, then jump to 16bit mode for
the wait.
Have wait_irq check for threads, and have it use yield if threads are
pending. This ensures threads aren't delayed if anything calls
wait_irq.
Use wait_irq() in 32bit mode during a failed boot.
|
|
For indirect calls, place function address in a register and call it.
This is less optimal when gcc can inline the code and the destination
address is known at compile time. However, older gcc compilers don't
do as well with inlining, and they then mess up the code generation.
There doesn't seem to be a way to tell gcc how to emit the code
correctly for both immediate addresses and register addresses, so fall
back to a safe way.
Also, reduce params to stack_hop to avoid register assignment issues.
|
|
Moving the ebda while an optionrom is running could confuse it. So,
avoid doing that.
|
|
Make sure to fully backup and restore register state when calling out
to other interrupts and functions. Some old DOS programs don't fully
restore state.
Also, make sure to enable irqs in call16_simpint().
|
|
Locks are not normally necessary because SeaBIOS uses a cooperative
multitasking system. However, occasionally it is necessary to be able
to lock a resource across yield calls. This patch introduces a simple
mechanism for doing that.
|
|
|
|
Remove describe_drive() mechanism for calling printf with a drive
description. Instead, have each drive build a description in
temporary ram during drive initialization.
Also, remove fields now unneeded from 'struct disk_s' - model and
cntl_info.
|
|
Use the assembler bswapl instruction if the value is not constant.
|
|
There is no need for custom warnings for many common failures.
Introduce a common warning which is consistent and more visible.
|
|
The existing code always checks for USB "interrupt in" events every
millisecond. Although that's okay, it consumes extra bandwidth. This
change interrupt checks to be scheduled according to their requested
interval time.
|
|
Omitting "void" leads to a K&R style declaration which was not intended.
|
|
|
|
Add APM code to 32bit segmented code.
Use 32bit APM code instead of jumping into 16bit mode.
|
|
Create a new code blob (code32seg) with support for 32bit functions
that need to utilize explicit segment accesses.
This code blob uses global variables relative to %gs and with a
dynamic code offset (determined by get_global_offset()).
Add BIOS32 structure and code.
Add code for 32bit PCI BIOS code.
|