Column 2: A brief history of the PC (2011-07-06)

Today we discuss the evolution of the PC platform, the computer platform for which Coreboot was developed. This summer the PC platform celebrates its 30th anniversary. This platform is remarkable not for what it was in 1981, but for what it has become in the course of 30 years.

The level of software and hardware compatibility among various PC platform machines is remarkable, especially if you consider that there is no overall written specification for it. There are standards for various subsystems, such as USB, but there is no single organization that defines what a PC must or must not be. That said, the one test that really matters: can it run the retail version of the predominant Microsoft operating system?

Even though PCs of the same generation are very compatible with one another, a modern PC shares no hardware interfaces with the original from 1980 (or it must be the PC speaker). Modern PCs do still support the BIOS calls from the original PC and are somewhat capable of running very old DOS versions. The problem is that old DOS versions do not know how to handle today's hard disk sizes and floppy disks, where have they gone? It is however possible to put a diskette image on a bootable CD and boot DOS from that.

1981: The beginning

In August 1981, IBM introduced its first model of the IBM PC, the model 5150. This was not the first personal computer, as various 8-bit microcomputers were already on the market, such as the Apple II, the TRS-80 and various CP/M machines. Even these were preceded by other more primitive machines that could be termed personal computers. However, the IBM PC was the first member of a large family that would become the PC platform.

The famous 8-bit Commodore-64 was not yet introduced at that time and neither were audio-CDs. The machine had a maximum of 64kB (minimum 16kB) of memory on its motherboard and it had a BASIC interpreter in ROM. It could be used without floppy disk drives and could store its (BASIC) programs on audio cassettes. In that respect it was comparable to contemporary machines such as the TRS-80 and Apple II.

The difference between the IBM PC and most other machines was its CPU. As opposed to the Z80 and 6502 CPUs, this one had a 16-bit architecture and e 20-bit address bus, so it could address up to 1MB of memory. When the PC platform was designed, 640kB was reserved for RAM, the rest was reserved for expansion boards (such as a video card) and ROM. Further, the IBM PC had expansion slots in which you could insert a video card, a floppy controller card, serial and parallel interface cards and of course more RAM. The computer could not be used without a video card, but you had a choice between two types:

The IBM PC was way too expensive to be used as a simple home computer. Configurations without floppy drives that used cassette tape were extremely rare. However it did become a success in the business market. Typical configurations had at least 64kB of RAM and two floppy drives. They would run the PC-DOS 1.0 operating system sold by Microsoft, which was a CP/M look-alike. Microsoft also sold the ROM BASIC that was in the same machine. The BASIC interpreter running on PC-DOS would use much of the code in ROM, so the DOS program could be very small.

PC-DOS (the IBM OEM version of MS-DOS) was sufficiently similar to CP/M to make porting of CP/M applications comparatively easy. Also the Intel 8088, while not compatible with the 8080, had some similarities to make porting easier. For instance, the 8080 had three sets of two 8-bit registers, each of which could be used together as a 16-bit register. (8 bit B and 8 bit C register would form a 16-bit BC register). The same was true for DE and HL. Now the 8088 has exactly the same structure with its BX (BH and BL), CX and DX registers. Further the 8088 supported the same status flags (including parity) as the 8080, so porting from 8080 to 8088 was comparatively easy. This helped software firms make their CP/M applications available in an MS-DOS version as well.

The original PC came with single-sided floppy drives that could store 160kB per diskette. Hard disks were not officially supported yet.

Now to the internal architecture. The 8088 CPU (running at a clock frequency of 4.77MHz) has an 8-bit external data bus and a 20-bit address bus. However, 8 of the address bits are multiplexed on the same pins as the data bus. An 8-bit latch is required to latch the address bits during the entire bus cycle. On the main board we find several support chips, such as an 8254 timer, an 8259 interrupt controller, an 8237 DMA controller, chips to support the keyboard and PC speaker and lots of simple TTL IC's that are used as glue logic. The main board contains some RAM, ROM and an empty socket for an 8087 floating point coprocessor. The expansion bus and the internal system bus are essentially one and the same. Most signals on the expansion bus correspond directly with signals on the CPU with only a buffer or latch in between. RAM in an expansion slot would be exactly as fast as RAM on the mainboard.

