The content of the article
It would seem that there is no task easier than loading the computer: I pressed the power button, and after a short time the operating system interface appears on the screen. In fact, it is between these two events in the bowels of the machine that all the most interesting happens. Especially if you use UEFI and a disk with GPT markup. Let's take a look under the hood of your laptop or computer and see how devices using the latest technologies are loaded.
What is wrong with the BIOS?
The term BIOS itself was first discovered by archaeologists in the 1975 CP / M code. CP / M sources, in file
BDOS.PLM (CP / M 1.1) of which, under the authorship of Gary Kildall, the BASIC I / O SYSTEM was mentioned, the Computer History Museum was made freely available in 2014 in honor of the 40th anniversary of the system. If you are interested in familiarizing yourself with this historical artifact, they are available at museum site.
The basic I / O system in a sense serves as an interface between the hardware and the OS, without it the OS will not boot, and the iron will remain cold and lifeless. In addition, it has functions that can be called from the OS to access the basic capabilities of the equipment, similar to how applications use system calls to access the functions of the OS. However, operating systems still prefer to use their own drivers for working with equipment.
On x86 systems, the BIOS performs POST and hardware initialization. Then control is transferred to the primary bootloader (master boot code), which searches for the active partition and its boot sector to transfer control to it to boot the operating system. The BIOS uses the MBR markup format, which nevertheless has no strictly defined standard.
For example, Chris Kaspersky in his book “Data Recovery. A Practical Guide ”wrote that in the last four bytes reserved for the bootloader code, Windows wrote down the identifier of the disk, and this inevitably killed the bootloader using them. Thus, for the correct operation with Windows, the primary loader had to occupy no more than 442 bytes instead of the honestly allocated 446 bytes.
BIOS over 45 years of existence proved to be an incredible long-liver of the IT world, having survived floppy disks, CP / M and PL / M, MS-DOS and Windows 9x. But no matter how updated it is under modern realities, there are now a lot of 446 bytes allocated for the bootloader
unnecessary you can’t put it. The BIOS also had other shortcomings, due to which the need was ripened for replacing the 16-bit architecture, at least for the "big iron" four times the bit capacity. So the guys from Intel thought, and in 1998 the project was founded Intel Boot Initiative. The original version of the specification, developed primarily for Itanium-based machines (IA-64), was published under the name EFI (Extensible Firmware Interface) in 1999. And in 2005, on the basis of this project appeared Unified EFI Forumwho is engaged in the development and support of the technology thus born to this day.
Trouble came from where they did not wait
Sometimes you can see the designation UEFI BIOS. From the name it is clear that UEFI is positioned as an extensible interface between the hardware platform and the operating system, providing tables and calls that are available to the OS loader. This creates an environment for loading.
In addition to the main program from the firmware, UEFI can use modules to expand its functionality, for example, to support new equipment or file systems. It is understood that it is enough to write a UEFI driver and it will work the same on all compatible operating systems. In general, the BIOS interrupt system was invented for almost the same thing: when a new device appeared, it was enough to add its support in the BIOS, and the OS could access the device through the basic input / output system – it was not for nothing that it was called that.
In addition, this interface is called unified. The specification indicates that one of the goals of developing UEFI is to ensure that different OSes can boot on different hardware without making changes to the OS or the hardware platform. In other words, UEFI plays the role of an additional layer of abstraction, even the EFI Byte Code (EBC) is defined in the standard. The goals are certainly good. It’s a pity, the performance has let us down – everyone is free to implement the standard in their own way, and, for example, Chinese firmware, as they sometimes write on forums, can sometimes surprise you with their behavior.
Continuation is available only to participants
Materials from the latest issues become available separately only two months after publication. To continue reading, you must become a member of the Xakep.ru community.
Join the Xakep.ru Community!
Membership in the community during the specified period will open you access to ALL Hacker materials, increase your personal cumulative discount and allow you to accumulate a professional Xakep Score!
I am already a member of Xakep.ru