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

Gleb Natapov gleb at redhat.com
Thu Sep 16 15:00:20 CEST 2010


On Thu, Sep 16, 2010 at 08:54:21AM -0400, Kevin O'Connor wrote:
> On Thu, Sep 16, 2010 at 02:40:05PM +0200, Gleb Natapov wrote:
> > On Thu, Sep 16, 2010 at 08:38:31AM -0400, Kevin O'Connor wrote:
> > > On Thu, Sep 16, 2010 at 08:35:16AM +0200, Gleb Natapov wrote:
> > > > On Wed, Sep 15, 2010 at 10:31:36PM -0400, Kevin O'Connor wrote:
> > > > > This patch series enables SeaBIOS to relocate itself out of the
> > > > > e-segment, which enables that space to be used by optionroms.
> > > > > 
> > > > How resume from S3 is affected by this change?
> > > 
> > > It shouldn't be.  The resume detection and handling code
> > > (src/resume.c) is not relocated.  It will detect the resume and handle
> > > it as it did before.
> > > 
> > Before code relocation? Otherwise relocation can clobber OS memory.
> 
> 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:

1. BIOS starts and relocates POST code to address A
2. BIOS runs POST and boots an OS
3. OS puts most important info into address A
4. OS does S3 suspend
5. S3 resume happens
6. BIOS start and relocates POST code to address A
7. BIOS checks for S3 and jumps to resume vector
8. OS can't resume since address A is corrupted

So the question is what happens first check for S3 resume or POST code
relocation?

--
			Gleb.



More information about the SeaBIOS mailing list