Subject: Re: Running NetBSD on ...pkgsrc/emulators/bochs
To: <>
From: David Laight <david@l8s.co.uk>
List: port-i386
Date: 01/10/2004 14:25:23
On Sat, Jan 10, 2004 at 04:31:16AM -0600, Richard Rauch wrote:
> I've been playing some with bochs.  (We bounced some messages around netbsd-help
> on the more general issue of running bochs as an application from pkgsrc, but
> this message is about running NetBSD/i386 *on* bochs...*on* NetBSD.  (^&)
> 
> I'm getting a ton of lines to the .txt log file about setting LBA for the
> hard disk.  Is this normal?  The log file is now over 250,000 lines long,
> almost all of which (basically all but the first few lines) are of the general
> form:
> 
> 121048474343i[HD   ] enabling LBA mode

Find that message in the bochs source and delete it.....

> Could this be related to the terrible performance that NetBSD gets on bochs?

Probably not, the cost of the message itself is trivial.

Disk accesses are slow because the 'rep insl' is emulated for each cycle
(rather than being emulated as a single instruction).  Also if you trace
though any system calls you'll see that the lockmanager code paths are
rather longer than you would ideally desire.

> I've noticed that NetBSD can become positively *snappy* if you turn off the
> "pit: realtime=1" option and set the "ips: " number *low*.  Basically, this
> tells bochs to update the virtual clock very rapidly.  NetBSD then reports
> a CPU speed corresondingly low, and apparently uses the low speed to calibrate
> some timing loops.  Since it's all virtual anyway, short loops are fine for
> nearly everything.  NetBSD would be usable this way...EXCEPT:

I suspect that attempts to calibrate cpu timing loops fail miserably
under bochs.  Since any timing loops are there to wait for slow hardware
bochs won't need them anyway.

> Without "pit: realtime=1", NetBSD gets a screwey key-repeat set so high that
> it is impossible for me to type a key without getting a lot of repeats.

Try playing with the bochs keyboard delays, I've run with:

vga_update_interval: 30000
keyboard_serial_delay: 250
keyboard_paste_delay: 100000
ips: 20000000

> I was wondering what you were doing to get files onto the bochs drive
> after installing

Shutdown bochs and mount the 'disk' under vnc.
But make absolutely sure you delete the vnc device before running bochs.

You can also get the serial console to drive a pty - you probably need
to add netbsd (after freebsd) in a #if somewhere.

	David

-- 
David Laight: david@l8s.co.uk