Friday, March 24, 2006

Unified Extensible Firmware Interface

I guess the buzz word “unified” is getting prefixed everywhere. Since Jan 31 2006 it took its place in front of EFI. EFI is an Intel’s initiative and now governed by EFI Forum.
Forum released their UEFI 2 Specification a couple of months back. OK why I am writing about this now is because of Microsoft’s press release about Vista will not support EFI in initial phase. So I just want to focus some light on this subject.

The basic sequence that goes in booting a PC is, power on, load BIOS and then boot loaded and then Operating system. This is what we learned and experimented around since years. First time when you though of upgrading your BIOS, you would have got a doubt whether my PC supports BIOS upgrade though flash update or do I need to replace those funny chips. To go a bit deeper, what is BIOS doing on your box?

As you can think of every processor by virtue of hardware design can jump to particular location when it is powered on. It is not as simple as jumping, but to keep things simple just make an assumption of such feature. Then it got to find out some instructions there to run your computer. These instructions are important to build an environment where in various different components of your computer can be controlled. By then some fixed locations of your RAM are holding pointers to various device controls. So as a programmer that is your environment, schedule your tasks to leverage on this environment. But such a sophisticated program (typically operating system) consumes more footprint, which your BIOS chip doesn’t have. So BIOS need a position to jump into some location which has huge memory to feed in further instructions of operating system. Such a location is typically a mass storage device or hard disk or even a network interface card. Thus BIOS provides options to boot from floppy (this for traditional support only, can do much because of 1.44 MB limitation), cd-rom, hard disk, network, and even some new BIOS chips can understand USB flash sticks also. Mean basically BIOS need to understand how to initialize these devices and keep a place holder in RAM, so that when OS boots up it can utilize these placeholders either to reinitialize or use then to control devices.

Then what is boot loader? Now when you select hard disk option, there is some tricky thing here. There can be many hard disks and there can be many operating systems on these hard disks. BIOS solve this problem by assuming a fixed location on first hard disk which is called Master Boot Record (MBR) of your hard disk. MBR is a 512 byte block which points to operating selected. But for the operating system to boot up it requires some pre built binaries at specified location. Means kernel code will have idea about a file system that you are going to mount as root. It is this root file system that holds various small programs that help kernel initialize hardware and keep pointers.

All is good then why we need a change from BIOS? Of course the primary reason is aging. BIOS is developed in pre-historic times. Earlier it is used only to initialize and bootstrap the operating system. Later OS can reinitialize the interfaces again. But in recent times this phenomenon changed. The dependency on BIOS increased again due to advent of ACPI and hot plug stuff. This called for layered BIOS architecture.

Also BIOS, being a binary code, is specific to processor architecture. Mean different versions of BIOS are needed to boot different architecture families. To overcome this problem a byte coded BIOS is needed.

Then plug in support should be possible for BIOS. Right now additional boot options can be provided using BIOS boot specification API. And BIOS options are stored on CMOS which is a non volatile memory in addition to BIOS EEPROM. This complicated the stuff to customize the boot environment. That called for a modular architecture.

Open source community attempted to build Linux BIOS to overcome limitations of BIOS. But this is more of subject of hardware manufacturers than software. So a strong initiative from Intel kind of companies is envisaged. Thus came out EFI.

So what this can do so special is explained in much of technical terms in UEFI_2_Specification.pdf. I am going through this now. And want to write some simplistic gist out of this soon.

No comments: