| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
You only want this information for debugging. As it also slows down the
boot considerably, as, for example, for every character of the GRUB
menu, something is sent over the serial console.
Therefore, increase the debugging level to 9.
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
|
|
|
|
|
|
|
|
| |
Move the generic function and variable definitions from vgabios.h to a
new file vgautil.h. This reduces the size and complexity of
vgabios.h.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
| |
Move the full video_param_table[] setup (including the updating of the
BDA) to stdvga_build_video_param().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
| |
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
| |
The software cursor code is not frequently used (only the coreboot
framebuffer vga code uses it). Move its logic out of the main code
and into swcursor.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
| |
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
| |
Introduce a new function vgafb_scroll() to scroll a window on the
screen and update vgabios.c to use only that function for scrolling.
This makes the low-level vgafb_move_chars() and vgafb_clear_chars()
local to vgafb.c, and it simplifies the callers.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the last mode set (while not in vm86 mode) was done from a VBE mode
set call then disable the extra stack. This works under the premise
that only a modern OS would invoke the VBE mode changing facilities
and a modern OS would always call the vgabios with sufficient stack
space.
This is an ugly hack to work around a problem Windows Vista (and
possibly later Windows releases) has with the VGA BIOS using a stack
in the e-segment.
Reported-by: Richard Laager <rlaager@wiktel.com>
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
Add code for manipulating "direct" style linear RGB framebuffers that
may be in high memory.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
| |
Factor out code that calculates the text mode address of a given
character.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
|
| |
The vgabios graphics manipulations can all be implemented on top of 4
basic primitives: read 8 pixels, write 8 pixels, move pixels, and
clear pixels. Implement these four operators for all the graphics
modes and rewrite the graphics functions in vgafb.c to use them. This
simplifies the graphics code as the high level logic no longer needs
to be implemented for each graphical framebuffer type.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
| |
Rewrite the low-level scroll code so that it is implemented using two
basic operations: move text and clear text. This simplifies the
low-level code as it no longer needs to handle up scrolling vs down
scrolling. Determining the direction of the scroll is now done in the
higher level (vgabios.c) code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
| |
Reorganize the save/restore functions to eliminate some boilerplate
code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The structure of the "bios save state area" as returned by
handle_101c() and vbe_104f04() does not follow any particular order.
(And there does not appear to be any documentation that would require
it to follow a particular order.)
So, rearrange the layout of the struct to make save and restore
simpler.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
| |
Move the initialization code out of vgabios.c to a new file to reduce
the size of the vgabios.c file.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The cirrus_clear_vram() code wasn't actually doing anything because of
a u8 overflow. Fix that.
Fill with 0xff when performing a legacy cirrus mode switch (WinXP has
been observed to incorrectly render dialog boxes if the memory is
filled to 0). This was the behavior of the original LGPL vgabios
code. To support this, add mechanism (MF_LEGACY) to allow vga drivers
to detect if the mode switch is from vesa or int10.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Gcc seems to handle passing structs by value if they are 4 bytes in
size instead of 3 bytes. So, add a pad byte to struct carattr and
struct cursorpos.
Reorganize set_cursor_pos(), verify_scroll(), and handle_1013() so
there are less live variables.
Don't inline the VBE functions into the main handler code. Code
calling VBE functions are newer and are more likely to provide
adequate stack space - inlining can cause more stack usage for older
functions (which may be stack constrained).
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>
|
|
|
|
| |
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
| |
Check for the case where the option rom is executed a second time - in
that case re-init the hardware, but do not set any variables. This
should make the rom better behaving when run from S3 resume.
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>
|
|
|
|
|
|
|
|
|
|
| |
Always setup the BDA on a mode switch. Call that BDA setup code
unconditionally.
Also, always set vbe_mode and use that for finding the current mode
and for reporting the mode to vbe callers.
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>
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Unify the code for the Cirrus and VBE vesa functions 00-03.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
|
| |
Introduce new global variables (VBE_enabled, VBE_total_memory,
VBE_capabilities, VBE_framebuffer) to replace the need for function
calls that were specific to bochsvga.
Replace info received from bochsvga_mode_info with info found in
vgahw_find_mode.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
| |
Extract out the fields in 'struct vgamode_s' that are used in the main
code. The remaining fields are specific to the standard vga hardware
driver.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous code could obtain the page size in different ways - from
vmode_g->sslength, from SCREEN_MEM_START, or by manually multiplying
cols and rows. Add a new func (calc_page_size) and use that in areas
that need to calculate the page size.
Convert readers of the page size to read it from the "video_pagesize"
entry in the BDA instead of recalculating it.
Remove the page size from struct vgamode_s (slength) as it is now
calculated dynamically. The new calculated versions are different
from the existing values exported in video_param_table. However, the
existing values (for CGA) did not look correct - I compared the values
to those exported by two other VGA BIOS manufacturers and used the
values that look more standard.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
| |
Replace the custom flags with the flags defined in the VBE spec.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use the same function signature for cirrus, bochsvga, geodelx, and
stdvga init code.
Have each hardware type explicitly call stdvga_init when needed.
To unify bochsvga_init() signature, store the device BDF passed into
the optionrom init code in a global variable (VgaBDF).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
| |
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Split out the BDA setup part of vga_set_mode to new function
modeswitch_set_bda. Move the remaining parts (palette loading, screen
clearing, font loading) of vga_set_mode into stdvga_set_mode.
Add new mode switching flags and pass them to stdvga_set_mode, so it
does not need to inspect modeset_ctl directly.
Move code needed by stdvga_set_mode (perform_gray_scale_summing,
clear_screen) to stdvga.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
| |
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
| |
Also, introduce stdvga.h.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
| |
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Also, rename vgatables.h to vgabios.h.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|