SeaBIOS Git Change Log

Age Message
11 days 16 hours pciinit: Fix build warning in mch_pci_slot_get_irq()

Some old versions of gcc warn that 'irq might be used uninitialized'.
Replace the switch statement with an if statement to suppress the

Signed-off-by: Kevin O'Connor <>
11 days 17 hours Fix build issue on gcc34

Older versions of gcc may not inline on_extra_stack() and thus cause a
link error when compiling in 32bit segmented mode. Test for MODE16
explicitly in stack_hop_back() to prevent the problem.

Signed-off-by: Kevin O'Connor <>
18 days 22 hours Minor - comment updates in romlayout.S

Signed-off-by: Kevin O'Connor <>
19 days 1 hour Use an aligned stack offset when entering on the extra stack

The size of 'struct bregs' is not evenly divisible by four and where
the assembler placed a 'struct bregs' on the extra stack as part of
entering into the C functions it caused the C functions to run with a
non-aligned stack. It's technically not correct to use an unaligned
stack and it is certainly less efficient.

This patch avoids using BREGS_size (the sizeof struct bregs) and
instead introduces PUSHBREGS_size (the size of the general purpose
registers in struct bregs) in the assembler. Where the code actually
did use the %cs:%ip and flags, an extra 8 (instead of 6) bytes are
added to maintain a sane alignment.

Signed-off-by: Kevin O'Connor <>
1 month 6 days vgabios: Add software cursor capability

Add mechanism for drawing a cursor to the framebuffer to implement a
cursor in software. The timer interrupt is "hooked" so that the
cursor can blink. This can be useful for "coreboot native vga".

Signed-off-by: Kevin O'Connor <>
24 days 23 hours vgabios: Support emulating text mode attributes while in graphics mode

Add support for simple text mode attribute emulation while in graphics
mode. This improves text highlighting and background color on some
boot-loaders. Enable it only for CBVGA vgabios and only when a text
mode is requested.

Signed-off-by: Kevin O'Connor <>
21 days 1 hour Minor - move PORT_PS2_CTRLB from hw/ps2port.h to hw/timer.c

The PORT_PS2_CTRLB port is only used by timers - it's just a
historical artifact that it was part of the original ps2 controller.

Signed-off-by: Kevin O'Connor <>
18 days 2 hours megasas: read addional PCI I/O bar

Some newer cards have the I/O bar at BAR 0, so we need to check
that, too, if we cannot get an address for BAR 2.
Without this patch the new 'megasas-gen2' emulation in qemu
is not detected.

Signed-off-by: Hannes Reinecke <>
Signed-off-by: Gerd Hoffmann <>
Commit 09f876f11743c1143c73a52eb889ae9231f7a5b3, by Hannes Reinecke
21 days 1 hour Fix PNP regression introduced in 99cb8f3e due to missed conversion

Commit 99cb8f3e missed a conversion from 12(%esp) to BREGS_eax(%esp)
causing winxp to break.

Reported-by: Ian Campbell <>
Signed-off-by: Kevin O'Connor <>
1 month 7 days vgabios: Add support for reading framebuffer in "direct" mode

Support reading high memory "direct" framebuffers and translating the
results to 8 bit attribute values.

Signed-off-by: Kevin O'Connor <>
1 month 18 hours vgabios: Fill in available legacy modes in video_func_static at runtime

Instead of hard coding the list of modes, fill them in from the list
of supported modes.

Signed-off-by: Kevin O'Connor <>
1 month 18 hours vgabios: Move standard table definitions to std/vga.h

Move the standard video bios definitions into a new header file.
Also, define a struct with the layout for the static functionality

Signed-off-by: Kevin O'Connor <>
1 month 19 hours vgabios: Only set the dcc_index=8 if stdvga ports are available

Signed-off-by: Kevin O'Connor <>
1 month 21 hours vgabios: Only init BDA device details in init_bios_area()

Don't set the device details when changing modes, and don't set mode
details outside of mode setting.

Signed-off-by: Kevin O'Connor <>
1 month 1 day vgabios: Refactor get/set_cursor_shape() code

Rework the code so that it is possible to calculate the current cursor
shape even when not changing it.

Signed-off-by: Kevin O'Connor <>
1 month 1 day vgabios: Set cursor shape fixes

The "cursor scaling" mode is determined by the first bit of the
video_ctl bda value, not the modeset_ctl value. Also, on a
set_scan_lines() call, the shape should be set to lines-3/lines-2 and
the shape must be set after char_height has been updated.

The existing cursor shape code matches the legacy "lgpl vgabios", but
the behavior doesn't match bios documentation nor observations with an
ati vga bios.

Signed-off-by: Kevin O'Connor <>
1 month 2 days vgabios: Rename vbe_flags to flags

Allow the custom bda field vbe_flags to be used for flags outside of

Signed-off-by: Kevin O'Connor <>
1 month 6 days vgabios: Don't pass vmode_g to vgafb_move_chars() / vgafb_clear_chars()

Now that a pointer to the current video mode info struct is cached in
memory, it's not necessary to pass the struct into the vgafb code.
The vgafb code can lookup the struct itself.

Signed-off-by: Kevin O'Connor <>
1 month 6 days vgabios: Cache a pointer to the current mode struct in the BDA

Cache a pointer to the current mode 'vgamode_s' struct in the BDA to
avoid doing a linear scan of all available vga modes when the struct
is needed.

This uses an additional two bytes in the BDA (at offset 0xbc). It's
possible this could conflict with some other software, but that seams
unlikely because that part of the BDA seems reserved for BIOS and
VGABIOS uses. (And neither SeaBIOS nor Bochs BIOS currently make use
of that area.)

Signed-off-by: Kevin O'Connor <>
1 month 6 days vgabios: Don't declare custom internal BDA storage in std/bda.h

The vgabios uses storage in the BDA at offset 0xb9 for internal custom
storage (the contents do not appear to be part of any bios standard).
Move the description of this custom vgabios area from std/bda.h to
vgasrc/vgabios.h. Add two new macros (GET_BDA_EXT and SET_BDA_EXT).
This should make it more clear that the area is for custom internal

Signed-off-by: Kevin O'Connor <>
1 month 2 days Remove unused macro ENTRY_ST

Signed-off-by: Kevin O'Connor <>
1 month 2 days Do full BREGS backup/restore for pmm, pnp, and irqentry_extrastack

Although these entry points only require backup and restore of the
registers that the C code clobbers, there is no harm in backing up
some additional registers. This allows the BREGS macros to be used
which makes the code a little more readable.

Signed-off-by: Kevin O'Connor <>
1 month 3 days Create assembler macros for saving and restoring 'struct bregs'

and restoring the cpu state. These are similar to the existing

This also fixes a bug in __farcall16 which inadvertently restored %ds
in %es and vice-versa.

Signed-off-by: Kevin O'Connor <>
1 month 3 days Don't clobber %ax on ENTRY_INTO32 macro

There's no need to clobber %ax in ENTRY_INTO32. Now that %eax isn't
clobbered, use ENTRY_INTO32 in entry_csm.

Signed-off-by: Kevin O'Connor <>
1 month 3 days Use 32bit memcpy in int1587 when applicable

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 <>