Hubbry Logo
BootingBootingMain
Open search
Booting
Community hub
Booting
logo
8 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
Contribute something
Booting
Booting
from Wikipedia

A flow diagram of a computer booting

In computing, booting is the process of starting a computer as initiated via hardware such as a physical button on the computer or by a software command. After it is switched on, a computer's central processing unit (CPU) has no software in its main memory, so some process must load software into memory before it can be executed. This may be done by hardware or firmware in the CPU, or by a separate processor in the computer system. On some systems a power-on reset (POR) does not initiate booting and the operator must initiate booting after POR completes. IBM uses the term Initial Program Load (IPL) on some[nb 1] product lines.

Restarting a computer is also called rebooting, which can be "hard", e.g. after electrical power to the CPU is switched from off to on, or "soft", where the power is not cut. On some systems, a soft boot may optionally clear RAM to zero. Both hard and soft booting can be initiated by hardware, such as a button press, or by a software command. Booting is complete when the operative runtime system, typically the operating system and some applications,[nb 2] is attained.

The process of returning a computer from a state of sleep (suspension) does not involve booting; however, restoring it from a state of hibernation does. Minimally, some embedded systems do not require a noticeable boot sequence to begin functioning, and when turned on, may simply run operational programs that are stored in read-only memory (ROM). All computing systems are state machines, and a reboot may be the only method to return to a designated zero-state from an unintended, locked state.

In addition to loading an operating system or stand-alone utility, the boot process can also load a storage dump program for diagnosing problems in an operating system.

Boot is short for bootstrap[1][2] or bootstrap load and derives from the phrase to pull oneself up by one's bootstraps.[3][4] The usage calls attention to the requirement that, if most software is loaded onto a computer by other software already running on the computer, some mechanism must exist to load the initial software onto the computer.[5] Early computers used a variety of ad-hoc methods to get a small program into memory to solve this problem. The invention of ROM of various types solved this paradox by allowing computers to be shipped with a start-up program, stored in the boot ROM of the computer, that could not be erased. Growth in the capacity of ROM has allowed ever more elaborate start up procedures to be implemented.

History

[edit]
Switches and cables used to program ENIAC (1946)

There are many different methods available to load a short initial program into a computer. These methods range from simple, physical input to removable media that can hold more complex programs.

Pre integrated-circuit-ROM examples

[edit]

Early computers

[edit]

Early computers in the 1940s and 1950s were one-of-a-kind engineering efforts that could take weeks to program, and program loading was one of many problems that had to be solved. An early computer, ENIAC, had no program stored in memory but was set up for each problem by a configuration of interconnecting cables. Bootstrapping did not apply to ENIAC, whose hardware configuration was ready for solving problems as soon as power was applied.

The EDSAC system, the second stored-program computer to be built, used stepping switches to transfer a fixed program into memory when its start button was pressed. The program stored on this device, which David Wheeler completed in late 1948, loaded further instructions from punched tape and then executed them.[6][7]

First commercial computers

[edit]

The first programmable computers for commercial sale, such as the UNIVAC I and the IBM 701[8] included features to make their operation simpler. They typically included instructions that performed a complete input or output operation. The same hardware logic could be used to load the contents of a punch card (the most typical ones) or other input media, such as a magnetic drum or magnetic tape, that contained a bootstrap program by pressing a single button. This booting concept was called a variety of names for IBM computers of the 1950s and early 1960s, but IBM used the term "Initial Program Load" with the IBM 7030 Stretch[9] and later used it for their mainframe lines, starting with the System/360 in 1964.

Initial program load punched card for the IBM 1130 (1965)

The IBM 701 computer (1952–1956) had a "Load" button that initiated reading of the first 36-bit word into main memory from a punched card in a card reader, a magnetic tape in a tape drive, or a magnetic drum unit, depending on the position of the Load Selector switch. The left 18-bit half-word was then executed as an instruction, which usually read additional words into memory.[10][11] The loaded boot program was then executed, which, in turn, loaded a larger program from that medium into memory without further help from the human operator. The IBM 704,[12] IBM 7090,[13] and IBM 7094[14] had similar mechanisms, but with different load buttons for different devices. The term "boot" has been used in this sense since at least 1958.[15]

IBM System/3 console from the 1970s. Program load selector switch is lower left; Program load switch is lower right.

Other IBM computers of that era had similar features. For example, the IBM 1401 system (1959) used a card reader to load a program from a punched card. The 80 characters stored in the punched card were read into memory locations 001 to 080, then the computer would branch to memory location 001 to read its first stored instruction. This instruction was always the same: move the information in these first 80 memory locations to an assembly area where the information in punched cards 2, 3, 4, and so on, could be combined to form the stored program. Once this information was moved to the assembly area, the machine would branch to an instruction in location 080 (read a card) and the next card would be read and its information processed.

Another example was the IBM 650 (1953), a decimal machine, which had a group of ten 10-position switches on its operator panel that were addressable as a memory word (address 8000) and could be executed as an instruction. Thus, setting the switches to 7004000400 and pressing the appropriate button would read the first card in the card reader into memory (op code 70), starting at address 400 and then jump to 400 to begin executing the program on that card.[16] The IBM 7040 and 7044 have a similar mechanism, in which the Load button causes the instruction set up in the entry keys on the front panel is executed, and the channel that instruction sets up is given a command to transfer data to memory starting at address 00100; when that transfer finishes, the CPU jumps to address 00101.[17]

IBM's competitors also offered single-button program load.

  • The CDC 6600 (c. 1964) had a dead start panel with 144 toggle switches; the dead start switch entered 12 12-bit words from the toggle switches to the memory of peripheral processor (PP) 0 and initiated the load sequence by causing PP 0 to execute the code loaded into memory.[18] PP 0 loaded the necessary code into its own memory and then initialized the other PPs.
  • The GE 645 (c. 1965) had a "SYSTEM BOOTLOAD" button that, when pressed, caused one of the I/O controllers to load a 64-word program into memory from a diode read-only memory and deliver an interrupt to cause that program to start running.[19]
  • The first model of the PDP-10 had a "READ IN" button that, when pressed, reset the processor and started an I/O operation on a device specified by switches on the control panel, reading in a 36-bit word giving a target address and count for subsequent word reads; when the read completed, the processor started executing the code read in by jumping to the last word read in.[20]

A noteworthy variation of this is found on the Burroughs B1700 where there is neither a boot ROM nor a hardwired IPL operation. Instead, after the system is reset it reads and executes microinstructions sequentially from a cassette tape drive mounted on the front panel; this sets up a boot loader in RAM which is then executed.[21] However, since this makes few assumptions about the system it can equally well be used to load diagnostic (Maintenance Test Routine) tapes which display an intelligible code on the front panel even in cases of gross CPU failure.[21]

IBM System/360 and successors

[edit]

In the IBM System/360 and its successors, including the current z/Architecture machines, the boot process is known as Initial Program Load (IPL).

IBM coined this term for the 7030 (Stretch),[9] revived it for the design of the System/360, and continues to use it in those environments today.[22] In the System/360 processors, an IPL is initiated by the computer operator by selecting the three hexadecimal digit device address (CUU; C=I/O Channel address, UU=Control unit and Device address[nb 3]) followed by pressing the LOAD button. On the high end System/360 models, most[nb 4] System/370 and some later systems, the functions of the switches and the LOAD button are simulated using selectable areas on the screen of a graphics console, often[nb 5] an IBM 2250-like device or an IBM 3270-like device. For example, on the System/370 Model 158, the keyboard sequence 0-7-X (zero, seven and X, in that order) results in an IPL from the device address that was keyed into the input area. The Amdahl 470V/6 and related CPUs supported four hexadecimal digits on those CPUs that had the optional second channel unit installed, for a total of 32 channels. Later, IBM would also support more than 16 channels.

The IPL function in the System/360 and its successors prior to IBM Z, and its compatibles, such as Amdahl's, reads 24 bytes from an operator-specified device into main storage starting at real address zero. The second and third groups of eight bytes are treated as Channel Command Words (CCWs) to continue loading the startup program (the first CCW is always simulated by the CPU and consists of a Read IPL command, 02h, with command chaining and suppress incorrect length indication being enforced). When the I/O channel commands are complete, the first group of eight bytes is then loaded into the processor's Program Status Word (PSW) and the startup program begins execution at the location designated by that PSW.[22] The IPL device is usually a disk drive, hence the special significance of the 02h read-type command, but exactly the same procedure is also used to IPL from other input-type devices, such as tape drives, or even card readers, in a device-independent manner, allowing, for example, the installation of an operating system on a brand-new computer from an OS initial distribution magnetic tape. For disk controllers, the 02h command also causes the selected device to seek to cylinder 0000h, head 0000h, simulating a Seek cylinder and head command, 07h, and to search for record 01h, simulating a Search ID Equal command, 31h; seeks and searches are not simulated by tape and card controllers, as for these device classes a Read IPL command is simply a sequential read command.

