qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Announcing qboot, a minimal x86 firmware for QEMU


From: Kevin O'Connor
Subject: Re: [Qemu-devel] Announcing qboot, a minimal x86 firmware for QEMU
Date: Mon, 25 May 2015 11:05:17 -0400
User-agent: Mutt/1.5.23 (2014-03-12)

On Mon, May 25, 2015 at 09:21:49AM +0300, Vasiliy Tolstov wrote:
> 2015-05-23 6:55 GMT+03:00 Kevin O'Connor <address@hidden>:
> > Out of curiosity, I ran some additional timing tests.  With SeaBIOS
> > fully stripped down (via Kconfig), it takes ~20ms to get to the boot
> > phase on my old AMD system.  Of that 20ms, ~7ms is to enable shadow
> > ram, 2ms is to calibrate the cpu timestamp counter, 4ms is for pci
> > init, and ~6ms is to make the shadow ram area read-only.  The time in
> > the remaining parts of the SeaBIOS code is so small that it's hard to
> > measure.
> 
> Can you share config for seabios? As i understand i can safety to
> remove keybord, ps2, usb, ata/ahci and leave only virtio (in case of
> using qemu to boo linux/freebsd/windows systems) ?

To get to 20ms, I basically disabled everything.  (Actually, after
sending my last email I found I cound get to 16ms by setting
CONFIG_WRITABLE_UPPERMEMORY=y - it avoids much of the shadow ram
read-only cost.)  It's not possible to actually boot anything with
this config - I was instead timing to the point where one could add a
multiboot or vmlinux boot capability to SeaBIOS.

To get to these times I disabled debug messages themselves (they take
a few ms of the boot time).  So, to time events without debug messages
I added a few outb() calls to seabios at critical points.  See patch
and config below.

-Kevin


--- a/src/post.c
+++ b/src/post.c
@@ -167,11 +167,15 @@ platform_hardware_setup(void)
     // Init base pc hardware.
     pic_setup();
     mathcp_setup();
+    outb('3', 0x402); outb('\n', 0x402);
     timer_setup();
+    outb('4', 0x402); outb('\n', 0x402);
     clock_setup();
 
     // Platform specific setup
+    outb('5', 0x402); outb('\n', 0x402);
     qemu_platform_setup();
+    outb('6', 0x402); outb('\n', 0x402);
     coreboot_platform_setup();
 }
 
@@ -200,6 +204,7 @@ startBoot(void)
     // Clear low-memory allocations (required by PMM spec).
     memset((void*)BUILD_STACK_ADDR, 0, BUILD_EBDA_MINIMUM - BUILD_STACK_ADDR);
 
+    outb('8', 0x402); outb('\n', 0x402);
     dprintf(3, "Jump to int19\n");
     struct bregs br;
     memset(&br, 0, sizeof(br));
@@ -247,6 +252,7 @@ maininit(void)
     prepareboot();
 
     // Write protect bios memory.
+    outb('7', 0x402); outb('\n', 0x402);
     make_bios_readonly();
 
     // Invoke int 19 to start boot process.
@@ -331,12 +337,14 @@ handle_post(void)
 
     serial_debug_preinit();
     debug_banner();
+    outb('1', 0x402); outb('\n', 0x402);
 
     // Check if we are running under Xen.
     xen_preinit();
 
     // Allow writes to modify bios area (0xf0000)
     make_bios_writable();
+    outb('2', 0x402); outb('\n', 0x402);
 
     // Now that memory is read/writable - start post process.
     dopost();


Attachment: .config
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]