[coreboot] Share my code of running vgabios(in CBFS) in seabios when rusume from s3.

JasonZhao at viatech.com.cn JasonZhao at viatech.com.cn
Fri Jul 3 09:53:58 CEST 2009

Hi Rudolf	,
I work out some code to make seabios run vgabios when resuming from S3
(follow your advice on IRC, again :) ). And it is unbelievable easy,
only 2 step:

Setp 1: In acpi.c

void acpi_jump_to_wakeup(void *vector)
	/* just restore the SMP trampoline and continue with wakeup on
assembly level */
	memcpy(lowmem_backup_ptr, lowmem_backup, lowmem_backup_size);
-//	acpi_jmp_to_realm_wakeup((u32) vector);

//	seabios at entry_post:(in romlayout.S) will check cmos[0x8f] it
as a S3 resuming flag.
+     outb(0x0f, RTC_BASE_PORT + 0); 
+     outb(0xfe, RTC_BASE_PORT + 1);  

+	//these two lines has same effect with the above two lines, and
I don know 8f or 0f which is better. cmos_read/write in coreboot do not
set bit 7.
+//	outb(0x8f, RTC_BASE_PORT + 0);  
+//	outb(0xfe, RTC_BASE_PORT + 1);  
+	acpi_jmp_to_realm_wakeup(0xffff0); 

Step 2: in seabios->resume.c->s3_resume()
+   vga_setup();
    u32 s3_resume_vector = find_resume_vector();

And my suggest is to rename acpi_jmp_to_realm_wakeup() to
jmp_to_realm_and_back(), and change wakeup.S to be more general by
supporting realmode code that running at >1M address.


More information about the coreboot mailing list