[SeaBIOS] [PATCH RFC 1/7] Only use -fomit-frame-pointer with 32bit flat code

Julian Pidancet julian.pidancet at gmail.com
Sun Dec 18 01:01:33 CET 2011


On Sat, Dec 17, 2011 at 3:50 PM, Julian Pidancet
<julian.pidancet at gmail.com> wrote:
> On Sat, Dec 17, 2011 at 3:38 PM, Kevin O'Connor <kevin at koconnor.net> wrote:
>> On Fri, Dec 16, 2011 at 02:15:07PM +0000, Julian Pidancet wrote:
>>> The real-mode emulator that Windows 7 uses to execute the vga bios rom
>>> becomes very confused when the code tries to dereference the stack
>>> pointer instead of using the frame pointer, leading to corruption of
>>> parameters passed on the stack from one function to another.
>>>
>>> Signed-off-by: Julian Pidancet <julian.pidancet at gmail.com>
>>
>> Wow - I can only imagine how hard it was to find that.
>>
>> I'm okay with turning off omit-frame-pointer for the vga bios.
>> However, I'd prefer not to turn it off for the main seabios build.
>> Does the emulator also try to emulate parts of the BIOS, which would
>> make that a problem?
>>
>
> Besides the functions which are common to both the BIOS and the VGA
> ROM ( src/output.c and src/util.c), it doesn't seem to make any
> particular problem with the rest of the BIOS.
>

The VGA ROM and the BIOS currently share the same CFLAGS. Due to the
way the Makefile is written at the moment, I can hardly see how to
modify it to compile both binaries with different CFLAGS without
making a mess in the Makefile. Do you have any recommendations ?

-- 
Julian



More information about the SeaBIOS mailing list