The disk, tape or card deck must contain a special program to load the actual operating system or standalone utility into main storage, and for this specific purpose, "IPL Text" is placed on the disk by the stand-alone DASDI (Direct Access Storage Device Initialization) program or an equivalent program running under an operating system, e.g., ICKDSF, but IPL-able tapes and card decks are usually distributed with this "IPL Text" already present.

IBM introduced some evolutionary changes in the IPL process, changing some details for System/370 Extended Architecture (S/370-XA) and later, and adding a new type of IPL for z/Architecture.

Minicomputers

[edit]
PDP-8/E front panel showing the switches used to load the bootstrap program

Minicomputers, starting with the Digital Equipment Corporation (DEC) PDP-5 and PDP-8 (1965) simplified design by using the CPU to assist input and output operations. This saved cost but made booting more complicated than pressing a single button. Minicomputers typically had some way to toggle in short programs by manipulating an array of switches on the front panel. Since the early minicomputers used magnetic-core memory, which did not lose its information when power was off, these bootstrap loaders would remain in place unless they were erased. Erasure sometimes happened accidentally when a program bug caused a loop that overwrote all of memory.

Other minicomputers with such simple form of booting include Hewlett-Packard's HP 2100 series (mid-1960s), the original Data General Nova (1969), and DEC's PDP-4 (1962) and PDP-11 (1970).

As the I/O operations needed to cause a read operation on a minicomputer I/O device were typically different for different device controllers, different bootstrap programs were needed for different devices.

DEC later added, in 1971, an optional diode matrix read-only memory for the PDP-11 that stored a bootstrap program of up to 32 words (64 bytes). It consisted of a printed circuit card, the M792, that plugged into the Unibus and held a 32 by 16 array of semiconductor diodes. With all 512 diodes in place, the memory contained all "one" bits; the card was programmed by cutting off each diode whose bit was to be "zero". DEC also sold versions of the card, the BM792-Yx series, pre-programmed for many standard input devices by simply omitting the unneeded diodes.[23][24]

Following the older approach, the earlier PDP-1 has a hardware loader, such that an operator need only push the "load" switch to instruct the paper tape reader to load a program directly into core memory. The PDP-7,[25] PDP-9,[26] and PDP-15[27] successors to the PDP-4 have an added Read-In button to read a program in from paper tape and jump to it. The Data General Supernova used front panel switches to cause the computer to automatically load instructions into memory from a device specified by the front panel's data switches, and then jump to loaded code.[28]

Early minicomputer boot loader examples
[edit]

In a minicomputer with a paper tape reader, the first program to run in the boot process, the boot loader, would read into core memory either the second-stage boot loader (often called a Binary Loader) that could read paper tape with checksum or the operating system from an outside storage medium. Pseudocode for the boot loader might be as simple as the following eight instructions:

  1. Set the P register to 9
  2. Check paper tape reader ready
  3. If not ready, jump to 2
  4. Read a byte from paper tape reader to accumulator
  5. Store accumulator to address in P register
  6. If end of tape, jump to 9
  7. Increment the P register
  8. Jump to 2

A related example is based on a loader for a Nicolet Instrument Corporation minicomputer of the 1970s, using the paper tape reader-punch unit on a Teletype Model 33 ASR teleprinter. The bytes of its second-stage loader are read from paper tape in reverse order.

  1. Set the P register to 106
  2. Check paper tape reader ready
  3. If not ready, jump to 2
  4. Read a byte from paper tape reader to accumulator
  5. Store accumulator to address in P register
  6. Decrement the P register
  7. Jump to 2

The length of the second stage loader is such that the final byte overwrites location 7. After the instruction in location 6 executes, location 7 starts the second stage loader executing. The second stage loader then waits for the much longer tape containing the operating system to be placed in the tape reader. The difference between the boot loader and second stage loader is the addition of checking code to trap paper tape read errors, a frequent occurrence with relatively low-cost, "part-time-duty" hardware, such as the Teletype Model 33 ASR. (Friden Flexowriters were far more reliable, but also comparatively costly.)

Booting the first microcomputers

[edit]

The earliest microcomputers, such as the Altair 8800 (released first in 1975) and an even earlier, similar machine (based on the Intel 8008 CPU) had no bootstrapping hardware as such.[29] When powered-up, the CPU would see memory that would contain random data. The front panels of these machines carried toggle switches for entering addresses and data, one switch per bit of the computer memory word and address bus. Simple additions to the hardware permitted one memory location at a time to be loaded from those switches to store bootstrap code. Meanwhile, the CPU was kept from attempting to execute memory content. Once correctly loaded, the CPU was enabled to execute the bootstrapping code. This process, similar to that used for several earlier minicomputers, was tedious and had to be error-free.[30]

Integrated circuit read-only memory era

[edit]
An Intel 2708 EPROM "chip" on a circuit board

The introduction of integrated circuit read-only memory (ROM), with its many variants, including mask-programmed ROMs, programmable ROMs (PROM), erasable programmable ROMs (EPROM), and flash memory, reduced the physical size and cost of ROM. This allowed firmware boot programs to be included as part of the computer.

Minicomputers

[edit]

The Data General Nova 1200 (1970) and Nova 800 (1971) had a program load switch that, in combination with options that provided two ROM chips, loaded a program into main memory from those ROM chips and jumped to it.[28] Digital Equipment Corporation introduced the integrated-circuit-ROM-based BM873 (1974),[31] M9301 (1977),[32] M9312 (1978),[33] REV11-A and REV11-C,[34] MRV11-C,[35] and MRV11-D[36] ROM memories, all usable as bootstrap ROMs. The PDP-11/34 (1976),[37] PDP-11/60 (1977),[38] PDP-11/24 (1979),[39] and most later models include boot ROM modules.

An Italian telephone switching computer, called "Gruppi Speciali", patented in 1975 by Alberto Ciaramella, a researcher at CSELT,[40] included an (external) ROM. Gruppi Speciali was, starting from 1975, a fully single-button machine booting into the operating system from a ROM memory composed from semiconductors, not from ferrite cores. Although the ROM device was not natively embedded in the computer of Gruppi Speciali, due to the design of the machine, it also allowed the single-button ROM booting in machines not designed for that (therefore, this "bootstrap device" was architecture-independent), e.g. the PDP-11. Storing the state of the machine after the switch-off was also in place, which was another critical feature in the telephone switching contest.[41]

Some minicomputers and superminicomputers include a separate console processor that bootstraps the main processor. The PDP-11/44 had an Intel 8085 as a console processor;[42] the VAX-11/780, the first member of Digital's VAX line of 32-bit superminicomputers, had an LSI-11-based console processor,[43] and the VAX-11/730 had an 8085-based console processor.[44] These console processors could boot the main processor from various storage devices.

Some other superminicomputers, such as the VAX-11/750, implement console functions, including the first stage of booting, in CPU microcode.[45]

Microprocessors and microcomputers

[edit]

Typically, a microprocessor will, after a reset or power-on condition, perform a start-up process that usually takes the form of "begin execution of the code that is found starting at a specific address" or "look for a multibyte code at a specific address and jump to the indicated location to begin execution". A system built using that microprocessor will have the permanent ROM occupying these special locations so that the system always begins operating without operator assistance. For example, Intel x86 processors always start by running the instructions beginning at F000:FFF0,[46][47] while for the MOS 6502 processor, initialization begins by reading a two-byte vector address at $FFFD (MS byte) and $FFFC (LS byte) and jumping to that location to run the bootstrap code.[48]

Apple Computer's first computer, the Apple 1 introduced in 1976, featured PROM chips that eliminated the need for a front panel for the boot process (as was the case with the Altair 8800) in a commercial computer. According to Apple's ad announcing it, "No More Switches, No More Lights ... the firmware in PROMS enables you to enter, display and debug programs (all in hex) from the keyboard."[49]

Due to the expense of read-only memory at the time, the Apple II booted its disk operating systems using a series of very small incremental steps, each passing control onward to the next phase of the gradually more complex boot process. (See Apple DOS: Boot loader). Because so little of the disk operating system relied on ROM, the hardware was also extremely flexible and supported a wide range of customized disk copy protection mechanisms. (See Software Cracking: History.)

Some operating systems, most notably pre-1995 Macintosh systems from Apple, are so closely interwoven with their hardware that it is impossible to natively boot an operating system other than the standard one. This is the opposite extreme of the scenario using switches mentioned above; it is highly inflexible but relatively error-proof and foolproof as long as all hardware is working normally. A common solution in such situations is to design a boot loader that works as a program belonging to the standard OS that hijacks the system and loads the alternative OS. This technique was used by Apple for its A/UX Unix implementation and copied by various freeware operating systems and BeOS Personal Edition 5.