Basic block diagram of PC

The BIOS ROM (entirely separate from the BASIC ROM) was 8kB in size.

1983: The PC/XT

In 1983, IBM introduced the PC/XT. As far as the basic architecture goes, this was exactly the same as the original PC, with the same 4.77MHz 8088, the same 8-bit expansion bus and mostly the same expansion boards. It came with 256kB of RAM as standard and it could readily be expanded to 640kB. Gone was the cassette port and in went the hard disk (10MB). It still had ROM BASIC, but this would never be run as long as the hard disk was still bootable. The hard disk controller card had its own BIOS, separate from the main BIOS.

The PC/XT ran PC-DOS 2.0. This DOS version added support for hard disks and for subdirectories. The double-sided floppy drives could store 360kB on a single diskette.

The PC/XT would be massively cloned by other manufacturers. As the machine was entirely built from standard chips, anybody could build a nearly identical machine from the same chips. This was legal, except that the ROMs were copyrighted and they could not be copied legally. The BASIC ROM could be missed. The PC would run without it and Microsoft made a BASIC version available for MS-DOS (GW-BASIC) that would not use the BASIC ROM, so you could even run BASIC programs without it. The only ROM that mattered was the BIOS ROM. Its function was fairly simple and a work-alike could be created comparatively easily. The hardest thing was to prove that no copyrighted IBM code went into the ROM.

Phoenix went to great lengths to make a clean room copy of the ROM using one team to analyze the original IBM BIOS and write a functional specification and a separate team to write the cloned BIOS using nothing but the functional specification. When Phoenix introduced its PC BIOS in 1984, every manufacturer could buy a BIOS from them and legally build a PC clone. Note that Phoenix BIOS was not free software: clone makers had to pay royalties to Phoenix.

Clones of the PC/XT were manufactured until 1988 and beyond, long after IBM had itself discontinued the model. Many were sold without a hard disk to make them cheaper. Many clones would integrate common peripherals on the mainboard that were on separate expansion boards in the original PC/XT. Many would use custom chips to reduce parts count. There were versions with faster CPUs and even versions with an 8086 (instead of an 8088) using a 16-bit bus internally.

Of course the expansion boards (such as the video card) would be cloned as well. The Hercules card (introduced in 1984, cloned countless times) was entirely compatible with the original IBM Monochrome Display Adapter, but it added monochrome bitmap graphics. So finally you could have both high quality text and graphics on the same monitor. In this respect the cloned product was superior to the orignal.

Not only would a PC compatible machine have to be able to run MS-DOS, but it would also need to have the same BIOS calls and nearly the same hardware. Basically all I/O registers and memories had to be at the same address and had to work the same way. Few PC applications would only use DOS system calls, most would also use BIOS calls or would access hardware directly. Almost all applications would directly write into video RAM.

1984: The PC/AT

In 1984, IBM introduced the PC/AT, based on the 80286 CPU running at 6MHZ. This CPU had a 16-bit data bus and a 24-bit address bus. It could address up to 16MB of RAM, but only in Protected Mode, so DOS could not use this extra memory.

The AT used 80-track floppy drives that could store 1.2MB on a single diskette. The AT floppy drive could read and write the old 360kB format, but the different track width led to problems when the same diskette was written on different drives. The hard disk interface was changed and a hard disk controller card no longer contained its own BIOS. This was now integrated into the main BIOS. ROM BASIC was still present and would be in any PC manufactured by IBM for years to come.

The expansion bus was extended to a 16-bit data bus and a 24-bit address bus. The AT contained a second DMA controller and a second interrupt controller, so it had more DMA channels and more IRQ lines than the XT. Yet the old PC expansion cards would still fit into the AT expansion slots and they would still work (they would only use part of the connector). The PC/AT expansion bus was still basically identical to the CPU bus. However there was some logic to split 16-bit accesses into two successive 8-bit accesses for 8-bit expansion cards. This expansion bus would later be called the ISA bus.

Basic block diagram of PC/AT

