Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Place .code32 in those functions that need it, and make sure every
function ends in .code16 mode.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The floppy Programmed IO code really should yield while the controller
is busy.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Avoids tools such as layoutrom stumble over localized messages.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-By: Patrick Georgi <pgeorgi@google.com>
|
|
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Some old versions of gcc warn that 'irq might be used uninitialized'.
Replace the switch statement with an if statement to suppress the
warning.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
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 <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
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 <kevin@koconnor.net>
|
|
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 <kevin@koconnor.net>
|
|
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 <kevin@koconnor.net>
|
|
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 <kevin@koconnor.net>
|
|
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 <hare@suse.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Commit 99cb8f3e missed a conversion from 12(%esp) to BREGS_eax(%esp)
causing winxp to break.
Reported-by: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Support reading high memory "direct" framebuffers and translating the
results to 8 bit attribute values.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Instead of hard coding the list of modes, fill them in from the list
of supported modes.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Move the standard video bios definitions into a new header file.
Also, define a struct with the layout for the static functionality
table.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
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 <kevin@koconnor.net>
|
|
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 <kevin@koconnor.net>
|
|
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 <kevin@koconnor.net>
|
|
Allow the custom bda field vbe_flags to be used for flags outside of
vbe.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
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 <kevin@koconnor.net>
|
|
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 <kevin@koconnor.net>
|
|
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
storage.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
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 <kevin@koconnor.net>
|
|
Create macros SAVEBREGS_POP_DSEAX and RESTOREBREGS_DSEAX for saving
and restoring the cpu state. These are similar to the existing
PUSHBREGS and POPBREGS macros.
This also fixes a bug in __farcall16 which inadvertently restored %ds
in %es and vice-versa.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
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 <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>
|
|
Now that the usb controller drivers all support the realloc method,
use that for all pipe allocations, reallocations, and freeing. This
gives the driver more control over the pipe life cycle.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Support alloc, update, and free from the single exported function.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Support alloc, update, and free from the single exported function.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Support alloc, update, and free from the single exported function.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Instead of exporting both xhci_alloc_pipe() and xhci_update_pipe(),
export only xhci_realloc_pipe() and support alloc, update, and free
from it.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Rename usb_getFreePipe() to usb_get_freelist(). Add usb_is_freelist()
and usb_add_freelist() functions.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Also, pass in usbdev to usb_free_pipe().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
This is just function renaming - no code implementation changes.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
This is just function renaming - no code implementation changes.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
This is just function renaming - no code implementation changes.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
This is just function renaming - no code implementation changes.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Previously, the a20 line would always be enabled and left on after
call32_sloppy(). The setting should really be backed up and restored
on each call.
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>
|
|
Add support for jumping into 32bit mode using a System Management Mode
(SMM) handler. When available, this allows SeaBIOS to transition to
32bit mode even when called in vm86 mode. It will also prevent the
clobbering of the segment registers.
Currently, the SMM mode is only supported in QEMU when running in TCG
mode. Also, QEMU v2.1 (or later) is needed for it to work when in
vm86 mode.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
When transitioning back to 16bit mode from within call32(), restore
the full state (cmos index, gdt, fs/gs) in addition to restoring the
original stack.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
This separates call32() into two functions. It also moves the
call16_sloppy() code next to the call32_sloppy() code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Use inline assembler in call16 type functions instead of using
__call16() in romlayout.S.
Since call16() and call16big() are now only called with %ss==0 they do
not need to update the stack pointer. Only call16_sloppy() requires
the stack manipulation code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Add support for a FUNCFSEG macro that will force a "32bit flat" C
function to be located in the f-segment. This is useful for 32bit
code with inline assembler that thunks to 16bit mode.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
With this change, farcall16() is only used for external API calls and
is only invoked from a 32bit mode entered directly via transition32.
farcall16big() is also only used for external API calls and is only
invoked from a 32bit mode entered directly via transition32.
call16_int() now calls _farcall16() directly, and it will use normal
16bit mode or big real mode as required.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|