Some machines, like the Atari ST microcomputer, were "instant-on", with the operating system executing from a ROM. Retrieval of the OS from secondary or tertiary store was thus eliminated as one of the characteristic operations for bootstrapping. To allow system customizations, accessories, and other support software to be loaded automatically, the Atari's floppy drive was read for additional components during the boot process. There was a timeout delay that provided time to manually insert a floppy as the system searched for the extra components. This could be avoided by inserting a blank disk. The Atari ST hardware was also designed so the cartridge slot could provide native program execution for gaming purposes as a holdover from Atari's legacy making electronic games; by inserting the Spectre GCR cartridge with the Macintosh system ROM in the game slot and turning the Atari on, it could "natively boot" the Macintosh operating system rather than Atari's own TOS.

The IBM Personal Computer included ROM-based firmware called the BIOS; one of the functions of that firmware was to perform a power-on self test when the machine was powered up, and then to read software from a boot device and execute it. Firmware compatible with the BIOS on the IBM Personal Computer is used in IBM PC compatible computers. The UEFI was developed by Intel, originally for Itanium-based machines, and later also used as an alternative to the BIOS in x86-based machines, including Apple Macs using Intel processors.

Unix workstations originally had vendor-specific ROM-based firmware. Sun Microsystems later developed OpenBoot, later known as Open Firmware, which incorporated a Forth interpreter, with much of the firmware being written in Forth. It was standardized by the IEEE as IEEE standard 1275-1994; firmware that implements that standard was used in PowerPC-based Macs and some other PowerPC-based machines, as well as Sun's own SPARC-based computers. The Advanced RISC Computing specification defined another firmware standard, which was implemented on some MIPS-based and Alpha-based machines and the SGI Visual Workstation x86-based workstations.

Modern boot loaders

[edit]

When a computer is turned off, its software‍—‌including operating systems, application code, and data‍—‌remains stored on non-volatile memory. When the computer is powered on, it typically does not have an operating system or its loader in random-access memory (RAM). The computer first executes a relatively small program stored in read-only memory (ROM, and later EEPROM, NOR flash) which support execute in place, to initialize CPU and motherboard, to initialize the memory (especially on x86 systems), to initialize and access the storage (usually a block-addressed device, e.g. hard disk drive, NAND flash, solid-state drive) from which the operating system programs and data can be loaded into RAM, and to initialize other I/O devices.

The small program that starts this sequence is known as a bootstrap loader, bootstrap or boot loader. Often, multiple-stage boot loaders are used, during which several programs of increasing complexity load one after the other in a process of chain loading.

Some earlier computer systems, upon receiving a boot signal from a human operator or a peripheral device, may load a very small number of fixed instructions into memory at a specific location, initialize at least one CPU, and then point the CPU to the instructions and start their execution. These instructions typically start an input operation from some peripheral device (which may be switch-selectable by the operator). Other systems may send hardware commands directly to peripheral devices or I/O controllers that cause an extremely simple input operation (such as "read sector zero of the system device into memory starting at location 1000") to be carried out, effectively loading a small number of boot loader instructions into memory; a completion signal from the I/O device may then be used to start execution of the instructions by the CPU.

Smaller computers often use less flexible but more automatic boot loader mechanisms to ensure that the computer starts quickly and with a predetermined software configuration. In many desktop computers, for example, the bootstrapping process begins with the CPU executing software contained in ROM (for example, the BIOS of an IBM PC) at a predefined address (some CPUs, including the Intel x86 series are designed to execute this software after reset without outside help). This software contains rudimentary functionality to search for devices eligible to participate in booting, and load a small program from a special section (most commonly the boot sector) of the most promising device, typically starting at a fixed entry point such as the start of the sector.

Boot loaders may face peculiar constraints, especially in size; for instance, on the IBM PC and compatibles, the boot code must fit in the Master Boot Record (MBR) and the Partition Boot Record (PBR), which in turn are limited to a single sector; on the IBM System/360, the size is limited by the IPL medium, e.g., card size, track size.

On systems with those constraints, the first program loaded into RAM may not be sufficiently large to load the operating system and, instead, must load another, larger program. The first program loaded into RAM is called a first-stage boot loader, and the program it loads is called a second-stage boot loader. On many embedded CPUs, the CPU built-in boot ROM, sometimes called the zero-stage boot loader,[50] can find and load first-stage boot loaders.

First-stage boot loaders

[edit]

Examples of first-stage (hardware initialization stage) boot loaders include BIOS, UEFI, coreboot, Libreboot and Das U-Boot. On the IBM PC, the boot loader in the Master Boot Record (MBR) and the Partition Boot Record (PBR) was coded to require at least 32 KB[51][52] (later expanded to 64 KB[53]) of system memory and only use instructions supported by the original 8088/8086 processors.

Second-stage boot loaders

[edit]

Second-stage (OS initialization stage) boot loaders, such as shim,[54] GNU GRUB, rEFInd, BOOTMGR, Syslinux, and NTLDR, are not themselves operating systems, but are able to load an operating system properly and transfer execution to it; the operating system subsequently initializes itself and may load extra device drivers. The second-stage boot loader does not need drivers for its own operation, but may instead use generic storage access methods provided by system firmware such as the BIOS, UEFI or Open Firmware, though typically with restricted hardware functionality and lower performance.[55]

Many boot loaders (like GNU GRUB, rEFInd, Windows's BOOTMGR, Syslinux, and Windows NT/2000/XP's NTLDR) can be configured to give the user multiple booting choices. These choices can include different operating systems (for dual or multi-booting from different partitions or drives), different versions of the same operating system (in case a new version has unexpected problems), different operating system loading options (e.g., booting into a rescue or safe mode), and some standalone programs that can function without an operating system, such as memory testers (e.g., memtest86+), a basic shell (as in GNU GRUB), or even games (see List of PC Booter games).[56] Some boot loaders can also load other boot loaders; for example, GRUB loads BOOTMGR instead of loading Windows directly. Usually a default choice is preselected with a time delay during which a user can press a key to change the choice; after this delay, the default choice is automatically run so normal booting can occur without interaction.

The boot process can be considered complete when the computer is ready to interact with the user, or the operating system is capable of running system programs or application programs.

First and second stages boot loaders

[edit]

Some boot loaders, such as Das U-Boot and iBoot, included both first and second stages boot functions.

Embedded and multi-stage boot loaders

[edit]

Many embedded systems must boot immediately. For example, waiting a minute for a digital television or a GPS navigation device to start is generally unacceptable. Therefore, such devices have software systems in ROM or flash memory so the device can begin functioning immediately; little or no loading is necessary, because the loading can be precomputed and stored on the ROM when the device is made.[citation needed]

Large and complex systems may have boot procedures that proceed in multiple phases until finally the operating system and other programs are loaded and ready to execute. Because operating systems are designed as if they never start or stop, a boot loader might load the operating system, configure itself as a mere process within that system, and then irrevocably transfer control to the operating system. The boot loader then terminates normally as any other process would.

Network booting

[edit]

Most computers are also capable of booting over a computer network. In this scenario, the operating system is stored on the disk of a server, and certain parts of it are transferred to the client using a simple protocol such as the Trivial File Transfer Protocol (TFTP). After these parts have been transferred, the operating system takes over the control of the booting process.

As with the second-stage boot loader, network booting begins by using generic network access methods provided by the network interface's boot ROM, which typically contains a Preboot Execution Environment (PXE) image. No drivers are required, but the system functionality is limited until the operating system kernel and drivers are transferred and started. As a result, once the ROM-based booting has completed it is entirely possible to network boot into an operating system that itself does not have the ability to use the network interface.

IBM-compatible personal computers (PC)

[edit]

Boot devices

[edit]

Windows To Go bootable flash drive, a Live USB example

The boot device is the storage device from which the operating system is loaded. A modern PC's UEFI or BIOS firmware supports booting from various devices, typically a local solid-state drive or hard disk drive via the GPT or Master Boot Record (MBR) on such a drive or disk, an optical disc drive (using El Torito), a USB mass storage device (USB flash drive, memory card reader, USB hard disk drive, USB optical disc drive, USB solid-state drive, etc.), or a network interface card (using PXE). Older, less common BIOS-bootable devices include floppy disk drives, Zip drives, and LS-120 drives.

Typically, the system firmware (UEFI or BIOS) will allow the user to configure a boot order. If the boot order is set to "first, the DVD drive; second, the hard disk drive", then the firmware will try to boot from the DVD drive, and if this fails (e.g. because there is no DVD in the drive), it will try to boot from the local hard disk drive.

For example, on a PC with Windows installed on the hard drive, the user could set the boot order to the one given above, and then insert a Linux Live CD in order to try out Linux without having to install an operating system onto the hard drive. This is an example of dual booting, in which the user chooses which operating system to start after the computer has performed its power-on self-test (POST). In this example of dual booting, the user chooses by inserting or removing the DVD from the computer, but it is more common to choose which operating system to boot by selecting from a boot manager menu on the selected device, by using the computer keyboard to select from a BIOS or UEFI boot menu, or both; the boot menu is typically entered by pressing F8 or F12 keys during the POST; the BIOS setup is typically entered by pressing F2 or DEL keys during the POST.[57][58]

