[comp.sys.ibm.pc] Why is VGA ROM duplicated at C000:0 & E000:0

hst@mh_co2.mh.nl (Klaas Hemstra) (12/07/89)

I have a question concerning the VGA ROM BIOS.

On the two different systems I was able to check this ROM BIOS was located at
address C000:0000   AND (!!!) AT E000:0000.
(Systems: A Compaq 386s with Compaq VGA and a Paradise VGA card on an AT comp.)

Of course I don't care how VGA uses my memory map, as long as it works, but
this duplicated memory usage causes a problem running QEMM (386).

The QEMM program makes it possible to map some unused extended memory (using
the 386 mapping possibilities) to the memory range for A000:0000 - FFFF:FFFF.
You can then load TSR's in that high (RAM) memory and gain some valueable
memory for DOS applications.
QEMM works fine, it detects ROM areas and will not use them.

But here the VGA is eating away two chunks of memory (2x 24K to be exact).

This leaves less AND much more skattered memory for QEMM.
On the Compaq we also had a ethernet board installed using memory from 
D000:0000 - E000:0000.
So the memory map above A000:0000 contains the following:
	A000:0000 - B000:0000	: The VGA page buffer
Free	B000:0000 - B800:0000	: FREE (I Think)
	B800:0000 - C000:0000	: The VGA text mode screen memory
	C000:0000 - C600:0000	: VGA ROM BIOS
Free	C600:0000 - D000:0000	: FREE
	D000:0000 - E000:0000	: Ethernet card (DEBCA)
	E000:0000 - E600:0000	: VGA ROM BIOS Duplicate
Free	E600:0000 - F000:0000	: FREE
	F000:0000 -10000:0000	: BIOS ROM

This leaves 32K + 40K + 40K for QEMM.
This seames ok but QEMM also would like to have a 64Kbyte EMS frame buffer
(contigously in memory). Well that one it can't have. Also on of the TSR's
I would like to LOAD in HIgh memory is about 50 K (Ethernet driver).
Thats also not possible.

So I told QEMM to include the memory from C000:000 - C600:0000.
At first this seamed to work fine but later I discovered that some VGA
graphic modes did not work. Of course because there ROM BIOS was gone ?!
After some experimenting I was able to include C300:0000 - C600:0000, but
I'm still not sure about all VGA modes (haven't tested most of them).

I could reconfigure the Ethernet board to some other memory-locations but
these would not solve all problems.

Biggest questions: Why does VGA duplicates it's BIOS,
		   Is it always the case ?
		   Can it be disabled ?

Further any remarks about QEMM usage and memory skattering would be welcome.
If you find it interesting for more people post it, if not maybe I will
post a summary.

Thanks for your attention,
					Klaas Hemstra

Klaas Hemstra  (hst@mh.nl)                   |    /  / ,~~~  ~~/~~
uucp: ..{uunet!}hp4nl!mh.nl!hst              |   /--/  `-,    /  ___  |_/ |__|
Multihouse N.V., Gouda, the Netherlands      |  /  / ___/    /   ---  | \ |  |
"Most of us mindreaders are atheist, you know" A song for Lya: George Martin

chasm@attctc.Dallas.TX.US (Charles Marslett) (12/07/89)

In article <4086@mhres.mh.nl>, hst@mh_co2.mh.nl (Klaas Hemstra) writes:
> I have a question concerning the VGA ROM BIOS.
> 
> On the two different systems I was able to check this ROM BIOS was located at
> address C000:0000   AND (!!!) AT E000:0000.
> (Systems: A Compaq 386s with Compaq VGA and a Paradise VGA card on an AT comp.)
> 
> Of course I don't care how VGA uses my memory map, as long as it works, but
> this duplicated memory usage causes a problem running QEMM (386).

The situation is caused by certain (not so neat) BIOS shadowing techniques, used
by Compaq and several other box vendors to avoid problems with paged BIOS ROMs.
I know of no popular boards for AT-bus systems that really use paged ROMs, so
I dislike the technique (I think it overkill), but it allows the code to be
executed at E000:0000-7FFF and the tables to be paged in at C000:0000-7FFF if
the code is written to handle that -- I had to modify my BIOS to access the
tables at C000:0000-7FFF even if relocated because of software packages that
check vectors for VGA/EGA presence (another bad coding practice).

If you disable the BIOS cache or BIOS shadowing function in your system setup
(most allow this, and I think Compaq does), then the E000 copy of the BIOS
should disappear.


> So I told QEMM to include the memory from C000:000 - C600:0000.
> At first this seamed to work fine but later I discovered that some VGA
> graphic modes did not work. Of course because there ROM BIOS was gone ?!
> After some experimenting I was able to include C300:0000 - C600:0000, but
> I'm still not sure about all VGA modes (haven't tested most of them).

Our VGAs (with BIOSes written before the middle of this year) would have
worked fine in this situation (though the software package, whose name I can-
not remember right now, would not recognize your system as having a VGA in it).
As I mentioned above, this is because most VGA BIOSes reference the tables
at C000 with absolute segment references (rather than based on the BIOS CS
register like I did).

> Biggest questions: Why does VGA duplicates it's BIOS,
> 		   Is it always the case ?
> 		   Can it be disabled ?

It doesn't, all systems don't do it the same way, and mostly it can be
disabled with the setup program in the system ROM or on the setup diskette
that (hopefully) came with the system.

> Thanks for your attention,
> 					Klaas Hemstra

Charles Marslett
STB Systems, Inc <-- apply all standard disclaimers
chasm@attctc.dallas.tx.us