aboutsummaryrefslogtreecommitdiffstats
path: root/vgasrc/vgaentry.S
Commit message (Collapse)AuthorAgeFilesLines
* vga: add ati bios tablesGerd Hoffmann2019-03-151-0/+3
| | | | | | | Needed to make drivers happy which try to gather informations from these tables. 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-101-0/+4
| | | | | | | | 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 extra stack if it appears a modern OS is in useKevin O'Connor2015-03-181-2/+16
| | | | | | | | | | | | | | | 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>
* 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-121-0/+30
| | | | | | | | 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>
* 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: 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: 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: Attempt to detect old x86emu and force a fault.Kevin O'Connor2014-02-051-5/+22
| | | | | | | | | | Check for cases where the leal instruction does not work. This instruction is known to not be emulated properly on old versions of x86emu. If a broken version of x86emu is found, force a fault that x86emu will easily detect. This should help prevent soft failures when running old software. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Small improvements to irqentry_extrastack assembler.Kevin O'Connor2013-12-091-2/+1
| | | | | | Simplify the entry assembler slightly. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Avoid memory references via %esp register in vgabios.Kevin O'Connor2013-12-091-5/+2
| | | | | | | | | Win7 interprets the vgabios and it does not properly handle memory references relative to the %esp register. Commit 4a8b58cb introduced some of these %esp references - rework that assembler to avoid these instructions and make win7 happy. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Move initialization code to new file vgainit.c.Kevin O'Connor2013-12-041-1/+1
| | | | | | | 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>
* vgabios: Support allocating an extra stack for vgabios calls and default on.Kevin O'Connor2013-12-041-0/+53
| | | | | | | | | | | | | Add code to allocate an extra stack for the main vgabios int 0x10 entry point. The allocation is done via the PMM spec and uses a PCI v3 permanent low memory region request. This request will work with SeaBIOS - it is unknown how many other main BIOS implementations support this PMM call. The extra stack is useful for old DOS programs that call the VGABIOS and expect it to work with very small amounts of stack space. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Work around lack of support for "calll" in x86emu emulation.Kevin O'Connor2013-12-041-3/+20
| | | | | | | | | Replace 32 bit call instructions with 16 bit call instructions in the vgabios to workaround problems in old versions of x86emu. This change allows fc13 and fc14 to boot. (Other x86emu emulation bugs still prevent fc11 and fc12 from booting.) Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Direct compile 16bit C code instead of including via .S files.Kevin O'Connor2012-02-111-8/+2
| | | | | | | | | | | | Create a ".code16gcc" directive in src/code16gcc.s and use -Wa,src/code16gcc.s to tell gcc to compile directly to 16bit code. This eliminates the need to compile the C code to assembler and include in romlayout.S and vgaentry.S. This also allows those two assembler files to be compiled with debugging (-g) enabled. Also, includes some Makefile cleanups. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Add support for vesa get/set window function.Kevin O'Connor2012-02-011-0/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Place a signature at offset 0x1e of the rom.Kevin O'Connor2011-12-271-0/+4
| | | | | | | It appears some emulators look for a signature at offset 0x1e of the option rom. So, port the signature from the LGPL bios. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Add a PCI header to the VGA ROM if neededJulian Pidancet2011-12-201-1/+10
| | | | | | | | | Allows the ROM to be extracted from a PCI device. V2: * Declare the PCI header in C * Replace #ifdef CONFIG_VGA_PCI with #if CONFIG_VGA_PCI == 1 Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
* Support non-local build directory - allow "make OUT=abc/" to work.Kevin O'Connor2011-01-291-1/+1
| | | | | Don't require the build directory to be the "out/" directory of the SeaBIOS source.
* Minor vga binary cleanups.Kevin O'Connor2010-01-011-1/+3
|
* Define unified entry points for irq handlers.Kevin O'Connor2009-05-161-1/+4
| | | | | | The irq entry points now push the handler address and jump to a function that does parameter setup. This reduces the code size because the entry setup isn't repeated for every handler.
* Add initial port of the "open source vga bios" project.Kevin O'Connor2009-05-061-0/+43
This is an initial import of the code from: http://www.nongnu.org/vgabios/ The code has been ported from bcc to gcc and gas. This is an initial import - many functions have not been ported; many bugs are present.