Several devices are available that enable the user to quick-boot into what is usually a variant of Linux for various simple tasks such as Internet access; examples are Splashtop and Latitude ON.[59][60][61]

Boot sequence

[edit]
A hex dump of FreeBSD's boot0 MBR
Award Software BIOS from 2000 during booting

Upon starting, an IBM-compatible personal computer's x86 CPU, executes in real mode, the instruction located at reset vector (the physical memory address FFFF0h on 16-bit x86 processors[62] and FFFFFFF0h on 32-bit and 64-bit x86 processors[63][64]), usually pointing to the firmware (UEFI or BIOS) entry point inside the ROM. This memory location typically contains a jump instruction that transfers execution to the location of the firmware (UEFI or BIOS) start-up program. This program runs a power-on self-test (POST) to check and initialize required devices such as main memory (DRAM), the PCI bus and the PCI devices (including running embedded option ROMs). One of the most involved steps is setting up DRAM over SPD, further complicated by the fact that at this point memory is very limited.

After initializing required hardware, the firmware (UEFI or BIOS) goes through a pre-configured list of non-volatile storage devices ("boot device sequence") until it finds one that is bootable.

BIOS

[edit]

Once the BIOS has found a bootable device it loads the boot sector to linear address 7C00h (usually segment:offset 0000h:7C00h,[51][53]: 29  but some BIOSes erroneously use 07C0h:0000h[citation needed]) and transfers execution to the boot code. In the case of a hard disk, this is referred to as the Master Boot Record (MBR). The conventional MBR code checks the MBR's partition table for a partition set as bootable[nb 6] (the one with active flag set). If an active partition is found, the MBR code loads the boot sector code from that partition, known as Volume Boot Record (VBR), and executes it. The MBR boot code is often operating-system specific.

A bootable MBR device is defined as one that can be read from, and where the last two bytes of the first sector contain the little-endian word AA55h,[nb 7] found as byte sequence 55h, AAh on disk (also known as the MBR boot signature), or where it is otherwise established that the code inside the sector is executable on x86 PCs.

The boot sector code is the first-stage boot loader. It is located on fixed disks and removable drives, and must fit into the first 446 bytes of the Master Boot Record in order to leave room for the default 64-byte partition table with four partition entries and the two-byte boot signature, which the BIOS requires for a proper boot loader — or even less, when additional features like more than four partition entries (up to 16 with 16 bytes each), a disk signature (6 bytes), a disk timestamp (6 bytes), an Advanced Active Partition (18 bytes) or special multi-boot loaders have to be supported as well in some environments. In floppy and superfloppy Volume Boot Records, up to 59 bytes are occupied for the Extended BIOS Parameter Block on FAT12 and FAT16 volumes since DOS 4.0, whereas the FAT32 EBPB introduced with DOS 7.1 requires even 87 bytes, leaving only 423 bytes for the boot loader when assuming a sector size of 512 bytes. Microsoft boot sectors therefore traditionally imposed certain restrictions on the boot process, for example, the boot file had to be located at a fixed position in the root directory of the file system and stored as consecutive sectors,[65][66] conditions taken care of by the SYS command and slightly relaxed in later versions of DOS.[66][nb 8] The boot loader was then able to load the first three sectors of the file into memory, which happened to contain another embedded boot loader able to load the remainder of the file into memory.[66] When Microsoft added LBA and FAT32 support, they even switched to a boot loader reaching over two physical sectors and using 386 instructions for size reasons. At the same time other vendors managed to squeeze much more functionality into a single boot sector without relaxing the original constraints on only minimal available memory (32 KB) and processor support (8088/8086).[nb 9] For example, DR-DOS boot sectors are able to locate the boot file in the FAT12, FAT16 and FAT32 file system, and load it into memory as a whole via CHS or LBA, even if the file is not stored in a fixed location and in consecutive sectors.[67][51][68][69][70][nb 10][nb 9]

The VBR is often OS-specific; however, its main function is to load and execute the operating system boot loader file (such as bootmgr or ntldr), which is the second-stage boot loader, from an active partition. Then the boot loader loads the OS kernel from the storage device.

If there is no active partition, or the active partition's boot sector is invalid, the MBR may load a secondary boot loader which will select a partition (often via user input) and load its boot sector, which usually loads the corresponding operating system kernel. In some cases, the MBR may also attempt to load secondary boot loaders before trying to boot the active partition. If all else fails, it should issue an INT 18h[53][51] BIOS interrupt call (followed by an INT 19h just in case INT 18h would return) in order to give back control to the BIOS, which would then attempt to boot off other devices, attempt a remote boot via network.[51]

UEFI

[edit]

Many modern systems (Intel Macs and newer PCs) use UEFI.[71][72]

Unlike BIOS, UEFI (not Legacy boot via CSM) does not rely on boot sectors, UEFI system loads the boot loader (EFI application file in USB disk or in the EFI System Partition) directly,[73] and the OS kernel is loaded by the boot loader.

SoCs, embedded systems, microcontrollers, and FPGAs

[edit]

An unlocked bootloader of an Android device, showing additional available options

Many modern CPUs, SoCs and microcontrollers (for example, TI OMAP) or sometimes even digital signal processors (DSPs) may have a boot ROM integrated directly into their silicon, so such a processor can perform a simple boot sequence on its own and load boot programs (firmware or software) from boot sources such as NAND flash or eMMC. It is difficult to hardwire all the required logic for handling such devices, so an integrated boot ROM is used instead in such scenarios. Also, a boot ROM may be able to load a boot loader or diagnostic program via serial interfaces like UART, SPI, USB and so on. This feature is often used for system recovery purposes, or it could also be used for initial non-volatile memory programming when there is no software available in the non-volatile memory yet. Many modern microcontrollers (e.g. flash memory controller on USB flash drives) have firmware ROM integrated directly into their silicon.

Some embedded system designs may also include an intermediary boot sequence step. For example, Das U-Boot may be split into two stages: the platform would load a small SPL (Secondary Program Loader), which is a stripped-down version of U-Boot, and the SPL would do some initial hardware configuration (e.g. DRAM initialization using CPU cache as RAM) and load the larger, fully featured version of U-Boot.[74] Such embedded systems may used highly customized hardware and software, and their boot programs may be simpler.[75] Some CPUs and SoCs may not use CPU cache as RAM on boot process, they use an integrated boot processor to do some hardware configuration, to reduce cost.[76]

It is also possible to take control of a system by using a hardware debug interface such as JTAG. Such an interface may be used to write the boot loader program into bootable non-volatile memory (e.g. flash) by instructing the processor core to perform the necessary actions to program non-volatile memory. Alternatively, the debug interface may be used to upload some diagnostic or boot code into RAM, and then to start the processor core and instruct it to execute the uploaded code. This allows, for example, the recovery of embedded systems where no software remains on any supported boot device, and where the processor does not have any integrated boot ROM. JTAG is a standard and popular interface; many CPUs, microcontrollers and other devices are manufactured with JTAG interfaces (as of 2009).[citation needed]

Some microcontrollers provide special hardware interfaces that cannot be used to take arbitrary control of a system or directly run code, but instead they allow the insertion of boot code into bootable non-volatile memory (like flash memory) via simple protocols. Then at the manufacturing phase, such interfaces are used to inject boot code (and possibly other code) into non-volatile memory. After system reset, the microcontroller begins to execute code programmed into its non-volatile memory, just like usual processors are using ROMs for booting. Most notably, this technique is used by Atmel AVR microcontrollers, and by others as well. In many cases such interfaces are implemented by hardwired logic. In other cases such interfaces could be created by software running in integrated on-chip boot ROM from GPIO pins.

Most DSPs have a serial mode boot and a parallel mode boot, such as the host port interface (HPI boot).

In the case of DSPs, there is often a second microprocessor or microcontroller present in the system design, and this is responsible for overall system behavior, interrupt handling, dealing with external events, user interface, etc., while the DSP is dedicated to signal processing tasks only. In such systems, the DSP could be booted by another processor which is sometimes referred as the host processor (giving name to a Host Port). Such a processor is also sometimes referred as the master, since it usually boots first from its own memories and then controls overall system behavior, including booting of the DSP, and then further controlling the DSP's behavior. The DSP often lacks its own boot memories and relies on the host processor to supply the required code instead. The most notable systems with such a design are cell phones, modems, audio and video players and so on, where a DSP and a CPU/microcontroller coexist.

Many FPGA chips load their configuration from an external configuration ROM, typically a serial EEPROM, on power-up.

Security

[edit]

