| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Rename memmap.c to e820map.c as the code in that file only deals with
maintaining the e820 map. Move all the e820 definitions to new file
e820map.h and use a consistent "e820_" prefix on all exported
functions.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
| |
If the amount of data to be copied is an even number of four, then
copy the data in four byte chunks. This 32bit copy is more efficient,
in particular when copying to/from memory mapped io. This should
improve the performance of framebuffer draws in cbvga SeaVGABIOS.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
| |
Although the a20 functionality was originally implemented in the ps2
controller, that is just a historical artifact. It's a core feature
of modern x86 cpus and the code is better located in the x86.h header.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
Move the inb(), insb(), etc. code from ioport.h to x86.h. Move the
PORT_* definitions to their appropriate hardware files.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
| |
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
| |
Also, sort the order of include files in the c files.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
| |
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
| |
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
| |
Move many C files from the src/ directory to the new src/hw/ directory.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Preface PIC functions with a pic_ to provide a more consistent
naming.
Convert the irqmask code to a more consistent
pic_irqmask_read/write/mask form.
Move code from pic.h to pic.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
| |
Calculate a LegacyRamSize directly from the e820 map for use by
handle_1588() and handle_15e801() (the only two external interfaces
that require "RamSize"). All other users of the existing RamSize (and
RamSizeOver4G) variables are specific to QEMU, so move the
declarations to paravirt.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
|
| |
Convert all users of the alternative variable exports to VARFSEG.
There isn't a significant distinction between the existing types of
exports, so it's simpler to just use one type going forward.
The new VARFSEG declaration is only emitting when in 32bit mode, so
update and move some variables as needed.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
| |
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
| |
Before transitioning back to real mode, the segment registers should
be reloaded so that the hidden register limits are updated.
|
| |
|
|
|
|
|
| |
Int1589 switches into protected mode for the caller.
Also, consistently use BUILD_BIOS_ADDR/SIZE in GDT macros.
|
|
|
|
|
|
|
|
| |
Don't use "fail" in the debug output - as this confuses users.
When reporting on an invalid parameter - use the word "invalid".
When reporting on an unimplemented call - state it is unimplemented.
Add separate debug levels for unimplemented vs invalid calls.
Also, increase the debug level of several entry points.
|
|
|
|
|
|
|
|
| |
Add new function yield() which will permit irqs to trigger.
The yield() call enables irqs to occur in 32bit mode.
Add [num]sleep calls that yield instead of just spinning.
Rename existing int 1586 usleep call to biosusleep.
Convert many calls to mdelay to msleep.
|
|
|
|
|
| |
Sometimes VAR16_32 is used to export a definition to assembler, so
clarify its naming.
|
| |
|
| |
|
|
|
|
|
|
| |
The "flat" mode variants work in real mode, but will not work in
protected mode. So, replace with versions that take explicit
segments.
|
|
|
|
|
|
|
|
| |
The term "far pointer" is used in many 16bit specs, and it is
different from what MAKE_FARPTR creates. So, use the term "flat
pointer" in the code to distinguish between the two meanings.
Also, use the suffix "_fl" consistently when working with "flat
pointers".
|
|
|
|
|
|
|
| |
Define the e820list as a regular array.
Define a buffer for run-time built bios tables.
Reserving the space in advance should help prevent run-time errors
when space becomes tight.
|
|
|
|
|
|
|
|
| |
Define macro VAR16FIXED for declaring a variable at a fixed location.
Introduce new file src/misc.c, and move non int15 calls from system.c
to it.
Implement all fixed location variables in C code.
Move IDT/GDT defs to misc.c. Remove unused gdt entry 1.
|
|
|
|
|
|
|
|
| |
Change license of contributions from Kevin O'Connor from GPLv3 to
LGPLv3 (or later). Since the work as a whole is based on Kevin's
contributions and the "bochs bios" which has a license of LGPL (v2 or
later), this effectively makes the work as a whole available under
LGPLv3 (or later).
|
|
|
|
|
|
|
|
|
| |
Avoid using call16_int() -- it consumes too much stack space.
Instead, use a new function (call16_simpint). This assumes that
the handler wont corrupt regs - which should be a safe assumption,
because if they did corrupt regs they wouldn't work on any bios.
Avoid enabling irqs in the hw irq handlers - there are no loops in the
handlers that could cause any notable latency.
|
|
|
|
|
| |
For those places that repeatedly read/write to the ebda, caching the
ebda segment improves code generation.
|
|
|
|
|
|
|
| |
Rename VAR16 to VAR16_32 -- that macro supports accesses from both
16bit and 32bit mode.
Introduce a new macro VAR16 that must be present on all global
variables accessed from 16bit mode.
|
| |
|
|
|
|
|
|
| |
Add VAR16 macro to enable a variable to be available in both 32bit and
16bit code. This reduces the occurrences of "#if MODE16".
Also add ASM16 macro to reduce occurrences of "#if MODE16".
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Also, only route hw irqs to their handlers when they are enabled.
(This ensures that if a subsystem is disabled that the default
hwirq handler will be used.)
Add helper macros to declare the extern asm handlers.
Always enable the RTC hwirq at startup (as opposed to when it is first
used).
Fix bug in default handler - wrong bit was used for checking the
cascaded irq.
|
|
|
|
| |
Define and consistently use names for the bits in the cr0 register.
|
|
|
|
|
|
|
| |
Fix two apparent bugs - set_a20() returned new status instead of old
status and handle_152402() checked wrong bit.
Add bit definition for the a20 enable bit: A20_ENABLE_BIT
Allow ioport.h #defines to be used in romlayout.S.
|
|
|
|
|
|
|
| |
Allocate the e820 map space in the 0xf0000 segment and do all updates
in place. This reduces the need to access external memory during
post.
Also, move e820 pointer and count from ebda to variables in 0xf0000.
|
| |
|
|
|
|
|
| |
The VIA vga bios likes wants to call int 15/5f of main bios. So, add
stubs to make it happy.
|
|
|
|
|
| |
The rom16.o object will now have absolute (32bit applicable) addresses.
Replace several 0xf0000 and 0x10000 uses with CONFIG_BIOS_ADDR/SIZE macros.
|
| |
|
|
|
|
|
|
| |
Add new file (pic.h) with helpers for accessing the PIC.
Move irq enabling code to the files that use those interrupts.
Also, don't setup for floppy if floppy support not enabled.
|
|
|
|
| |
This allows one to easily enable verbose output from handlers.
|
|
|
|
|
| |
Build e820 maps at post time; just copy the pre-built ones at runtime.
Add support for populating memory and map info from coreboot.
|
|
|
|
| |
These functions are equivalent to set_fail() - but don't log an error.
|
|
|
|
|
|
| |
The old usleep implementation relied on ps2 port refresh bit which is
not very portable.
This patch also refactors some of the code in clock.c.
|
|
|
|
|
|
|
| |
Add new option for targetting a coreboot payload.
When in coreboot mode, configure out those parts of the code that wont
work on real hardware.
Don't include cmos.h in files that don't need it.
|