Subject: Re: boot loader timeout under qemu
To: None <port-i386@NetBSD.org>
From: Alan Barrett <apb@cequrux.com>
List: port-i386
Date: 08/06/2005 15:20:18
On Sat, 06 Aug 2005, Rui Paulo wrote:
> On 2005.08.06 13:32:38 +0000, Alan Barrett wrote:
> | When booting an i386 system in a virtual machine under qemu
> | (pkgsrc/emulators/qemu), the second stage boot loader's timeout expires
> | much too quickly.  If I set the timeout to 6000 seconds (via installboot
> | -o timeout=6000), then I observe it counting down at about 100 counts
> | per second, instead of 1 count per second.

> I think this is not a NetBSD problem, unless you only experience it
> when running qemu on top of NetBSD. I've had some problems with
> how qemu emulates the clock device, so I'm not really surprised.
> 
> Did you tried other operating systems ? What happened ?

I'll probably try a configuration like
real-machine/linux/qemu/virtual-machine/netbsd or
real-machine/freebsd/qemu/virtual-machine/netbsd
in the next few days.

I am now fairly sure it's a qemu bug.  The
implementation of BIOS call INT 15H function 86H" in
pkgsrc/emulators/bochs/work/bochs-2.1.1/bios/rombios.c contains a
loop that reads from port 0x61, expecting the 0x10 bit to toggle
every 15 microseconds.  The part of qemu that emulates that port
(pkgsrc/emulators/qemu/work/qemu-0.7.0/hw/pc.c:speaker_ioport_read())
just toggles the bit on every read.

--apb (Alan Barrett)