On Wed, Apr 08, 2015 at 08:48:11PM +0200, Peter Stuge wrote:
Kevin O'Connor wrote:
(Specifically, the "leal" instruction is not properly implemented.)
Unfortunately, there isn't much that can be done about this on the vga bios side.
Really? Impossible to save flags, use other opcodes, and restore flags?
lea isn't used in vgasrc/ besides in the trap that triggers the fault.
In src/romlayout.S lea is used in two places to bump esp before calls. If those code paths are used also by SeaVGABIOS then maybe they could be rewritten with simpler instructions?
The problem is not with leal in hand written assembler - the problem is with leal instructions generated by gcc. To see the assembler gcc produces for the vgabios one can look at out/vgaccode16.raw.s . Or, alternatively, one can run: objdump -m i386 -M i8086 -M suffix -ldr out/vgarom.o
We've fixed up gcc assembler in the past (see scripts/vgafixup.py) to work around x86emu. However, the leal instruction seems painful to patch out - particularly so when %esp is one of the registers read or written in the leal instruction. If anyone wants to take a stab at a workaround, feel free to submit a patch.
-Kevin