I have had a fair amount of experience with these !@#$% VGA BIOSes - I think
most of them (if not all) have dependencies on a PC BIOS being present -
some are quire heavily dependant, others less so. On the other hand, a lot
of VGA cards can be initialised with code very similar to init code for
other cards - essentially, the card must be enabled, the clocks initialised,
the sequencer initialised, graphics controller initialised, attribute
controller initialised, CRTC initialised, Palette initialised - then for
text mode, load at least one font, and hey - off you go. But then again,
there are those which remain a mystery. This is not a task for the faint
hearted.

Hamish

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Ronald G Minnich
Sent: Saturday, July 28, 2001 5:53 PM
To: Stefanos Papanicolopoulos
Cc: [EMAIL PROTECTED]; LinuxBIOS
Subject: Re: VGA controller init


On Sat, 28 Jul 2001, Stefanos Papanicolopoulos wrote:

> 1. To jump to 0xC0000+3 you would have to map the ROM in your VGA
> card to that memory. It doesn't get mapped automagically like the
> PC BIOS does.

maybe. We can map that if needed. But this code is probably PIC, so we can
copy it to a random place in memory and run it.

> 2. The code in the VGA BIOS is for 16bit real mode, which means you
> either don't enter protected mode in your BIOS before initializing
> the VGA card, or you switch back to 16bit mode to do so...

we can pop into real mode, or set up 16-bit code and data segments and
switch to them before we jump.

> 3. The code in the VGA BIOS **probably** relies on the existence of
> a more-or-less standard PC BIOS. Or it would start writing values at
> 0040:xx or read values from there, etc...

yes, this is the big problem. How much does that code depend on BIOS? I
would expect it to be different for every card. BUT, xfree86 actually does
run that code in 8086 emulation and it works. So maybe that bit of setup
code does not need BIOS? don't know.

For a point of reference, there is a full-blown 8086 emulator in the Alpha
BIOSes so they can init graphics cards. yuck.

This is a hard problem. Ollie solved it the right way, with his sifb lite
driver. I think the right place to do this job is in Linux, and since the
whole reason we boot Linux out of flash is to get all that capability, I
would recommend solving it there.



> So, as you see the question was not stupid at all...

It's a good question with no good answers yet.

> The alternative would be to initialize the card on your own. This
> isn't that easy either, but it is for sure much 'cleaner'. To do
> this you would need to:
>
> - Find your VGA card (i.e. find the position in the bus)
> - Map the vga registers either to I/O or to memory addresses
> - Do the right reads/writes to initialize the adapter.

see the sisfb lite :-)

part of the reason VGA is a mess is so vendors can hide their IP. I am not
kidding.

ron

Reply via email to