The PC/AT contained a special A20 gate to fix address line A20 on the system bus to 0. On the 8088, if you set the segment register to 0xffff and the offset to 0x10, you would access address 0 again. A single segment could span the top of ROM and the lower part of RAM. Of course there were some programs that used this. On the 80286 you would access memory just above 1MB, so this trick would not work. The A20 gate made the old programs work again. You had to disable this gate explicitly to access any memory above 1MB.

Apart from a different CPU, a 16-bit expansion bus and high capacity floppy drives, the main feature that set the IBM PC/AT apart from its predecessor was the real time clock chip. Each time you started MS-DOS on an older PC, you were supposed to enter the current date and time manually, so file timestamps would be set correctly. The IBM PC/AT had a small battery-backed chip that kept the time for you. MS-DOS could now read the correct time from that chip, so it did not have to be set manually. Apart from the real time clock, this chip also had a tiny RAM in which configuration information could be stored, such as the types of floppy drives and the hard disk type. As this chip needed to run on battery power when the PC was powered up, it had to be a low power chip, which meant CMOS. At that time, CMOS was not used for the regular digital circuits inside a PC, but was only used for special low-power circuits, such as digital watches and pocket calculators. So this chip containing the real time clock and configuration RAM became known as the CMOS chip.

On the original PC/AT you needed a special-purpose setup program on a diskette to set the configuration parameters and real-time clock, This was tricky if the floppy disk drive types were set incorrectly. Also, those setup diskettes tended to get lost. You could only specify 46 predefined hard disk types. After a few years none of these were current. Most clones supported a user-definable hard disk type 47, for which you could specify the parameters. Further, most clones would have their setup program built into ROM.

The PC/AT was also massively cloned, just like its predecessor. From then on, the PC platform would evolve without the standard being set by IBM. No further computer models from IBM would set the standard the way the original PC, the XT and the AT did. In many cases, the clone makers took the lead in innovation. In 1986 the first AT clone with an 80386 CPU was introduced, while IBM did not offer any '386 models at the time.

Shortly after the introduction of the PC/AT, IBM introduced the Enhanced Graphics Adapter (EGA). This supported a resolution of 640x350 pixels and required a special monitor. The EGA card contained its own BIOS ROM, just like all VGA compatible video cards introduced later, but unlike MDA and CGA that were driven by the main PC BIOS.

1987: PS/2, the clones take a different route.

In 1987 IBM introduced its PS/2 line of personal computers. The major new feature was a new expansion bus called MCA, which was incompatible with the ISA bus. The MCA bus was heavily protected by patents and IBM demanded huge license fees from any clone makers who would make compatible machines. Further, this bus was incompatible with the original ISA bus and existing expansion cards could not be used in MCA machines.

Even though MCA was technically superior to ISA, the market decided differently. Clone makers stuck to the original PC/AT architecture rather than the newer PS/2 architecture. Other manufacturers invented a different bus standard: EISA, which did offer compatibility with ISA, but this was no great success either. ISA was good enough, for now.

However, some features of the PS/2 line would make it into the mainstream PC world, such as VGA video, the 1.44MB 3.5'' floppy drive and the PS/2 keyboard and mouse connectors. Speaking of 3.5'' floppy drives, IBM fitted its PS/2 machines with 3.5'' drives only, leaving no room to fit the old-style 5.25 drives. PC clones could be fitted with both drive types at the same time and there was a long transition period in which many machines were fitted standard with both types of drives.

With the new PS/2 line a new operating system was introduced: OS/2. It could take advantage of the extra memory capacity offered by the 80286 architecture, but its DOS compatibility was not great and there were not many native applications compared to DOS applications. OS/2 version 1.x was basically a failure. OS/2 would be reintroduced two more times, in 1992 (version 2.0) and in 1995 (OS/2 Warp). Both times it came with many technical improvements, but it could not win against Windows.

1987-1993: Faster CPUs

Improvements to the PC architecture continued. Many of the required chips on a PC motherboard (such as the 8254 timer, the two 8259 interrupt controllers and the two 8237 DMA controllers along with tons of glue logic) were combined into a few larger chips. This reduced the cost of a PC motherboard tremendously. PC chipsets were born. Many of these chipsets however, needed to be configured in software. This chipset initialization code had to be added to the BIOS ROM. Over time this chipset initialization would be more and more complex, requiring larger chunks of mainboard specific code.

