Subject: PCI cards and x86 emulation (tech-kern)
To: None <tech-kern@netbsd.org>
From: Leo Weppelman <leo@wau.mis.ah.nl>
List: tech-kern
Date: 08/25/2000 21:35:00
I was requested to move this to tech-kern, and that's were it is now. I
must admit that I did not expected this much responses. Ah, well ;-)

Bill quoted my entire message, so I just copied his reply. There were
additional responses/questions about:

    - Did I know something like this is part of the latest X11 release
      (Wolfgang S.). Actually I did not, but they mentioned X11 in their
      licence file.
    - Do I need it in the kernel? I hope not. If used, I like it to be
      a separate boot-time program. It is at least 600KB in size...
    - Can you use it as a way to get vm86() emulation calls in a non
      x86 kernel (Ty Sarna). I don't know. It emulates the processor, but
      you do not have all the I/O devices involved. I had to cook something
      up to emulate a timer at 0x40-0x43 to make the video bios happy...

Leo.

----- Forwarded message from Bill Studenmund <wrstuden@zembu.com> -----

Date: Fri, 25 Aug 2000 09:33:33 -0700 (PDT)
From: Bill Studenmund <wrstuden@zembu.com>
To: Leo Weppelman <leo@wau.mis.ah.nl>
Subject: Re: PCI cards and x86 emulation
In-Reply-To: <20000825153151.C28703@wau.mis.ah.nl>

On Fri, 25 Aug 2000, Leo Weppelman wrote:

> This is more or less a poll to see if more ports are interested in this.

Sugestion 1) move this to tech-kern. :-)

> On the Atari Hades & Milan series, the video card used is just an ordinary
> PCI VGA card. To make these cards easy usable with NetBSD, they have to be
> initialized to a 'standard' VGA or CGA mode. This is the easiest way to do
> text consoles (with wscons). From past experience, I can tell that without
> the proper documentation, finding the proper initialisation incantations is
> quite a mess.
> A month or 2 ago I got a link ( ftp://ftp.scitechsoft.com/devel/x86emu/ )
> from a friend of mine. This is an x86 emulator with some cruft around it
> to init video cards. The emulator is under a BSD style license. Anyway,
> I succeeded in running the bios on my S3Trio and et6100 cards. So the
> emulator proved to be good enough. The setup I used (a quick&dirty pci driver
> and the emulator in userland) is not very usable for bringing up a console.

Having this in the tree would be REALLY cool!

> I am now thinking of what would be the best way to go along and this partly
> depends on the fact if this is usable outside the atari port.

There are a number of video cards, including my Savage 4 card last I
checked, for which the X drivers need to be able to call the Bios. So
something like this would help most every port with a PCI bus. And maybe
more. :-)

> For the atari, the most flexible way to do things is to have an extra
> 'vgainit' phase in the boot. something like:
>     - execute bootblock code
>     - look for /vgaboot. If found, execute
>     - boot /netbsd
> 
> The most inflexible way is to mimic the sequence of in[bw]() and out[bw]()
> calls traced from the emulator...
> 
> Thoughts?

This could be VERY interesting. To tech-kern please! :-) Feel free to copy
this reply over if you wish.

I'd say the better thing to do is make a way to build this into the
kernel, so we can use it while initializing the kernel console. It would
need to be able to operate that early in boot (there is no malloc & a lot
of other stuff).

Take care,

Bill


----- End forwarded message -----