[Simh] OpenBSD and simh networking

Markus Weber simh at nather.com
Sun Feb 22 14:12:30 EST 2004


I have revisited OpenBSD 3.4 and can confirm that the disk initialization
problem persists. If somebody else wants to look at it, I can upload a new
set of disk images to play with.

Here is what I remember. The OpenBSD boot kernel (bsd.rd) doesn't have an
issue with MSCP device initialization. I'm not entirely familiar with the
details, but the bsd.rd kernel has the root filesystem on a RAM disk, which
I believe to be loaded by the boot loader rather than the BSD kernel. By the
time an MSCP disk is manually mounted, the system is probably busy enough to
make the initialization work.

Way back when I compared the driver sources of OpenBSD and Quasijarus; the
NetBSD drivers bury the MSCP code too deeply. OpenBSD essentially posts the
ONLINE command to the controller and then (t)sleeps for some period of time.
For the ONLINE command to succeed, the device interrupt must wake the driver
out of a sound sleep. Given that adding debug prints works around the
problem, it's a fair guess the interrupt is delivered too early.

The Quasijarus driver uses a different approach. After posting the ONLINE
command, the driver enters a loop in which it alternates between sleeping
and checking for a status flag set by the interrupt handler. Even if the
device interrupt occurs instantaneously, the status won't be lost.

Other than tweaking timing constants within SIMH, the OpenBSD kernel could
conceivably be modified to accomodate SIMH. I'm not sure how much effort
this would require; it could be a near trivial change or it might require
some kludges to the interaction of the driver's top and bottom halves.


On another topic, some kind soul posted a patch to SIMH that replaced the
pcap-type networking with tuntap. This patch is intended for Linux, although
it might work on FreeBSD as well. I wonder if anybody has considered to make
the network transport used by SIMH a configurable option. Support for UML's
switch daemon is particularly appealing...

On Linux, the limitations of the pcap library are easy to work around, using
either Hans Rosenfeld's taptap utility or by simply preconfiguring one or
more tuntap devices and setting them up in a bridge with the physical
ethernet device if so desired. On the other hand, in order to make the
choice of pcap, tuntap, or other low-level interfaces a configurable option
would require extensive changes to the networking code and to a lesser
extent to the command line language. By and large, the network driver would
have to be split into a generic SIMH API and transport-specific modules.

-Markus

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.593 / Virus Database: 376 - Release Date: 2/20/2004




More information about the Simh mailing list