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.

Thursday, March 09, 2006

My Gentoo 2006.0

I read Tim Yamin’s announcement about 2006.0 Gentoo release on February 27, 2006.
Till that week end I couldn’t download the package. Now there is a special installer cum live cd for x86 architecture. I thought I will not have much fun this time. But actually I got lot more fun compared with last two years.

As I don’t have laptop with cd writer now, I happened to take help of internet cafĂ© to burn the iso image. But unfortunately that CD didn’t work for me. CD got a sector error when it is about to start gdm. So nothing was moving after that white screen. I couldn’t believe it first time and tried couple of more times to conclude that it is problem with CD only.

Then thought of booting the from hard drive or USB hard disk. But my machine got old USB(1.1) stuff and even the USB drive is not bootable.

So I thought of using existing gentoo installation’s boot partition (32MB) to hold kernel and initrd binarirs. Then I thought I can point the root at some other ext3 partition. I don’t remember much but that didn’t work quite well. It was always ending up with loop path error. Only thing I could guess is to keep image file on same partition where kernel and initrd are located. By then my enthusiasm is slightly down. And I decided to try alternate methods to do the same exercise.

First I want to increase boot partition size, I am not aware how to do that online. So I thought I can quickly re install gentoo 2005 with increased boot partition. Something I missed even that didn’t work out. And while doing it during midnight I screwed up my MBR. So I couldn’t even boot to XP. Then I took help of Windows 2003 evaluation CD.
I tried to install Win20003 Server on hard disk where my Linux was there. So I get a clean slate on that front and also that fixes my MBR also. Anyway I don’t have key for Win2003 Server, but I know it does over write MBR the moment you select the partition to install Windows. All this exercise took whole night.

And by morning I thought I would Grub for NT. Created just one ext2 partition and took help of grub for NT. After tweaking hear and there in grub configuration file finally I could boot the cd image from hard disk. Rest of the details I will post with the screen shots of my gentoo 2006.0. I am thinking of using crossover office and work on gentoo 2006.0 for quite some time now. Let me hope gentoo supports me.