aboutsummaryrefslogtreecommitdiffstats
path: root/vgasrc
Commit message (Collapse)AuthorAgeFilesLines
* version: Update header files now that version.c is not auto generatedKevin O'Connor2016-08-052-1/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgautil: Move definitions from cbvga.h and clext.h to vgautil.hKevin O'Connor2016-08-057-46/+30
| | | | | | | These files only need to export simple function definitions - move them to vgautil.h. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgautil: Move generic definitions from stdvga.h to vgautil.hKevin O'Connor2016-08-056-33/+37
| | | | | | | Don't use stdvga.h for function definitions of code in stdvgamodes.c and stdvgaio.c. Move them to vgautil.h. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgautil: Add new header file with misc function and variable definitionsKevin O'Connor2016-08-0513-37/+57
| | | | | | | | 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>
* vgainit: Move video param setup to stdvga_build_video_param()Kevin O'Connor2016-08-054-14/+14
| | | | | | | 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>
* vgafb: Move header definitions from vgabios.h to new file vgafb.hKevin O'Connor2016-08-046-37/+47
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* swcursor: Concentrate swcursor logic in swcursor.cKevin O'Connor2016-08-045-20/+39
| | | | | | | | 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>
* swcursor: Move swcursor code from vgafb.c to new file swcursor.cKevin O'Connor2016-08-043-57/+67
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Simplify scroll logicKevin O'Connor2016-07-213-69/+64
| | | | | | | | | 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>
* vgabios: Simplify set_cursor_pos()Kevin O'Connor2016-07-041-18/+10
| | | | | | Rework set_cursor_pos() to be slightly simpler. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Don't check for special case of page==0xff on external callsKevin O'Connor2016-07-042-11/+5
| | | | | | | | | | | The original "lgpl vgabios" internally used page=0xff as a mechanism for specifying the current page. It also would allow int1013 calls to externally specify bh==0xff for the current page. However, there is no documentation supporting this as an externally available feature. SeaVGABIOS does not need the internal shortcut; this patch removes the code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Remove special case of dh==0xff in handle_1013()Kevin O'Connor2016-07-041-7/+1
| | | | | | | | | | | The original "lgpl vgabios" had a special case for dh==0xff in its int1013 (write string) code. There does not appear to be any VGABIOS documentation supporting this as an externally available feature. It appears this was for its own internal use when writing its strings to the screen. SeaVGABIOS doesn't use this hack; this patch removes it from the code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Report gcc and binutils versions in debug logKevin O'Connor2015-10-152-0/+2
| | | | | | | Attempt to extract the gcc and binutils versions. Report that information in the debug log. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Rework version generation; don't allow make version overrideKevin O'Connor2015-10-151-0/+5
| | | | | | | | | | | Convert the script to generate the build version from a shell script to a python script. Remove the ability to override the version at build time via "make VERSION=xyz". Replace it with ability to add extra version information at build time via "make EXTRAVERSION=xyz". Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Fix typos found by codespellStefan Weil2015-10-091-1/+1
| | | | | Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgafb: Minor - move gfx_common() variables outside of switch statementKevin O'Connor2015-08-041-12/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: CONFIG_VGA_FIXUP_ASM should depend on CONFIG_BUILD_VGABIOSKevin O'Connor2015-06-151-0/+1
| | | | | | | Add the dependency to CONFIG_VGA_FIXUP_ASM so the menu option only appears when appropriate. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vga: add virtio-vga to kconfigGerd Hoffmann2015-06-111-0/+5
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* vga: rework virtio-vga supportGerd Hoffmann2015-06-111-4/+1
| | | | | | | | Unlike planned earlier virtio-vga will be compatible with the qemu stdvga, with the framebuffer in bar 0. Drop the virtio-vga chunk, update comment accordingly. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* vga: simplify vga buildsGerd Hoffmann2015-06-111-2/+22
| | | | | | | Add a kconfig menu to pick the vga variant, stick the vendorr and device ids as defaults into Kconfig. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* vgabios: Emulate "leal" instructionKevin O'Connor2015-04-111-23/+1
| | | | | | | Emulate the "leal" instruction so that the vgabios can run on older versions of x86emu. (This removes the previous "leal" trap.) Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Add config option for assembler fixupsKevin O'Connor2015-04-102-0/+14
| | | | | | | | Add a kconfig build option (CONFIG_VGA_FIXUP_ASM) to allow users to build the vgabios without the complex assembler fixups that work around emulator bugs. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Don't use "smsww" instruction - it confuses x86emuKevin O'Connor2015-04-101-1/+1
| | | | | | | | | | Commit 251e2638 introduced the "smsww" instruction to the vgabios. Unfortunately, it appears at least some versions of x86emu crash when executing that instruction (eg, FC13 installer crashes). That instruction wasn't required to work around the problem fixed in 251e2638, so just avoid it. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Don't use extra stack if it appears a modern OS is in useKevin O'Connor2015-03-183-3/+25
| | | | | | | | | | | | | | | 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>
* vgabios: On bda_save_restore() the saved vbe_mode also has flags in itKevin O'Connor2015-03-171-1/+1
| | | | | | | When restoring a saved state, make sure to remove any flags from the video mode prior to searching for that mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Support emulated text in gfx_read_char()Kevin O'Connor2015-01-071-6/+19
| | | | | | | | | | | | | When emulating text mode on "coreboot framebuffer" SeaVGABIOS, return a foreground and background attribute from gfx_read_char() and prefer returning a space character (instead of null) on blank cells. This also returns the foreground color (instead of always returning zero) for regular graphics mode gfx_read_char() calls. This seems fine as tests show other vgabios implementations also return various values here. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: implement read char in graphics modePaolo Bonzini2015-01-061-12/+41
| | | | | | | | | | | | | | | GWBasic relies on this, so implement it to enable some serious retrocomputing. There is no better way to do it than trying to match all characters one by one against the current font. This makes it possible to actually do something in SCREEN 1 and SCREEN 2 (without it, you can use graphics in the programs but not in direct mode). I couldn't find documentation for what to return as the attribute, but experimenting with DOSBox suggests 0 (and GWBasic accepts it). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: fix graphics operation with Bochs VGA in non-DISPI modesPaolo Bonzini2015-01-061-8/+19
| | | | | | | | | For legacy VGA modes that do not set the VBE_DISPI_ENABLED bit, bochsvga_get_linelength returns 0. Thus all characters are squashed into the first scanline. Fix this by falling back to stdvga for the legacy modes. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* Use an aligned stack offset when entering on the extra stackKevin O'Connor2014-11-121-10/+10
| | | | | | | | | | | | | | | | 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>
* vgabios: Add software cursor capabilityKevin O'Connor2014-11-126-5/+143
| | | | | | | | 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>
* vgabios: Support emulating text mode attributes while in graphics modeKevin O'Connor2014-11-125-10/+47
| | | | | | | | | 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>
* vgabios: Add support for reading framebuffer in "direct" modeKevin O'Connor2014-10-271-5/+32
| | | | | | | Support reading high memory "direct" framebuffers and translating the results to 8 bit attribute values. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Fill in available legacy modes in video_func_static at runtimeKevin O'Connor2014-10-273-2/+12
| | | | | | | 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>
* vgabios: Move standard table definitions to std/vga.hKevin O'Connor2014-10-274-67/+16
| | | | | | | | 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>
* vgabios: Only set the dcc_index=8 if stdvga ports are availableKevin O'Connor2014-10-271-2/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Only init BDA device details in init_bios_area()Kevin O'Connor2014-10-272-20/+8
| | | | | | | 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>
* vgabios: Refactor get/set_cursor_shape() codeKevin O'Connor2014-10-273-32/+29
| | | | | | | 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>
* vgabios: Set cursor shape fixesKevin O'Connor2014-10-271-11/+7
| | | | | | | | | | | | | 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>
* vgabios: Rename vbe_flags to flagsKevin O'Connor2014-10-272-4/+7
| | | | | | | Allow the custom bda field vbe_flags to be used for flags outside of vbe. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Don't pass vmode_g to vgafb_move_chars() / vgafb_clear_chars()Kevin O'Connor2014-10-273-19/+19
| | | | | | | | 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>
* vgabios: Cache a pointer to the current mode struct in the BDAKevin O'Connor2014-10-272-2/+7
| | | | | | | | | | | | | | 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>
* vgabios: Don't declare custom internal BDA storage in std/bda.hKevin O'Connor2014-10-273-8/+21
| | | | | | | | | | | 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>
* Create assembler macros for saving and restoring 'struct bregs'Kevin O'Connor2014-10-271-20/+2
| | | | | | | | | | | 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>
* vgabios: Fix broken build resulting from e5749978.Kevin O'Connor2014-07-011-2/+1
| | | | | | | | The e5749978 commit added -fno-merge-constants to the compile flag. That option changes the names of ".rodata" sections. Update vgalayout.lds.S so that the vgabios can continue to build. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Use .code16 not .code16gccDavid Woodhouse2014-06-051-1/+1
| | | | | | | | There's no need to use .code16gcc where we are writing assembler code explicitly. It only affects word-size-ambiguous instructions, and we should just be explicit. And we are. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* vgabios: Return from handle_1011() if handler found.Kevin O'Connor2014-05-281-9/+9
| | | | | | | Fix cut-and-paste error in handle_1011() causing spurious debug_stub() calls when CONFIG_VGA_STDVGA_PORTS is enabled. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Add debug message if x86emu leal check triggers.Kevin O'Connor2014-05-131-0/+10
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Define PlatformRunningOn to make compile happy.Kevin O'Connor2014-04-141-0/+3
| | | | | | | | With CONFIG_COREBOOT=y, CONFIG_QEMU_HARDWARE=y, CONFIG_VGA_COREBOOT=y, CONFIG_DEBUG_IO=y the compile would break because this variable was missing. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Minor - replace some tab characters that slipped into the code.Kevin O'Connor2014-04-111-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Initial support for coreboot native vga vgabios.Kevin O'Connor2014-04-116-3/+249
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>