[SeaBIOS] [PATCH 00/11] Relocate init code to high memory

Kevin O'Connor kevin at koconnor.net
Fri Sep 17 01:46:12 CEST 2010


On Thu, Sep 16, 2010 at 03:00:20PM +0200, Gleb Natapov wrote:
> On Thu, Sep 16, 2010 at 08:54:21AM -0400, Kevin O'Connor wrote:
> > I don't understand.  The resume code stays in the f-segment.  When it
> > is called it doesn't relocate itself, and doesn't reference the
> > relocated memory.
> > 
> If relocation is done before checking for S3 resume the following may
> happen:

Relocation is only done after checking for resume.

On a normal boot the code flow is:

reset_vector -> entry_post_official -> entry_post -> _start -> post

(The first two are just stubs for old DOS compatibility.)

On an s3 resume entry_post detects that it is a resume and the code
flow becomes:

reset_vector -> entry_post_official -> entry_post -> handle_resume -> s3_resume

Of the above, the build ensures only post() (and functions/data that
can _only_ be reached via post) are relocated.  So, a resume event
shouldn't be a problem because all of that code/data is left in the
f-segment.

-Kevin



More information about the SeaBIOS mailing list