At the same time, CPU frequencies increased. The orignal PC/AT ran at a clock frequency of 6MHz. Clones started to run at 8MHz, 12MHz and up to 25MHz. The ISA bus can run up to 8MHz without problems, but beyond that it gets tricky. Modern AT clones had to separate the expansion bus (running at 8MHz) from the internal system bus (running at say 16MHz) via a bus bridge. For 80386 systems the bus bridge had to convert between the 32 bit internal bus to the 16 bit ISA bus. Such a bus bridge would also be a component of a PC chipset. Those chipsets would later evolve into the famous northbridge, southbridge and superio chips.

Basic block diagram of PC/AT with
split bus

In 1990 Windows 3.0 was introduced. This was not the first version. Version 1.0 was introduced in 1985, but at the time it was seen as little more than a gimmick. Windows 3.0 was still a glorified GUI toolkit on top of DOS, but it could do more than that. It could also run applications in protected mode on the 80286, thereby taking advantage of the extra memory capacity beyond 640kB that many PCs had. It could also multitask Windows applications and you could run DOS applications from the GUI shell. If you had an 80386, Windows could take advantage of the Virtual 86 mode to run multiple DOS applications without problems. By the mainstream computer press of the time it was viewed as the ting that OS/2 should have been. Windows 3.0 became a great success and it marked the start of the transition from the DOS era to the Windows era.

Even though the 80386 was introduced in 1985 and the first PC using it was introduced in 1986, 32-bit software took a long time to gain any foothold on the PC platform. 80386-based UNIX systems were available almost from the start, but these were very expensive. 80386 machines were mainly used as faster DOS machines and 32-bit software was rarely run on them. DJGCC (a DOS port of the GNU C Compiler for the 386) started to be developed in 1989. The first version of Linux was introduced in 1991, but none of it was mainstream. In 1992, several low-cost or free clones of UNIX were introduces for the 386 PC platform, was well as OS/2 2.0, which was also 32-bit. This was still not really mainstream, but it was not insignificant either. By 1992 the 80386's successor. the 80846, had already been on the market for three years.

Another interesting development was the IDE hard disk. The original PC/AT hard disks still used an external controller that sent the signals to the heads and read them back and that coordinated the stepper motor for track changing, just as a floppy disk controller would do. From 1990 most hard disks had their own internal controller, which was better matched to the physical disk and that could do things (such as relocating a bad sector to a spare location) the simple hard disk controllers could not do. The "controller card" in the PC was little more than a bus bridge. These hard disks were called IDE (integrated drive electronics), later ATA (AT Attachment). From the point of view of the software these disks had the exact same programming interface as the old ones. BIOS could stay the same, for a short time that is.

The original AT BIOS proved to be inadequate just a few years from the start, long before IDE arrived, because it had only 46 predefined hard disk types. Most clone BIOSes supported a user-defined type for which the number of sectors, heads and cylinders had to be filled in manually. This was sufficient for hard disks of up to around 500MB. IDE supported hard disks of up to 130GB, BIOS supported hard disks of up to 8GB, but the limitations of both interfaces were in different places, so they could be satisfied simultaneously only up to about 0.5GB. From there a long series of work-arounds was invented to overcome limitations of the legacy interface. This could not only affect BIOS, but also programs and operating systems that used BIOS calls, such as MS-DOS and boot loaders.

Most machines sold before 1993 still used the ISA bus for all I/O devices, even though main memory was on a much faster internal 32-bit bus. Most computers had 4 or 8MB RAM. Some motherboards had cache on board. Systems with cache were much faster than those without, even when using the same CPU type at the same clock frequency. This was especially true for the 80386, which did not have any on-chip cache.

1993: Pentium, PCI

In the early 1990s the ISA bus had become really too slow for serious graphics work. As a quick-and-dirty solution the VLB (VESA Local Bus) was introduced. This was basically an interface to the local CPU bus that also connected to main memory. Only a single expansion card could be fitted, but this was enough for the video card.

