[SeaBIOS] [PATCH v2] qemu: fast boot when linuxboot optionrom is used

Kevin O'Connor kevin at koconnor.net
Wed Dec 5 18:00:00 CET 2018


On Fri, Nov 30, 2018 at 11:23:30AM +0100, Stefano Garzarella wrote:
> On Thu, Nov 29, 2018 at 5:55 PM Kevin O'Connor <kevin at koconnor.net> wrote:
> > Interesting.  I tracked down this printf delay - it's due to the
> > save/restore of cpu state when thunking to 16bit mode.  (For every
> > character displayed on the screen the code enters 16bit mode to invoke
> > the vgabios and it saves/restores the cr0, gdt, fs, gs, a20, nmi
> > states during that process.)  It's trivial to eliminate the calls when
> > there is no vgabios though (see patch below).
> 
> Thanks, the patch works, but unfortunately, when I use qemu
> -nographic, the  /etc/sercon-port is set to PORT_SERIAL1 (in
> src/fw/paravirt.c:623), bypassing the patch.
> Maybe in QEMU is better to set /etc/sercom-port to 0 when there is no
> serial port, or when we want a fast boot.

You should be able to use "-device VGA,romfile=" instead.

> > --- a/src/output.c
> > +++ b/src/output.c
> > @@ -74,6 +74,9 @@ static struct putcinfo debuginfo = { debug_putc };
> >  static void
> >  screenc(char c)
> >  {
> > +    if (!MODESEGMENT && GET_IVT(0x10).segoff == FUNC16(entry_10).segoff)
> > +        // No need to thunk to 16bit mode if vgabios is not present
> > +        return;
> >      struct bregs br;
> >      memset(&br, 0, sizeof(br));
> >      br.flags = F_IF;
> 
> Do you plan to commit this patch?

Only if it's useful - does sercon make it not worthwhile?

-Kevin



More information about the SeaBIOS mailing list