Various measures have been implemented that enhance the security of the booting process. Some of them are made mandatory, others can be disabled or enabled by the end user. Traditionally, booting did not involve the use of cryptography. The security can be bypassed by unlocking the boot loader, which might or might not be approved by the manufacturer. Modern boot loaders make use of concurrency, meaning they can run multiple processor cores and threads at the same time, which add extra layers of complexity to secure booting.

Matthew Garrett argued that booting security serves a legitimate goal but in doing so chooses defaults that are hostile to users.[77]

Measures

[edit]
  • UEFI secure boot[78]
  • Android Verified boot
  • Samsung Knox
  • Measured boot with the Trusted Platform Module, also known as "trusted boot".
  • Intel BootGuard
  • Disk encryption
  • Firmware passwords

Bootloop

[edit]
UART console of a TP-Link router with OpenWrt that is stuck in a bootloop

When debugging a concurrent and distributed system of systems, a bootloop (also written boot loop or boot-loop) is a diagnostic condition of an erroneous state that occurs on computing devices; when those devices repeatedly fail to complete the booting process and restart before a boot sequence is finished, a restart might prevent a user from accessing the regular interface.

As the complexity of today's products increases, single projects, single departments or even single companies can no longer develop total products, causing concurrent and distributed development. Today and worldwide, industries are facing complex product development and its vast array of associated problems, relating to project organization, project control and product quality. Many processes will become distributed as well. The defect detection process, so important for measuring and eventually achieving product quality, is typically one of the first to experience problems caused by the distributed nature of the project. The distribution of defect detection activities over several parties introduces risks like the inadequate review of work products, occurrence of "blind spots" with respect to test coverage or over-testing of components. Lifecycle-wide coordination of defect detection is therefore needed to ensure effectiveness and efficiency of defect detection activities. —J.J.M. Trienekens; R.J. Kusters. (2004)[79]

Detection of an erroneous state

[edit]

The system might exhibit its erroneous state in, for example, an explicit bootloop or a blue screen of death, before recovery is indicated.[80] Detection of an erroneous state may require a distributed event store and stream-processing platform for real-time operation of a distributed system.

Recovery from an erroneous state

[edit]

An erroneous state can trigger bootloops; this state can be caused by misconfiguration from previously known-good operations. Recovery attempts from that erroneous state then enter a reboot, in an attempt to return to a known-good state. In Windows OS operations, for example, the recovery procedure was to reboot three times, the reboots needed to return to a usable menu.[81][82][80]

Recovery policy

[edit]

Recovery might be specified via Security Assertion Markup Language (SAML), which can also implement Single sign-on (SSO) for some applications; in the zero trust security model identification, authorization, and authentication are separable concerns in an SSO session. When recovery of a site is indicated (viz. a blue screen of death is displayed on an airport terminal screen)[a] personal site visits might be required to remediate the situation.[79]

Examples

[edit]

See also

[edit]

Notes

[edit]

References

