Firstly, you need download two patchs:the Kevin's for using Seabios as payload, and Rudolf's for s3.
http://www.coreboot.org/pipermail/coreboot/2008-September/038551.html
www.coreboot.org/pipermail/coreboot/2008-January/028787.html
Then there are two steps to do (Rudolf gave me much advice on IRC :-) , he is a good teacher)
#1 Since OS put some realmode code to the s3 resume vector before it demands the mainboard to enter sleep,
we need to backup the resume code before coreboot using real memory(may destroy the resume code) and recovery it before Coreboot jumps into the resume vector.
In the main()of cache_as_ram_auto.c, just before the stack switching code, add this:
if( (bootmode == 3){
print_debug("copy memory to high memory to protect s3 wakeup vector code \r\n");
memcpy((unsigned char *)(highmem_bakaddress),(unsigned char *)0, 0x100000);//highmem_bakaddress=512M-xxM
}
In the acpi_jump_wake() of wakeup.c, add this:
memcpy((unsigned char *)(resumevector), (unsigned char *)(highmem_bakaddress+resumevector), 0x1000);
//(ubuntu's vector=0x2000, XP's =0x1c000, but you should just get this from the FACS table as in Kevin's patch, even he move the FACS to the highend memory)
#2 Since when resume from S3, coreboot do not go into payload, so in vga driver codes need be added to do vga init after it judged that this is a boot waked from s3.
if(acpi_sleep_type==3)
{printk_debug("Enable VGA console\n");
vga_enable_console();}
if(acpi_sleep_type==3)
{xxxxxx}
if(acpi_sleep_type==3)
{xxxxxx}
Hi Jason,
Just a quick note. Did you put whole coreboot to some high memory (the TEXT_BASE or whatever it has name for it - and reserve that memory)? If so, then must be just checked if coreboot changed some low memory. You can check it with the memory poison technique, check the previous mail. Maybe no other backups will be needed? Maybe the S4 resume from windows does not work because of some related memory corruption.
Rudolf
On Wed, Nov 19, 2008 at 11:56:34AM +0800, JasonZhao@viatech.com.cn wrote:
Firstly, you need download two patchs:the Kevin's for using Seabios as payload, and Rudolf's for s3.
http://www.coreboot.org/pipermail/coreboot/2008-September/038551.html
www.coreboot.org/pipermail/coreboot/2008-January/028787.html
[...]
#2 Since when resume from S3, coreboot do not go into payload, so in vga driver codes need be added to do vga init after it judged that this is a boot waked from s3.
if(acpi_sleep_type==3)
{printk_debug("Enable VGA console\n"); vga_enable_console();}
The bochs project just added S3 support to their code. This required adding S3 resume support into SeaBIOS. This support might also be useful to coreboot.
If it is desirable, we could have coreboot jump to SeaBIOS' post vector (f000:fff0) on an S3 resume instead of the OS. SeaBIOS would then find the ACPI FACP table and resume the OS. This might be useful if we want SeaBIOS to do vga option rom init on resume instead of having coreboot do the init.
-Kevin
-jasonzhao
-----Original Message----- From: Kevin O'Connor [mailto:kevin@koconnor.net] Sent: Friday, December 19, 2008 11:57 AM To: Jason Zhao Cc: coreboot@coreboot.org; r.marek@assembler.cz Subject: Re: [coreboot] 2 keypoints to use coreboot+seabios to achieveWINDOWS-XP's s3 sleep/resume
On Wed, Nov 19, 2008 at 11:56:34AM +0800, JasonZhao@viatech.com.cn
wrote:
Firstly, you need download two patchs:the Kevin's for using Seabios
as
payload, and Rudolf's for s3.
http://www.coreboot.org/pipermail/coreboot/2008-September/038551.html
www.coreboot.org/pipermail/coreboot/2008-January/028787.html
[...]
#2 Since when resume from S3, coreboot do not go into payload, so in
vga
driver codes need be added to do vga init after it judged that this
is a
boot waked from s3.
if(acpi_sleep_type==3)
{printk_debug("Enable VGA console\n"); vga_enable_console();}
The bochs project just added S3 support to their code. This required adding S3 resume support into SeaBIOS. This support might also be useful to coreboot.
If it is desirable, we could have coreboot jump to SeaBIOS' post vector (f000:fff0) on an S3 resume instead of the OS. SeaBIOS would
Jumping (f000:fff0) is used in V3? , I remember coreboot-v2 jump to SeaBios via a "elf" way.
then find the ACPI FACP table and resume the OS. This might be useful if we want SeaBIOS to do vga option rom init on resume instead of having coreboot do the init.
-Kevin
On Fri, Dec 19, 2008 at 12:18:36PM +0800, JasonZhao@viatech.com.cn wrote:
If it is desirable, we could have coreboot jump to SeaBIOS' post vector (f000:fff0) on an S3 resume instead of the OS. SeaBIOS would
Jumping (f000:fff0) is used in V3? , I remember coreboot-v2 jump to SeaBios via a "elf" way.
On a normal boot, SeaBIOS would be copied to ram at 0xf0000 and coreboot would jump to its elf entry point.
On an S3 resume, it is important that coreboot not overwrite the memory at 0xf0000. We could re-use the elf entry point for S3 resume, but because we're not actually deploying the elf into memory it may be simpler to use the standard 16bit entry point (f000:fff0).
-Kevin