In 1993 PCI was introduced. PCI is a 32-bit bus with a 33MHz clock frequency (64-bit versions and 66MHz versions also existed, but these were not very common). This offers 8 times the throughput of ISA. Further, PCI offered a configuration interface, so BIOS or the operating system could allocate addresses to each card without conflicts between boards. This was a giant leap forward from ISA, where each card was responsible for its own address decoding. Many cards had switches so they could be configured (manually) for a few different I/O addresses. The user was then responsible for configuring all cards without address conflicts (and without interrupt and DMA conflicts). It took nearly 10 years before the ISA bus was completely phased out. Most motherboards manufactured between 1993 and 2000 had both ISA and PCI slots.

Also in 1993 the Intel Pentium was introduced. It had a much more complex bus than the 80486, so it was necessary to use a dedicated chip to interface it to RAM and to peripherals. From now on, the famous northbridge, southbridge chipsets were used. The northbridge connects the CPU with RAM and with the south bridge. The southbridge connects the system with the PCI bus. It also contains th ATA interfaces and an ISA bridge. The Superio chip contains the on-board slow peripheral interfaces, such as floppy, serial, parallel and keyboard.

Basic block diagram of PC with
northbridge and soutbridge

Compared to the old-style AT chipsets, these Pentium chipsets needed much more low-level initialization from BIOS. Over time this would become even more complex. Size of the BIOS ROM increased over time. BIOS ROMs were replaced with flash ROM. Those flash chips could be erased and reprogrammed while they were in the system. A PC user could run a special program under DOS to update the BIOS with a newer version that fixed bugs. In theory a PC user could write a replacement BIOS and load it into flash.

In 1995 the Pentium Pro was introduced, but it did not become a success. The main reason it performed poorly on code that mixed 16-bit and 32-bit instructions, just the type of code that was heavily used in Windows 95. Some high-end machines were used as servers. The Pentium Pro also featured SMP. A motherboard could have not one but two identical CPUs. Of course BIOS needed to be adapted to SMP as well. There were earlier Intel-based systems with SMP, but this was the first time it was seen on more or less standard PC hardware.

CD-ROM drives had become a standard feature in PCs as well. The first CD-ROM drives used either a proprietary interface or SCSI, but the cheap mass-market CD-ROM drives used the ATA interface (the same as the hard disks). It was also desirable to be able to boot from a CD-ROM. BIOS was extended with functionality to boot from CD-ROMs. These extensions became known as the "El Torito" standard.

1995 also saw the introduction of ISA PnP cards and matching BIOS and OS support. This was an ugly hack to implement software-based configuration support (comparable to that of PCI) on top of the ISA bus. This would not work very well if anything in the system (old cards, BIOS or the OS) did not cooperate.

1997: AGP, Pentium II, USB

The Pentium II was introduced in 1997. Like the Pentium Pro it has built-in level 2 cache (in the same package as the CPU). A memory size of 32 or 64MB was standard at the time. SIMM memory modules (having one row of pins, 32 data bits) were replaced with DIMM memory modules (having two rows of contacts, 64 data bits). DIMM modules have an SPD (Serial Presence Detect) EEPROM on them that contains essential information about the memory module. BIOS has to read this serial EEPROM (via the SMBUS) first before it could set up the northbridge correctly.

Basic block diagram of modern PC with
northbridge and soutbridge

Even though it was introduced a few years earlier, the USB interface became standard on motherboards. USB was a serial bus for low to medium speed peripherals, supporting up to 12Mbit/s. It was intended to replace the seral, parallel, keyboard and mouse interfaces. Printers were among the first devices to take advantage of USB. This would mark the start of another long transition period. It would take more than ten years for the legacy interfaces to disappear completely. At first, BIOS support for USB was limited to keyboard support initially.

PCI was not fast enough for video cards anymore. A dedicated expansion slot (called AGP) appeared on the motherboard and it was directly connected to the northbridge.

Another new feature in PCs was ACPI. This is a standard for power-saving modes of the computer. The CPU or devices can be put into low power states or the entire system can be put into state where the CPU and all peripherals are powered down and only RAM is kept powered up. To support this properly, the hardware, the OS and the BIOS have to support it. The BIOS contains complex tables from which the OS can derive the special actions required to enter or leave certain power saving states.

2000-2001: Pentium IV, Windows XP

