Subject: Re: Return of Son of Beneath The Planet of Connectix Virtual PC 1.0
To: None <cjs@portal.ca>
From: Greg Earle <earle@isolar.Tujunga.CA.US>
List: port-i386
Date: 06/24/1997 15:16:23
[My last post on the subject, promise]

Curt Sampson explained:
>> How many different "configuration modes" are there?
> 
> Two, as I recall, `mode 1' and `mode 2.'  Mode 2 is the newer and
> better way to do it.
> 
>> In short, it sounds sorta like NetBSD's "configuration mode 2" is giving me
>> the same results as PX's "Hardware Access Mechanism 2" - i.e., nothing.
>> 
>> Given that this is the results of booting from the 1.2G snapshot SSTO boot
>> floppy, it sounds like I don't have any control over which "configuration
>> mode" gets used.
> 
> If you can compile a new kernel, you can force a configuration
> mode.  From src/sys/arch/i386/pci/pci_machdep.c:
> 
>  * The configuration method can be hard-coded in the config file by
>  * using `options PCI_CONF_MODE=N', where `N' is the configuration mode
>  * as defined section 3.6.4.1, `Generating Configuration Cycles'.

I took a quick look at this file and saw

int
pci_mode_detect()
{
[...]
        /*
         * We try to divine which configuration mode the host bridge wants.  We
         * try mode 2 first, because our probe for mode 1 is likely to succeed
         * for mode 2 also.
         *
         * XXX
         * This should really be done using the PCI BIOS.
         */

        outb(PCI_MODE2_ENABLE_REG, 0);
        outb(PCI_MODE2_FORWARD_REG, 0);
        if (inb(PCI_MODE2_ENABLE_REG) != 0 ||
            inb(PCI_MODE2_FORWARD_REG) != 0)
                goto not2; 
        return (pci_mode = 2);
[...]

This looks like it pokes a couple of locations and if it successfully reads
back from them, it declares victory and assumes mode 2 works.  So this sounds
like a bug that should be reported to Connectix to me, if it emulates a
response but doesn't work when you actually try to use it ...

The bottom line, though, is that I don't think it's going to be practical
in the long run to tell people "Oh yeah, you can run NetBSD under Virtual PC,
but only if you run NetBSD-current with an SSTO floppy install disk that's
had a custom SSTO kernel built for it with PCI configuration mode 1 forced".

Just to add insult to injury, I tried the 1.2.1 dual-floppy install under
VPC 1.0 and got the same result as before: hard error reading from the 2nd
floppy after being asked to insert the INST-121.FS floppy, with a "panic:
cannot mount root" and a reset of the Virtual PC.

I think I'm gonna declare defeat at this point.  My work PC is running 1.2
and not 1.2G/current, so I can't cook up a custom SSTO floppy to use in
place of the latest snapshot one.  And as long as the floppy support still
sucks, I can't see being able to load any software at all.  (Recall that
after I'd put the 4 "kern" files on a DOS floppy and tried to continue the
install, I again got fd driver hard error reading fsbn NN errors when trying
to read the kern files off of the floppy.)  When reading the documentation,
Connectix makes sure that you know that it doesn't support using anything
other than DOS, Windows 3.1 or Windows 95 on this thing.  And their notes
on using other OS's only mentions stuff like OS/2 Warp.  Not a peep about
Open/Free/NetBSD or BSDi in sight.  I don't even think it mentions Linux ...

So Virtual PC 1.0, for the moment at least, joins Apple's MAE 3.0update4
on my emulator scrap heap, yet another victim of "It works perfectly right -
well, 98% of the time".  Sigh.

	- Greg

P.S. Jordan, if you want me to test a FreeBSD boot floppy, point me to a URL
     and I'll try it out.  But that's pretty much it for me.