[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
Booting, also known as , is the startup process by which a computer initializes its hardware components, performs diagnostic checks, loads the operating kernel into , and prepares the device for user interaction and software execution. The term derives from the phrase "pulling oneself up by one's bootstraps," emphasizing the computer's ability to initialize itself without external assistance. This fundamental sequence ensures that the 's resources, such as the CPU, RAM, and storage devices, are properly configured before the operating takes control. The process begins immediately upon powering on the device and is essential for transforming raw hardware into a functional environment. The booting sequence typically unfolds in several distinct phases. First, the (POST) runs to verify the integrity of core hardware like the processor, memory, and peripherals, often indicated by beeps or LED signals if issues arise. Next, the firmware—traditionally the (BIOS) or its modern successor, the (UEFI)—initializes the hardware, checks the boot order of devices (such as hard drives, SSDs, or USB drives), and locates a bootable medium. The , a small program stored on the boot device, then loads the operating system files into (RAM), transferring control to the kernel, which completes the initialization of drivers and system services. This multi-stage handover ensures reliability, with UEFI offering advantages over legacy BIOS, including faster startup times, support for larger storage devices, and enhanced security features like verification. Modern booting processes incorporate security mechanisms to protect against and unauthorized modifications. Secure Boot, for instance, verifies the cryptographic signatures of the , kernel, and drivers before loading them, preventing rootkits or bootkits from compromising the system at startup. Additionally, optimizations such as fast boot modes—common in Windows and other OSes—reduce initialization time by resuming from a pre-saved state rather than performing a full cold boot. Booting can occur as a cold boot (full startup from a powered-off state) or warm boot (restart without cutting power), each tailored to different scenarios like or routine reboots. These elements collectively define booting as a critical, layered procedure that underpins all operations.

Fundamentals

Definition and Basic Process

Booting is the process by which a device transitions from a powered-off or reset state to a fully operational condition capable of executing user applications, achieved through the sequential loading and initialization of and the operating into memory. This mechanism, often referred to as "booting" due to the metaphorical idea of the lifting itself up, ensures that essential hardware and software components are properly configured before control is passed to higher-level programs. The process differs between a cold boot, which starts from a complete power-off state and involves full hardware reinitialization including (), and a warm boot, which is a software-initiated restart (such as via a reset command) that skips some hardware checks to enable faster recovery without interrupting power. In a cold boot, all circuits are reset, and the performs comprehensive diagnostics, whereas a warm boot retains certain initialized states for efficiency. The basic steps of booting begin with the (CPU) receiving a reset signal, prompting it to load the —a predefined containing the initial instruction for execution. then runs the POST to verify and initialize hardware components, followed by the invocation of a boot loader, which serves as an intermediary to locate and load the operating system kernel into memory. Finally, the kernel takes control, completing hardware setup such as memory mapping and handing off execution to the operating system, enabling user applications to run. Hardware initialization plays a critical role in this sequence, with the CPU's directing the processor to code that establishes initial memory mappings, configures interrupts, and prepares peripherals for operation. This ensures a stable environment for subsequent OS loading, preventing undefined states that could lead to system instability.

Key Components Involved

Firmware serves as the initial software layer executed upon system power-on, stored in such as ROM, , or flash to ensure persistence across power cycles. It performs essential hardware initialization, including configuring basic devices, controllers, and systems, before transferring control to subsequent boot stages. This non-volatile code is critical for establishing a minimal execution environment, often handling (POST) routines to verify hardware integrity in a single pass. The device refers to the storage medium containing the and operating files, such as hard disk drives (HDDs), solid-state drives (SSDs), or USB drives, from which the loads initial software during startup. scans predefined devices in a priority sequence to locate a valid , ensuring the can access the necessary code for OS initialization regardless of the storage technology employed. A boot loader is a compact program, typically residing in the of the boot device, designed to locate, load, and execute the operating system kernel into main memory. It operates with limited resources, often in on x86 architectures, and may perform basic hardware probing or parameter passing to the kernel before relinquishing control. The kernel, as the core of the operating system, assumes control immediately after the boot loader, managing hardware resources through initialization of device drivers, memory allocation, and process scheduling. Once loaded into memory, it expands the system's capabilities by establishing protected execution modes, handling, and user-space interfaces, transitioning the machine from a bare-metal state to a fully operational environment. Interrupt vectors and reset mechanisms form the foundational CPU elements that trigger the booting . Upon reset—initiated by power-on or a hardware signal—the processor jumps to a predefined address, such as 0xFFFFFFF0h on x86 systems, where the first instruction of resides. Interrupt vectors, stored in a dedicated table, enable the CPU to respond to hardware events by redirecting execution to specific handlers. The reset is a special asynchronous exception with the highest priority, ensuring reliable startup across diverse .

Historical Evolution

Pre-Integrated Circuit Examples

In the 1940s and early 1950s, early electronic computers like the relied on manual configuration for initial setup, as they lacked stored programs or automatic loading mechanisms. Programming and initialization involved physically wiring plugboards to connect accumulators, function tables, and constant transmitters, while hundreds of switches on the control panels were set to define operations and data paths. This process, which could take days for complex problems, effectively served as the "booting" by establishing the machine's configuration before computation could begin. Similarly, the , developed in 1949, used a paper tape reader for loading initial programs into its Williams-Kilburn tube memory after manual setup of the . Operators would feed punched paper tape containing the bootstrap code or application instructions through the reader at speeds up to 250 characters per second, with the machine executing the loaded code to initialize further operations. This electromechanical input method marked an early step toward automated loading from external media. First commercial computers in the , such as the delivered in 1951, required significant operator intervention for startup. The process began with powering on the system and manually setting console switches to load a short bootstrap routine from , after which the operator would mount containing the operating system or application. This manual entry ensured the mercury was cleared and ready for the initial program load, often involving verification steps to prevent errors in the storage. By the 1960s, the introduced more structured initial program loading (IPL) using in some configurations for fixed bootstrap code, combined with card readers for variable loads. Operators selected the IPL device via console switches, and the system read the first 24 bytes of code from cards or tape into core memory, executing it to load the full operating system like OS/360. , a woven wire technique providing read-only storage, held invariant parts of the loader, reducing manual entry while card readers enabled flexibility for different environments. Minicomputers of the and , exemplified by the PDP-8 introduced in , typically featured front-panel toggle switches for entering a minimal bootstrap loader directly into core . Once toggled in—often a 20- to 40-word routine—the switches initiated the loader, which then read a binary program from paper tape via a high-speed reader, transferring it to for execution. This hybrid manual-electromechanical approach allowed the compact PDP-8 to without dedicated ROM, relying on operator precision to set addresses and bits. The first microcomputers in the mid-1970s, such as the released in 1975, extended this ROM-less design to hobbyist systems, where users entered the bootstrap loader byte-by-byte using the front panel's sense switches and deposit/examine controls. After manual entry of about 10 to 20 bytes to enable cassette or teletype input, the loader would fetch and verify the full program, such as 4K , from audio . This labor-intensive process highlighted the transition from professional operator intervention to user-driven initialization in personal computing.

Integrated Circuit Read-Only Memory Era

The advent of integrated circuit read-only memory (ROM) in the late 1960s revolutionized booting in minicomputers by enabling permanent, non-volatile storage of essential startup code directly on the system board. Mask-programmed ROM chips, which were fabricated with the boot instructions hardcoded during manufacturing, replaced earlier manual methods and allowed for automated execution of diagnostics and loaders upon power-on. In Digital Equipment Corporation's PDP-11 series, introduced in 1970, modules like the M9301 incorporated such ROM containing diagnostic routines to verify hardware operation and multiple bootstrap loader programs to initiate system startup from various peripherals, such as tapes or disks. This integration streamlined the boot process, making minicomputers more reliable for scientific and applications in the 1970s. The 1970s saw microprocessors incorporate single-chip boot ROMs, further miniaturizing and simplifying booting for early microcomputers. The , released in 1974, powered systems like the , where optional EPROM-based ROM monitors provided a basic command interface for loading programs from cassettes or disks, bypassing the need for tedious front-panel switch programming common in precursors like the Altair 8800. These ROMs typically included rudimentary I/O initialization to set up serial ports and memory mapping, enabling the system to communicate with external storage devices immediately after reset. This era's boot ROMs, often 2KB or smaller, marked the transition to self-contained that could autonomously begin the operating system load. By the late 1970s and into the 1980s, microcomputers adopted erasable programmable (EPROM) and one-time programmable (OTP) ROM for flexible, self-contained booting tailored to consumer needs. The , launched in 1977, featured a 12KB ROM monitor that executed on startup, performing tests, initializing the video display, and presenting a prompt for loading or disk operating systems like DOS 3.3, which automated further boot stages. Similarly, the Commodore 64, introduced in 1982, used an 8KB ROM for core boot functions, including vector table setup in RAM, screen initialization, and keyboard scanning to support immediate program loading from cartridges or disks. These advancements shifted booting from discrete logic assemblies—requiring wired panels or external programmers—to compact integrated , drastically reducing user intervention and error rates. Key innovations during this period included self-relocating loaders embedded in ROM, which dynamically adjusted code addresses to fit available , and standardized I/O initialization sequences that configured peripherals like displays and storage controllers before OS handover. For instance, PDP-11 boot ROMs employed to relocate loaders as needed during execution, while and Commodore ROMs integrated similar techniques to support variable configurations. This evolution not only accelerated times to seconds but also laid the groundwork for scalable in , , and home use, contrasting the labor-intensive startups of pre-IC eras.

Boot Loaders

First- and Second-Stage Loaders

The first-stage boot loader is a minimal program residing in or the initial of the storage device, executed immediately after the system's , such as , completes its and identifies a boot device. Its primary role is to perform basic hardware initialization, access the boot medium (e.g., parsing the or volume boot record for disk geometry and partition information), and load the second-stage boot loader into memory before transferring control to it. Due to severe size constraints—typically limited to 446 bytes of executable code within the 512-byte sector—it contains only essential routines for device access and lacks advanced features like user interfaces or filesystem support. The second-stage boot loader, in contrast, is a larger, more capable program loaded by the first stage from a designated location on the boot device, such as the of the active partition or post-MBR sectors. It handles higher-level tasks, including presenting a boot menu for operating system selection, configuring boot parameters, and loading the selected kernel and into memory to initiate the OS handover. This stage often includes drivers for various filesystems and devices, enabling it to read configuration files and support multi-boot environments. Key differences between the stages stem from their design priorities: the first-stage loader emphasizes compactness and reliability under hardware constraints, focusing solely on transitioning to the next phase without error recovery or configuration options, while the second-stage loader prioritizes flexibility and user interaction, operating in with access to more memory and peripherals. For instance, the first stage may halt on errors like invalid disk geometry, whereas the second stage can provide diagnostic messages or fallback options. These distinctions ensure efficient , with the first stage bridging and the richer environment of the second. Representative examples include the Loader (LILO), where the first-stage loader occupies the MBR and loads the second-stage from the boot partition's initial sectors or /boot directory, verifying map files and displaying progress indicators like "LILO" during execution. Similarly, in pre-UEFI Windows systems, the () serves as the second-stage boot loader; the first-stage code in the volume loads from the root of the system partition, after which reads boot.ini for OS options and loads . Another example is the legacy GRUB bootloader for , with its Stage 1 as the first-stage loader in the MBR that chains to Stage 1.5 (a filesystem-capable intermediary) and then Stage 2 for menu-driven kernel loading. The chainloading mechanism operates sequentially: upon execution, the first-stage loader reads the second-stage binary from a predefined offset or partition, copies it to a safe (often above 0x7C00), verifies basic integrity if possible, and executes a far jump to its entry point, passing any necessary parameters like disk identifiers via CPU registers. This handover ensures uninterrupted control flow, with the second stage assuming responsibility for subsequent initialization and OS invocation.

Multi-Stage and Embedded Loaders

Multi-stage boot loaders extend the architecture beyond two phases by incorporating three or more sequential stages, enabling greater modularity in initializing hardware and loading the operating system, particularly in resource-constrained embedded environments. These loaders divide the boot process into distinct phases, where each stage handles specific tasks such as basic hardware setup, configuration, and advanced device support, allowing for progressive complexity without overwhelming limited onboard resources. In typical multi-stage implementations, stage 0 resides in (ROM) and performs minimal initialization to enable loading the next stage from non-volatile storage like flash. Stage 1, often called the Secondary Program Loader (SPL), initializes essential components such as (SDRAM) and basic peripherals, then hands off to stage 2 or higher for more sophisticated operations like loading device drivers or network protocols. Subsequent stages, such as the full boot loader, manage operating system handover, supporting features like access and configuration prompts. This phased approach is exemplified in , an open-source loader widely used for ARM-based embedded systems, where the Tertiary Program Loader (TPL) may precede SPL for even earlier initialization in systems with severe memory limitations. Similarly, employs a staged process—stage 0 for core hardware init, stage 1 for device configuration, and stage 2 for payload execution—optimizing for low-resource devices by replacing proprietary firmware with a lightweight, customizable payload that can include boot loaders like U-Boot. Embedded loaders further adapt multi-stage designs for specialized, low-overhead environments, prioritizing efficiency in microcontrollers and system-on-chips. Coreboot's payload system, for instance, acts as an embedded loader by initializing hardware directly and executing a modular , such as a minimal OS kernel or secondary loader, thereby avoiding bloated code and enabling faster boots in constrained memory setups. provides an extensible framework compliant with Platform Initialization (PI) specifications, supporting multi-stage boot through modular drivers and initialization phases tailored for embedded platforms, allowing developers to build custom loaders with incremental hardware support. The primary advantages of these architectures include enhanced fault isolation, where failures in later stages do not compromise earlier, immutable ones, improving overall reliability in embedded deployments. They also facilitate updatability by isolating updateable components in higher stages, permitting enhancements or bug fixes without risking core initialization code, which is crucial for long-term maintenance in memory-limited devices. This supports , as additional stages can incorporate advanced features like secure partitioning without redesigning the entire loader.

Booting in Personal Computers

Boot Devices and Sequence

In personal computers, boot devices encompass various hardware media capable of storing the initial boot code and operating system files. Traditional boot devices include drives, optical drives (such as CD-ROMs or DVDs), hard disk drives (HDDs), and network interfaces for remote booting via protocols like PXE. Modern systems expand this to solid-state drives (SSDs), USB flash drives, and high-speed NVMe SSDs connected via PCIe interfaces, reflecting advancements in storage technology and portability. The hierarchy of these devices is configurable in the settings, typically prioritizing for installation or recovery purposes before fixed internal storage. The sequence in personal computers follows a structured progression from hardware initialization to operating system loading. Upon power-on, the 's activates and performs a (POST) to verify basic hardware functionality. then enumerates connected devices, scanning for bootable media according to the predefined priority order, such as USB devices first, followed by optical drives, internal HDDs/SSDs, and finally network options. Once a device is selected, the reads the —either the (MBR) or equivalent—from the device's initial sector, loads the boot loader into memory, executes it to initialize further drivers and configurations, and hands off control to the operating system kernel, completing the process. Boot priority determines the order in which devices are attempted during startup, with fallback mechanisms ensuring continuity if the primary device fails. For instance, if the first-priority device (e.g., a USB drive) lacks valid boot code, the proceeds to the next in sequence, such as an internal SSD, preventing complete failure. To boot from a USB drive, the user inserts the bootable USB flash drive into an available USB port before powering on the computer. Users can then override the default priority temporarily by pressing a designated key during , commonly F12, F10, F9, Esc, Del, or F2 depending on the manufacturer, to access a one-time . In the boot menu, the user selects the USB device, often labeled as "UEFI: USB" or similar, allowing booting from it without altering permanent settings. Alternatively, for persistent changes, users enter the or UEFI firmware settings by pressing a key such as Del, F2, or F10 during startup, navigate to the Boot tab, set the USB device as the first boot option, save the changes (typically by pressing F10 and confirming), and exit. This mechanism supports flexible , such as booting from external media for OS repairs. Partition tables play a crucial role in locating boot code on storage devices. The Master Boot Record (MBR) scheme, used in legacy BIOS environments, embeds a 512-byte boot sector at the disk's beginning, containing executable boot code alongside a partition table limited to four primary partitions and support for drives up to 2 TB. In contrast, the (GPT), standard for UEFI systems, stores the partition table across multiple sectors for redundancy and places boot code in a dedicated (ESP), enabling support for larger drives exceeding 2 TB and up to 128 partitions without size limitations. reads the appropriate table to identify and access the active boot partition during device enumeration. Error handling addresses scenarios where no valid boot device is detected, often manifesting as messages like "No bootable device" or "An operating system wasn't found." Common causes include disconnected or faulty storage hardware, incorrect boot priority settings, or corrupted boot sectors on the target device. Resolution typically involves verifying physical connections, entering firmware settings to readjust the boot order or enable legacy/UEFI modes, or booting from external recovery media to repair the master boot record using tools like those in Windows installation environments. If hardware failure is suspected, diagnostic tests via firmware utilities or replacement of the drive may be necessary to restore bootability.

BIOS Implementation

The BIOS, or Basic Input/Output System, is a 16-bit embedded in the (ROM) of the in IBM-compatible personal computers, providing low-level hardware initialization and interfacing services as defined in the IBM PC standard established in 1981. This executes upon power-on, performing essential setup tasks before transferring control to the operating system loader. The boot process begins with the (POST), a diagnostic routine that verifies the integrity of critical hardware components such as the CPU, memory, and basic peripherals. Upon successful completion of POST, the invokes interrupt 19h (INT 19h), its primary boot handler, which scans boot devices in a predefined sequence—typically starting with floppy drives, then hard disks, optical drives, and network interfaces if supported. For a hard disk boot, INT 19h uses the disk services to read the (MBR) from the first sector (sector 0, cylinder 0, head 0) of the device, loading its 446-byte bootstrap code into memory at 0x7C00, followed by execution of that code after setting up the segment registers and stack. The MBR code then typically loads the volume boot record from the active partition to continue the chainloading process. BIOS operates exclusively in 16-bit , imposing significant limitations on modern hardware support, including a maximum addressable disk size of 2 terabytes due to the 32-bit (LBA) in its extensions and the 512-byte sector assumption in the MBR partitioning scheme. It lacks native support for (GPT) structures, which exceed these constraints, requiring legacy BIOS systems to rely on compatibility modes or hybrid MBR setups for larger drives. To accommodate add-on hardware, BIOS supports Option ROMs—firmware modules stored on expansion cards (e.g., controllers or network adapters) that extend the core services by scanning for and executing their initialization code during in the memory range 0xC0000 to 0xF0000. The (PnP) extension, introduced in 1993, further enhances this by providing standardized interfaces for dynamic resource allocation to these ROMs and peripherals, reducing manual configuration needs through INT 0xF0 calls for enumeration and setup. Due to these architectural constraints, legacy BIOS has been progressively deprecated in favor of the Unified Extensible Firmware Interface (UEFI) in systems introduced after , which offers 64-bit addressing, modular drivers, and broader hardware compatibility.

UEFI Implementation

The Unified Extensible Firmware Interface () represents a modern firmware architecture for personal computers, succeeding the legacy by offering a modular, extensible interface between the operating system and platform hardware. Initially developed by as the Extensible Firmware Interface (EFI) starting in the late 1990s for the processor family, the specification reached version 1.10 before transferred stewardship to the UEFI Forum in , an industry consortium including , , Apple, and others to promote cross-platform adoption. operates primarily in a 64-bit mode, supports larger address spaces than the 16-bit , and includes an interactive shell environment for diagnostics and scripting during boot, enabling more sophisticated pre-OS operations. The boot process unfolds in phases, with the Driver Execution Environment (DXE) phase being central to implementation on PCs, where firmware drivers initialize the processor, , , and peripherals while establishing software abstractions for services. Following hardware readiness, the Boot Manager—a firmware policy engine—enumerates boot options stored in NVRAM variables and presents a to the user, then loads EFI applications (typically bootloaders) as executable .efi files from the (ESP), a dedicated FAT32-formatted partition marked with the GUID C12A7328-F81F-11D2-BA4B-00A0C93EC93B. This modular approach allows drivers and applications to be loaded dynamically, contrasting the rigid, monolithic structure of . The process culminates in the operating system loader invoking ExitBootServices(), which notifies the to cease boot-time and transition control, committing allocations and preserving only runtime services. UEFI incorporates key features enhancing PC booting flexibility, including native support for the (GPT) to handle disks beyond the 2.2 TB limit of the (MBR) scheme used in systems, enabling partitioning for modern storage capacities. It integrates Secure Boot as a verification mechanism using cryptographic signatures to ensure only trusted boot components execute, though detailed protocols are defined separately. is enabled through EFI protocols like the Simple Network Protocol (SNP) and PXE Base Code Protocol, allowing remote image loading over TCP/IP without local media. UEFI distinguishes boot-time APIs—such as memory allocation, event handling, and device path protocols available only until ExitBootServices()—from runtime APIs, which persist post-boot for tasks like variable storage, time synchronization, and ACPI table access, ensuring ongoing firmware-OS interaction. For backward compatibility with legacy BIOS-based operating systems and bootloaders, many UEFI implementations include the Compatibility Support Module (CSM), an optional component that emulates a 16-bit environment during boot, intercepting disk calls and legacy option ROMs to facilitate hybrid operation. This module can be enabled or disabled in settings, allowing seamless transition for systems requiring pre- support while prioritizing native mode for optimal performance and .

Booting in Specialized Systems

System-on-Chips and Embedded Devices

System-on-chips (SoCs) integrate processors, memory controllers, and peripherals into a single chip, commonly used in embedded systems such as smartphones, IoT devices, and single-board computers like the Raspberry Pi, which employs an ARM-based Broadcom SoC. The booting process in these SoCs typically begins with an on-chip BootROM that executes immutable code upon power-up, initializing basic hardware and loading subsequent stages from external non-volatile memory like eMMC or NAND flash. This initial stage configures the memory controller and clock systems before handing off to a first-stage bootloader (BL1), often stored in secure on-chip ROM to prevent tampering. In ARM-based SoCs, such as those from Qualcomm Snapdragon series, the BootROM verifies and loads the primary boot loader (PBL), which handles further authentication and initialization of the system bus and security features. Secure booting is a critical aspect in SoCs, particularly those supporting TrustZone, which partitions the system into secure and non-secure worlds to protect sensitive operations. The process starts in the secure world with BL1 authenticating BL2 (second-stage loader) using cryptographic signatures, ensuring only trusted executes; this chain extends to loading the trusted OS or before transitioning to the normal world for the main OS. Hardware accelerators, such as GPUs and neural processing units in Snapdragon SoCs, are initialized during these early stages to enable efficient multimedia and AI tasks post-boot. Constraints in SoCs include stringent , where boot code must minimize energy draw during initialization to comply with battery-limited designs, and real-time requirements that demand low-latency handoffs without user intervention. In resource-constrained embedded devices, booting often involves either bare-metal initialization or a (RTOS) like , where the directly sets up peripherals, controllers, and timers without an underlying OS kernel. For instance, IoT sensors may boot via serial loaders or interfaces for initial programming, followed by autonomous execution from , prioritizing minimal footprint and deterministic timing. Automotive electronic control units (ECUs) exemplify this, using to verify and update over , ensuring rapid startup to meet safety standards like , with no provision for manual recovery. In Android devices powered by SoCs, allows developers to modify the boot chain for custom ROMs, but this disables verified boot, potentially compromising security features like dm-verity. Multi-stage loaders, adapted for these environments, facilitate modular updates while maintaining integrity through hash chains.

Microcontrollers and FPGAs

Microcontrollers, such as those in the AVR and ARM-based families, typically initiate booting from internal flash memory upon power-on reset or external reset signals. The process begins with the hardware automatically fetching the initial instruction from a predefined address in the flash, often the reset vector, which points to either a built-in bootloader or the start of the user application code. In AVR microcontrollers, fuse bits—non-volatile configuration registers—allow selection of the boot loader section size and enable or disable the bootloader, determining whether the device jumps directly to the application code or enters a bootloader mode for in-system programming (ISP) updates via protocols like UART or SPI. For ARM Cortex-M based microcontrollers like the STM32 series, the boot process involves remapping the vector table, a data structure containing interrupt vectors and the initial stack pointer, from the default flash start address to support flexible code placement and optional bootloader execution for firmware updates over USB or other interfaces. This boot sequence in microcontrollers is designed for , often resulting in a direct jump to the application code without an operating system, enabling bare-metal execution where the handles all hardware interactions. Optional bootloaders facilitate over-the-air or serial updates but can be bypassed for faster startup in production environments. Tools like OpenOCD provide debugging support by interfacing with or SWD ports to halt execution at the boot entry point, inspect memory, and program flash during development. In contrast, field-programmable gate arrays (FPGAs) undergo a configuration phase that defines their hardware logic before any software booting occurs, distinguishing them from microcontrollers' fixed approach. Booting in FPGAs involves loading a —a serialized —into the device's configuration memory via interfaces such as , SPI, or serial s. For (now ) FPGAs, like those in the Artix or Spartan series, the configuration typically starts from an external SPI flash or upon power-up, where the FPGA's startup circuitry reads the to instantiate logic cells, interconnects, and I/O blocks, followed by optional partial reconfiguration to update specific regions without full reload. This hardware definition phase precedes any or processor soft-boot within the FPGA fabric, if present, emphasizing FPGAs' role in customizable, reconfigurable systems rather than static code execution. The key differences lie in their boot paradigms: microcontrollers focus on loading and executing fixed firmware directly from integrated memory for efficient, low-power operation in embedded applications, while FPGAs prioritize hardware synthesis through bitstream configuration, enabling dynamic logic adaptation but requiring more initialization time. Both often operate in OS-less environments, but FPGAs may integrate microcontroller cores (e.g., MicroBlaze) that then follow a secondary software boot similar to embedded loaders.

Security Considerations

Protective Measures

Protective measures in the boot process are designed to establish and maintain a , preventing unauthorized modifications to , bootloaders, and operating systems that could introduce or vulnerabilities. These techniques leverage hardware roots of trust, cryptographic verification, and secure storage to ensure only authenticated components execute during boot, thereby mitigating risks such as rootkits or attacks. By integrating protections at the hardware and levels, systems can detect tampering early and halt execution if integrity is compromised. However, vulnerabilities such as CVE-2024-7344 (discovered in January 2025), which allows unsigned code execution in Secure Boot systems, and CVE-2025-3052 (June 2025), enabling bootkit by bypassing signature checks, highlight ongoing challenges; these have prompted updates to revocation databases like dbx and patches from vendors including and . Secure Boot implements a cryptographic starting from immutable (ROM) and extending to the operating system loader. In UEFI Secure Boot, the platform verifies digital signatures of boot components using a of keys: the Platform Key (PK) as the root, which authenticates Key Exchange Keys (KEKs); KEKs in turn validate signatures in the allowed database (db); and the forbidden signatures database (dbx) revokes compromised or outdated components. This process ensures that only signed and trusted executables, such as bootloaders and drivers, are loaded, blocking unsigned or malicious code from executing. For example, Windows requires Secure Boot for certain features, enforcing signature checks on the and kernel. Measured Boot complements verification by creating a verifiable record of the boot process for remote attestation, using hardware modules like the Trusted Platform Module (TPM) to log measurements (hashes) of boot components into protected registers. These measurements capture the state of firmware, bootloaders, and the OS kernel, allowing a remote verifier to confirm that the system booted with approved software. Intel Trusted Execution Technology (TXT) employs a Dynamic Root of Trust for Measurement (DRTM) via the GETSEC[SENTER] instruction, which clears dynamic state and measures the environment before launching into a trusted mode, storing values in the TPM's Platform Configuration Registers (PCRs). Similarly, AMD's Secure Virtual Machine (SVM) uses the SKINIT instruction to initialize a late-launch environment, extending measurements to the TPM for attestation of the measured launch environment, including the secure kernel loader. Boot Guard provides a hardware-enforced root of trust specifically for verification, integrated into processors and chipsets to protect against attacks on the initial block (). It establishes a Static Root of Trust for Verification (RTV) using fused keys in the processor, which cryptographically authenticate the image before execution passes to the CPU. This prevents modification of the or Option ROMs, ensuring the chain of trust begins immutably at the silicon level; for instance, in 12th-generation processors, Boot Guard verifies the integrity of the partition during the pre-boot phase. Encryption of boot partitions and full disks safeguards data at rest during the boot sequence, requiring authentication before decryption to prevent offline attacks. Microsoft's employs full-volume encryption with AES algorithms, protecting the system partition and requiring pre-boot authentication via TPM or user PIN to unlock the Volume Master Key (VMK), which derives the Full Volume Encryption Key (FVEK). On systems, (Linux Unified Key Setup) formats encrypted block devices, prompting for a in the initramfs during boot to decrypt the master key and access the root filesystem, often combined with TPM for automated unsealing if PCR values match expected boot measurements. Anti-rollback mechanisms prevent downgrade attacks by enforcing monotonic version increases for components, ensuring that once a update is applied, older vulnerable versions cannot be reinstalled. In Secure Boot implementations, this is achieved through versioned signatures and the dbx database, which permanently revokes signatures of deprecated or drivers, blocking their execution even if physically present. Hardware support, such as eFuses or monotonic counters in TPMs, stores the minimum acceptable version, halting if a is detected; for example, in Trusted Firmware-M, anti-rollback checks the version against OTP (one-time programmable) to prohibit execution of pre-patch images.

Bootloop Detection and Recovery

A bootloop occurs when a computing device repeatedly fails to complete the process, resulting in the hanging or restarting indefinitely without user intervention, often due to corrupted , faulty software updates, or hardware issues. This condition can trap the device in a cycle where the or kernel initialization repeatedly errors out, preventing normal operation. In personal computers utilizing BIOS or UEFI, bootloops frequently appear as repeated returns to the BIOS setup screen or failure to load the operating system. Common causes include: no bootable device detected, such as inability to locate a hard drive or SSD containing the OS or failure to set it as the primary boot device; incorrect boot order or settings, including prioritization of an incorrect device like a USB drive or mismatches between UEFI and Legacy/CSM modes with GPT or MBR partitioning; corrupted or missing bootloader, often due to damaged OS boot files from updates, power interruptions, or system crashes; hardware malfunctions, such as loose cables to storage devices, faulty RAM, failing drives, or conflicting peripherals; BIOS configuration errors, like failed overclocking, unstable settings, or a dead CMOS battery causing repeated resets; and, less commonly, issues from recent BIOS updates or peripheral conflicts. Detection of bootloops typically involves hardware and mechanisms designed to monitor progress and identify failures. Watchdog timers, which are hardware circuits that reset the if not periodically serviced by software, play a key role by triggering a after a timeout during the sequence if the process stalls. In UEFI-based systems, or may use NVRAM variables to track attempts and detect repeated failures, depending on the . health checks, such as integrity verifications during the stages, further aid detection by logging anomalies like mismatches in images. Once a bootloop is detected, recovery mechanisms aim to restore functionality without requiring advanced user expertise. Common strategies include entering a that loads minimal drivers and services to diagnose issues, or initiating a through hardware key combinations like holding power and volume buttons on mobile devices. to a last known good state is another approach, where or the operating system reverts to a previously verified configuration stored in secure partitions. Policies for handling bootloops often incorporate thresholds to balance automatic recovery with user intervention, such as delays between retry attempts to prevent excessive power drain or wear. In Android systems, verified boot with dm-verity enforces these policies by marking boot attempts as successful or failed, triggering recovery modes after repeated failures, depending on device configuration, to avoid infinite loops from tampered updates. Examples of bootloop recovery abound across platforms. Apple's iOS uses recovery mode, accessible via specific button sequences on iDevices, to restore over USB from a connected computer if bootloops arise from update errors. Microsoft's Windows Automatic Repair feature, part of the Windows Recovery Environment, automatically scans for boot issues after detecting repeated failures and attempts repairs like restoring system files or resetting configurations. In embedded systems, watchdog resets provide a simple recovery by forcing a hardware , often combined with that clears volatile error states to break the loop. Secure Boot failures can occasionally trigger such detection as an for these recovery processes.

References

Add your contribution
Related Hubs
Contribute something
User Avatar
No comments yet.