Wednesday, January 14, 2009

Size does matter!

Around 1992 the BIOS vendors started to compress part of their BIOS. Before that the BIOS was uncompressed and kept in 64KB EPROM. I remembered spending lot of time in EPROM UV erasers and blank checking the EPROMs.

During the early stage of the BIOS there are not many chips to initialize. Memory detection is simple and straight forward, super I/O initialization is simple and nothing to enumerate - most of the configuration is through hardware jumpers. So 64KB was enough and it is kept as a 'tiny' memory model - single 64KB segment! Since the ROM is an EPROM no worry of corruption and thus no hardware protected boot block!

When more companies started making x86 clone CPUs, introduction of various storage formats (5 1/4, 3 1/2 Floppy drives, various HDD drives) and PnP buses (ISA PnP anyone?) made BIOS size grew dramatically. Every extra byte was squeezed out of BIOS. BIOS vendors started providing OEM with tools to select what CPU support they need in their BIOS. There was a time when people can choose 8 different CPU vendors each with different flavors of 386 or 486 compatible chips.

Compressing a certain portion of the BIOS was the only solution at that time. Initially only a very small portion of the BIOS was compressed. BIOS code was also separated into boot (or POST) and runtime code at this time. Mostly runtime code was compressed. Boot and runtime code were kept in two different segments. Boot code normally invokes runtime code using a single entry point with function numbers. The boot code should wait till runtime code gets uncompressed before using this interface. This was an ugly implementation that lived for quite sometime.

The main design choice for this ugly idea was Time-To-Market (famous TTM). There were not much Engineers to do parallel development of a better BIOS core (at least in the company I worked for). It worked perfectly for 1/2 decade, then the interface got uglier and EEPROM size increased to 128KB in newer systems. At this point, BIOS moved out of Shadow RAM and into RAM.

For a while it looked like we had lot of space both in ROM & in RAM, but not for long!

No comments:

Post a Comment