In 2000 USB 2.0 was introduced. This offered a speed of 480Mbit/s, 40 times the speed of USB 1.x. This made USB suitable for mass storage devices. USB sticks and external hard disks became available. BIOS had to be adapted to support these devices as well. Users expected to be able to boot from USB devices.

The Pentium IV was introduced in 2000 as well. With it came a new generation of chipsets. CPU clock frequencies had risen by more than an order of magnitude in just five years. With clock frequencies, power consumption had increased as well. AMD had its Athlon CPUs which featured comparable performance. AMD required different sockets and chipsets from Intel, so you had to buy a motherboard specifically for AMD or for Intel.

Windows XP was introduced in 2001. Before that, the home versions of Windows (Windows 95, 98 and ME) still ran on top of MS-DOS. They used at least some MS-DOS code and some BIOS calls for file access. Windows XP was based on the Windows NT line (Windows NT, Windows 2000) and used its own kernel. 20 years after the introduction of the PC, new PCs would no longer run DOS and they would no longer rely on BIOS calls once the operating system was booted.

Most PC motherboards came without any ISA slots, but they did come with on-board audio and Ethernet.

2003: SATA, PCIe, AMD64

The architecture of the PC platform continued to evolve. The ATA interface was due to be replaced with Serial ATA (SATA) and the PCI bus was due to be replaced with PCIe (a serial variant of the PCI bus with almost exactly the same software interface). While both technologies started to appear around 2003, there was again a long transition period, which is about to end in 2011. Most motherboards had both PCIe and PCI slots and had both ATA and SATA connectors. AGP was dumped fast in favor if PCIe.

In 2003 AMD introduced a 64-bit extension to the x86 instruction set, similar to the extension from 16 to 32 bits introduced by the 80386. Intel had a different 64-bit strategy based in the Itanium. The Itanium had a radically different instruction set from the x86. It did have an x86 emulation mode, but it was painfully slow. Hence an Itanium based system could not run the available software efficiently. AMD's offering on the other hand, did run 32-bit software just as efficiently as Athlon CPUs without it. The AMD64 instruction set was later copied by Intel and is now present in most of its CPUs (except for the Atom line).

Recent developments.

In 2006 Intel replaced its Pentium IV line with the Core architecture. These CPUs were less power hungry than their Pentium IV counterparts and most of them were dual core. With this, Intel took the technological lead back from AMD. From now on, most mainstream PCs would have a dual core (or more cores) CPU and SMP became the rule rather than the exception. Another interesting feature was virtualization support. The new Apple MacIntosh machines were among the first to use the new Core architecture.

Some 25 years after the introduction of the PC platform, it was about time to replace the old BIOS calls with a more modern boot firmware. EFI is to become the new boot firmware for PCs. While legacy BIOS runs in real mode, EFI runs in 32-bit protected mode. EFI supports file systems directly; it can load modules (such as device drivers) and applications (such as boot loaders) from a hard disk. Again Apple's Intel Mac was among the first PC class machines to support EFI (it was already present on Itanium machines).

Most machines sold in 2011 still have legacy BIOS as their main boot mechanism and EFI booting can be a configurable option on some machines. An exception form the Apple MacIntosh machines, which will boot from EFI and need special software to emulate legacy BIOS.

In 2009 Windows 7 was introduced. This marked the end of the floppy drive. Windows XP was shipped without any device drivers for SATA controllers and most machines since 2005 came with SATA disks. The only way to install Windows XP on such a machine was by loading an extra device driver during Windows installation. The only supported medium to load this device driver from was a floppy disk. Countless systems have been shipped with floppy drives that were only needed to load the SATA driver during Windows installation.

The 64-bit versions of Windows cannot run DOS applications because the x86_64 architecture does not support the VM86 mode along with long mode. With Windows 7, 64-bit Windows versions have become mainstream on the desktop, so in this sense it marks the end of the DOS era.

As I write this in 2011, Intel has many different x86 compatible CPU lines. With the Atom line at the low end for netbooks, via the Celeron E3xxx line, the Pentium E5xxx line, up to the high end i7 line (and this list is even far from complete). AMD has its Phenom line for the desktop and several notebook CPUs. Future trends are the inclusion of most northbridge functions in the CPU and even the integration of graphics into the CPU.