First ROM Shadowing

The other day I was asked an interesting question: What was the first BIOS with support for ROM shadowing? In the 1990s, ROM shadowing was common, at first as a pure performance enhancement and later as a functional requirement; newer firmware is stored compressed in ROM and must be decompressed into RAM first, and firmware may also rely on writing to itself before being locked down and write protected.

Old PCs did not use ROM shadowing because it made no sense. ROMs were only marginally slower than RAM, if at all, and RAM was too precious to waste on mirroring the contents of existing ROMs. Over the years, RAM speeds shot up while ROM remained slow. By about 1990, executing BIOS code from ROM incurred a noticeable performance penalty, and at the same time devoting 64 or 128 KB to ROM shadowing was no longer prohibitively expensive.

But who did it first?

Researching BIOS history is quite difficult. Neither clone BIOSes nor major OEM BIOSes (IBM, Compaq, Dell, HP) are particularly well documented, and obtaining samples is tricky.

ROM shadowing requires chipset support, so I thought I’d start with looking at datasheets. Picking a few random Chips & Technologies datasheets, I established that ROM shadowing was common circa 1990, and advertised as such. The earliest C&T example was the CS8221 NEAT chipset. In 1987, C&T touted “Shadow RAM for BIOS to improve system performance” in their CS8221 data book.

On the other hand, the older CS8220 chipset from 1985 or 1986 did not offer any such functionality. Which means that in the clone PC market, where C&T was a major player at the time, BIOS ROM shadowing probably started being used sometime in 1988. It remains an open question which BIOS vendor did that first.

But what about other OEMs? It is possible that some other vendor like IBM or Compaq or ALR might have done it first. I was fairly certain that IBM did not have ROM shadowing prior to the PS/2 line in 1987, and if someone else had it, it would have been likely earlier.

I started looking at Compaq advertising materials and found no mention of ROM shadowing. I searched Compaq technical references and found no mention of shadowing whatsoever. But I didn’t stop searching because I had a vague memory that the Compaq Deskpro 386 had some kind of ROM shadowing support, at least in later iterations.

And sure enough, it did. Not only in later iterations but the very first 16 MHz Compaq Deskpro 386 from 1986 already had ROM shadowing. Except Compaq didn’t call it that.

The Compaq Deskpro 386 Technical Reference Guide from September 1986 contains the following text on page 3-5:

Of the 384 KB of additional memory available in the standard memory configuration, the last 128 KB contain a number of special addressing features. This 128-KB block, starting at address FE0000, can be relocated (mapped) via special hardware map registers to replace the 128-KB area normally assigned to the system ROMs (0E0000 to 0FFFFF). When mapped, the 128-KB RAM block normally located at FE0000 can be addressed at either FE0000 or 0E0000. The ROM devices are not accessible while the RAM is mapped to the address space normally occupied by the ROMs.

That certainly sounds an awful lot like ROM shadowing! The 1986 Deskpro 386 Tech Ref and more can be found here.

While newer designs usually control how reads and writes are treated for the ROM area, Compaq did it a little differently. Of the built-in 1 MB, Compaq mapped 384 KB just below 16 MB; some of it was usable as Compaq Built-In Memory or BIM. Compaq set aside 128 KB at the very top of the 16 MB address space to provide an alternative mapping of the shadow RAM. To enable ROM shadowing, the BIOS had to copy (typically) 64 KB of memory from 0F0000h to FF0000h and then reprogram the RAM relocation register to write-protect the RAM and map it to the ROM range.

While the original Deskpro 386 hardware was clearly capable of ROM shadowing, I was not certain if the earliest BIOS actually used it. Fortunately Jeff Parsons from pcjs.org was able to clear that question for me. Yes, the Deskpro 386 BIOS from September 1986 already enabled ROM shadowing. The feature does not appear to have been user controllable, the BIOS simply always did it.

ROM shadowing was therefore provably used in 1986 by the Compaq Deskpro 386. It is quite likely that the Deskpro 386 was the first PC with ROM shadowing, for several reasons. One reason was that the Deskpro 386 came with 1 MB RAM standard — not 512 KB, not 640 KB, but a full 1 MB. That gave Compaq the option to use some of the extra memory for speeding things up.

The other reason is that the Deskpro 386 was almost certainly the first PC where ROM shadowing made a real difference. The Deskpro 386 had 32-bit RAM, significantly faster than 16-bit ROMs. That was not the case with 16-bit PC/AT compatibles with slower CPUs, slower RAM, and a 16-bit data path to both RAM and ROM. On the Deskpro 386, the system RAM was likely several times faster than ROM, and that’s what made ROM shadowing desirable.

In the absence of other evidence, it’s impossible to prove that Compaq implemented ROM shadowing first. Circumstantial evidence indicates that it is very likely.

This entry was posted in C&T, Compaq, IBM, PC architecture, PC history. Bookmark the permalink.

55 Responses to First ROM Shadowing

  1. zeurkous says:

    [Comment didn’t show up. Since me comments are not normally filtered,
    me’ll post it again, presuming me wrongly filled in something…]

    Sounds similar to the A20 hack. Were there any machines that booted w/
    the upper 8 bits forced to 0, and then similarly gated them, after a
    branch to low space?

  2. zeurkous says:

    Okay, that showed up; probably me mistake, then.

    @Michal: yet, something appears to have broken the comment paging. We’ve
    reached 50 comments and me had to divine manually (from the URL) that
    there would be a 2nd comment page. In the past, there were links
    between the comment pages, but that is no longer the case as such.

    (Me’d imagine that the wordpress project breaks things faster than you
    can repair them… the story of modern humanity.)

  3. zeurkous says:

    No, not me mistake, apparently. Now it happened again, no idea what’s
    going on.

    Me supposed that this time, me’ll patiently wait and see if it ends up
    in Necasek’s moderation queue.

    Either way: another “new” bug is that posting a comment in a >50-comment
    thread no longer redirects to the page the comment is on, but back to
    page 1.

    It’s a day job.

  4. Daniel B. Sedory says:

    Since many will be taken directly to this page; instead of all the original comments, I’ll summarize as Michal did, that the DeskPro 386 is likely the very first PC to have done “BIOS shadowing” without using that term! Also that this page at PCjs:
    https://www.pcjs.org/machines/pcx86/compaq/deskpro386/rom/
    has a bit further discussion of the Compaq DeskPro 386 BIOS ROM code. And in regards to “firsts” in the PC Industry, I’ve found that searching for “timeline pages” may also be helpful, for example (there are others): Ken Polsson’s “Chronology of Personal Computers” from just after WWII (1947) to 2010 using 2,672 references (mostly magazines): http://kpolsson.com/comphist/
    There really does need to be a comprehensive (though perhaps no longer even possible!) history of at least PC BIOS code!

  5. Joshua says:

    “Old PCs did not use ROM shadowing because it made no sense.”
    Some ISA VGA cards from the late 80s included a “RAM BIOS” utility, though.
    I suppose to install VGA BIOS into RAM, for quicker access.
    If the BIOS wasn’t interleaved (2x 8-Bit EPROM), an 8-Bit I/O was used, maybe.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.