[SeaBIOS] [RFC 2/3] Transitions to and from 64 bits

Kevin O'Connor kevin at koconnor.net
Mon Sep 21 17:06:07 CET 2015


On Mon, Sep 21, 2015 at 06:23:54PM +0200, Marc Marí wrote:
> On Mon, 21 Sep 2015 12:03:29 -0400
> "Kevin O'Connor" <kevin at koconnor.net> wrote:
> > Also, your code seems to run regular 32bit code when in "long mode" -
> > is that valid?
> 
> It doesn't crash. And I think it's valid. When dissasembling, the 64 bit
> operations have the prefix 0x48, the same that happens in a "normal" 64
> bit application.

It looks like "push" and "pop" have different semantics in "long
mode".  It looks like they decrement the stack by 8 bytes even for
32bit operands.  There may be other instructions as well.

So, I don't think we'd want to run 32bit generated gcc code when in
64bit mode.

-Kevin



More information about the SeaBIOS mailing list