In computing, booting (also known as booting up) is a process that begins when a user turns on a computer system and prepares the computer to perform its normal operations. On modern computers, this typically involves loading and starting an operating system. The boot sequence is the initial set of operations that the computer performs when power is switched on. A boot loader is a computer program that typically loads the main operating system or runtime environment for the computer.
Since the IBM 701 in the 1950s, booting has been used to load programs and operating systems into the main memory of stored-program computers, including mainframe computers, minicomputers, microcomputers, personal computers, and consumer electronics devices). Some simpler embedded systems do not require a boot sequence to begin functioning and may run programs stored in read-only memory (ROM) when turned on. There are numerous examples of single and multi-stage boot sequences that begin with the execution of boot program(s) stored in boot ROMs. During the booting process, the binary code of an operating system or runtime environment may be loaded from nonvolatile secondary storage (such as a hard disk drive) into volatile, or random-access memory (RAM) and then executed. The booting concept is also known as "Initial Program Load" for IBM mainframe computers.
The computer word boot is short for bootstrap (itself short for bootstrap load). The term bootstrap derives from the idiom to pull oneself up by one's bootstraps. The term refers to the paradox that a computer cannot run without first loading software but must be running before any software can be loaded.
In computers of the 1950s, pressing a bootstrap button caused a hardwired program to read a bootstrap program from a punched card in a card reader, a magnetic tape in a tape drive, a magnetic drum unit or magnetic disk drive, and then execute the loaded boot program, which loaded a larger system of programs from that medium into memory without further help from the human operator. The term "boot" has been used in this sense since at least 1958. For example, the IBM 701 computer (1952–1956) had a "load" button that initiated reading of the first 36-bit word from a punched card, magnetic tape, or magnetic drum unit. The left 18-bit half-word was then executed as an instruction, which usually read additional words into memory. Similarly, the IBM 1401 system (c. 1958) 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. Essentially, the process was one where each subsequent card was "bootstrapped" into memory by the previous punched card.
The CDC 6600 (c. 1964) had a dead start panel with 144 toggle switches; the dead start switch entered 12 words from the toggle switches to the memory of peripheral processor (PP) 0 and initiated the load sequence. PP 0 loaded the necessary code into its own memory and then initialized the other PPs.
The GE 645 (c. 1965) had a "BOOT" button. It is possible that the contraction from "bootstrap" to "boot" was motivated by an inclination to label the button with fewer, larger characters, or the contraction may follow the familiar habit of contracting words to make them easier to say, and to create insider jargon.
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.
A computer's central processor can only execute program code found in read-only memory (ROM), random access memory (RAM), or (for computers of the 1950s through 1970s) switches on an operator's front panel. Modern operating systems, application code, and data are stored on nonvolatile data storage devices, such as hard drives, CDs, DVDs, flash memory cards (like SD cards), USB flash drives, and floppy disks. When a computer is first powered on, it usually does not have an operating system in ROM or RAM. The computer must execute a relatively small program stored in ROM, along with the bare minimum of data needed to access the nonvolatile devices from which the operating system programs and data may be loaded into RAM.
The small program that starts this sequence is known as a bootstrap loader, bootstrap or boot loader. This small program's only job is to load other data and programs which are then executed from RAM. 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.
Early computers (such as the IBM 650, DEC PDP-5 through PDP-8, early models of the PDP-11, and early microcomputers such as the Altair 8800) had a row of dials or toggle switches on the front panel that allowed the operator to manually enter the boot instructions into memory before transferring control to the CPU. They could also be used to pass instructions directly to the CPU. Interestingly, the PDP-1 had a hardware built-in loader, such that an operator only needed to push the "load" switch and the paper tape reader would read a program directly into core memory. The boot loader would then read in either the second-stage boot loader (called Binary Loader of paper tape with checksum) or the operating system from an outside storage medium such as paper tape, punched card, or a disk drive.
Pseudocode for the bootloader might be as simple as the following eight instructions:
- Set the P register to 9
- Check paper tape reader ready
- If not ready, jump to 2
- Read a byte from paper tape reader to accumulator
- If end of tape, jump to 9
- Store accumulator to address in P register
- Increment the P register
- Jump to 2
A related example is based on a loader for a 1970's Nicolet Instrument Corporation minicomputer. Note that the bytes of the second-stage loader are read from paper tape in reverse order.
- Set the P register to 106
- Check paper tape reader ready
- If not ready, jump to 2
- Read a byte from paper tape reader to accumulator
- Store accumulator to address in P register
- Decrement the P register
- 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 the hardware of the time, which in this case was an Teletype Model 33 ASR.
Some 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 bootload 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 bootload 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.
Boot loaders may face peculiar constraints, especially in size; for instance, on the IBM PC and compatibles, the first stage of boot loaders located on hard drives must fit into the first 446 bytes (or 440 bytes if Windows NT or above has to be supported because NT put 6 byte disk-signature starting from offset 440) of the Master Boot Record, in order to leave room for the 64-byte partition table and the 2-byte 0xAA55 'signature', which the BIOS requires for a proper boot loader.
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 bootload 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 bootloader 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.
The Atari ST also had its operating system in ROM, but 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 system. The Atari ST hardware was designed so the cartridge slot could provide native program execution for gaming purposes as a holdover from Atari's legacy making electronic games.
Common primary boot loaders include:
Second-stage boot loader
Second-stage boot loaders, such as GRUB, BOOTMGR, Syslinux, LILO or NTLDR, are most often not themselves an operating system, but are able to load the operating system properly and transfer execution to it. The operating system will initialize itself, and may load device drivers that are needed for the normal operation of the OS. After that it starts loading normal system programs.
Many bootloaders (like GRUB, BOOTMGR, LILO, and 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+) or even games (see List of PC Booter games). 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. Typical modern personal computers boot in about one minute, of which about 15 seconds are taken by a power-on self test (POST) and a preliminary boot loader, and the rest by loading the operating system and other software. Time spent after the operating system loading can be considerably shortened to as little as 3 seconds by bringing the system up with all cores at once, as with coreboot. Large servers may take several minutes to boot and start all their services.
Many embedded systems must boot immediately. For example, waiting a minute for a digital television or GPS satellites to start is generally unacceptable. Therefore such devices have software systems in ROM or flash memory so the device can begin functioning immediately. For these types of embedded system little or no loading is necessary, since the loading can be precomputed and stored on the ROM when the device is made.
Large and complex systems may have boot procedures that proceed in multiple phases, each phase loading a more complex version of itself, until finally the operating system and other software are loaded and ready to execute. Because operating systems are designed as if they never start or stop, bootload processes sometimes load the operating system, configure themselves as a mere process within that system, and then irrevocably transfer control to the operating system. The bootload process then terminates normally as any other process would, and the user need not have any awareness of the bootload.
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. After these parts have been transferred, the operating system then takes over control of the booting process.
Boot devices (IBM PC)
The boot device is the device from which the operating system is loaded. A modern PC BIOS supports booting from various devices, typically a local hard disk drive (or one of several partitions on such a disk), an optical disc drive, a USB device (flash drive, hard disk drive, optical disc drive, etc.), a flash memory card such as an SD card in a multi-media card slot, or a network interface card (using PXE). Older, less common bootable devices include floppy disk drives, SCSI devices, Zip drives, and LS-120 drives.
Typically, the 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 BIOS 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 drive.
For example, on a PC with Windows XP 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 ‒ the user choosing which operating system to start after the computer has performed its POST. In this example of dual booting, the user chooses by inserting or removing the CD from the computer, but it is more common to choose which operating system to boot by selecting from a menu using the computer keyboard. (Typically
Boot sequence on standard PC (IBM-PC compatible)
Upon starting, a personal computer's x86 CPU runs the instruction located at the memory location CS:IP F000:FFF0 of the BIOS, which wraps to linear address 0xFFFF0, the BIOS entry inside the ROM. This memory location is close to the end of the 1 MB of system memory accessible in real mode. It typically contains a jump instruction that transfers execution to the location of the BIOS start-up program. This program runs a power-on self test (POST) to check and initialize required devices. The BIOS goes through a pre-configured list of non-volatile storage devices ("boot device sequence") until it finds one that is bootable. A bootable device is defined as one that can be read from, and the last two bytes of the first sector contain the word 0xAA55 (also known as the boot signature).
Once the BIOS has found a bootable device it loads the boot sector to linear address 0x7C00 (usually Segment:Offset 0000:7C00, but some BIOSes use 07C0:0000) and transfers execution to the boot code. In the case of a hard disk, this is referred to as the master boot record (MBR) and is often not operating system specific. The conventional MBR code checks the MBR's partition table for a partition set as bootable (the one with active flag set). If an active partition is found, the MBR code loads the boot sector code from that partition and executes it. The boot sector is often operating-system-specific; however, in most operating systems its main function is to load and execute the operating system kernel, which continues startup. 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.
Some systems (particularly newer Macintoshes and new editions of Microsoft Windows) use Intel's proprietary EFI. Also coreboot allows a computer to boot without having an over-complicated firmware/BIOS constantly running in system management mode. The legacy 16-bit BIOS interfaces are required by certain x86 operating systems, such as Windows 3.1/95/98. However most boot loaders have 16-bit support for these legacy BIOS systems.
Most PCs, if a BIOS chip is present, will show a screen detailing the BIOS chip manufacturer, copyright held by the chip's manufacturer and the ID of the chip at startup. At the same time, it also shows the amount of computer memory available and other pieces of information about the computer.
Other kinds of boot sequences
Some other processors have other kinds of boot modes.
There are alternative techniques for booting CPUs and microcontrollers:
- Some modern CPUs and microcontrollers (for example, TI OMAP) or sometimes even DSPs may have boot ROM with boot code integrated directly into their silicon, so such a processor could perform quite a sophisticated boot sequence on its own and load boot programs from various sources like NAND flash, SD or MMC card and so on. It is hard to hardwire all the required logic for handling such devices, so an integrated boot ROM is used instead in such scenarios. Boot ROM usage enables more flexible boot sequences than hardwired logic could provide. For example, the boot ROM could try to perform boot from multiple boot sources. Also, a boot ROM is often 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 when for some reasons usual boot software in non-volatile memory got erased. This technique could also be used for initial non-volatile memory programming when there is clean non-volatile memory installed and hence no software available in the system yet.
- 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).
- Some microcontrollers provide special hardware interfaces which can't 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 digital signal processors have the following boot modes:
- Serial mode boot
- Parallel mode boot, such as the host port interface (HPI boot)
In 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 are co-existing.
Many FPGA chips load their configuration from an external serial EEPROM ("configuration ROM") on power-up.
IBM Initial Program Load
This term was coined by IBM for the design of the System/360 (ca, 1965) and continues to be used in those environments today. 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 1]) followed by pressing the LOAD button. On 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 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 which was keyed into the input area. Amdahl 470V/6 and related CPUs supported four hexadecimal digits on those CPUs which 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, and its compatibles such as Amdahl's, reads 24 bytes from an operator-specified device into memory starting at location 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, 0x02, with command chaining and suppress incorrect length implied). When the I/O channel commands are complete, the first group of eight bytes is then loaded into the Program Status Word (PSW) and the startup program begins execution at the designated location. The IPL device is usually a disk drive, 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 0x02 command also causes the selected device to seek to cylinder 0x0000, head 0x0000, and to search for record 0x01, thereby also simulating a stand-alone seek command, 0x07, and a search ID equal command, 0x31; seeks and searches are not simulated by tape and card controllers).
The disk, tape or card deck must contain a special program to load the actual operating system into memory, 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 distributed with this "IPL Text" already present.
Burroughs Bootstrap From Tape
A noteworthy variation of this is found on the Burroughs B1700 where there is neither a bootstrap ROM nor a hardwired IPL operation. Instead, after the system is reset it reads and executes opcodes sequentially from a tape drive mounted on the front panel; this sets up a boot loader in RAM which is then executed. 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.
Several devices are available that enable the user to "quick-boot" to a usually Linux-powered OS for various simple tasks such as Internet access (such as Splashtop and Latitude ON).
- Boot disk
- Comparison of boot loaders
- Das U-Boot
- Linux startup process
- Live CD
- Live USB
- Multi boot
- Network booting
- PC booter
- Rebooting (computing)
- Windows NT Startup Process
- Windows Vista startup process
- Windows To Go
- ^ Some control units attached only 8 devices; some attached more than 16.
- ^ "Phrase Finder". phrases.org.uk. http://www.phrases.org.uk/meanings/290800.html.
- ^ "Bootstrap". Dictionary.com. http://dictionary.reference.com/search?r=2&q=bootstrap.
- ^ "Bootstrap". TheFreeDictionary.com. http://www.thefreedictionary.com/bootstrap.
- ^ Oxford English Dictionary. Oxford University.
- ^ From Gutenberg to the Internet, Jeremy M. Norman, 2005, page 436, ISBN 0-930405-87-0
- ^ Van Vleck, Tom. "Glossary of Multics acronyms and terms". http://www.multicians.org/mgb.html. Retrieved 2010-01-18.
- ^ Bensoussan, A. (1967-06-30). "BC.4.01 System Initialization and Bootload". Multics System Programmer's Manual. http://www.multicians.org/mspmtoc.html.
- ^ Dunten, S. D.; T. H. Van Vleck (1968-05-03). "BV.1.01 BOS Bootload: boot". Multics System Programmer's Manual. http://www.multicians.org/mspmtoc.html.
- ^ Thompson, Ken; Dennis Ritchie (1971-11-03). The Unix Programmer's Manual (1st edition ed.). Archived from the original on 2007-04-09. http://web.archive.org/web/20070409100452/http://www.cs.bell-labs.com/who/dmr/1stEdman.html. Retrieved 2008-01-07.
- ^ "Tint". coreboot. http://www.coreboot.org/Tint. Retrieved 20 November 2010.
- ^ "FAQ - Why do we need coreboot?". coreboot. http://www.coreboot.org/FAQ#Why_do_we_need_coreboot_for_cluster_maintainance.3F. Retrieved 20 November 2010.
- ^ "Google tech talks - coreboot (aka LinuxBIOS): The Free/Open-Source x86 Firmware". YouTube. http://www.youtube.com/watch?v=X72LgcMpM9k.
- ^ Note that per MBR specifications the active partition is not required to be primary, however the boot sector code may require it to be in order to work properly.
- ^ "Intel Platform Innovation Framework for EFI". Intel. http://www.intel.com/technology/framework/. Retrieved 2008-01-07.
- ^ Intel Macintosh computers all have firmware with compatibility mode for legacy BIOS operations
- ^ "?". http://www.coreboot.org/OpenBIOS. [dead link]
- ^ a b (PDF) z/Architecture Principles of Operation. IBM. September 2005. Chapter 17. http://publibz.boulder.ibm.com/epubs/pdf/a2278324.pdf. Retrieved 2007-04-14.
- ^ Brown, Eric (2008-10-02). "MontaVista Linux drives Dell's quick-boot feature". linuxdevices.com. http://www.linuxdevices.com/news/NS2560585344.html. Retrieved 20 November 2010.
- ^ Larabel, Michael (June 14, 2008). "SplashTop Linux On HP, Dell Notebooks?". Phoronix. http://www.phoronix.com/scan.php?page=article&item=splashtop_voodoo&num=1. Retrieved 20 November 2010.
- ^ "Voodoo Envy's Instant-On IOS (powered by Splashtop)". YouTube. http://www.youtube.com/watch?v=InUpF5Uetfc. Retrieved 20 November 2010.
- ^ "Voodoo Envy 133 Laptop vs MacBook Air". gadgets-reviews.com. July 29, 2008. http://www.gadgets-reviews.com/voodoo-envy-133.html. Retrieved 20 November 2010.
- ^ "Voodoopc homepage". http://www.voodoopc.com/. Retrieved 20 November 2010.
- ^ Brown, Eric (2008-10-03). "5-second Linux boots on low-powered hardware". http://www.linuxdevices.com/news/NS7654890804.html. Retrieved 20 November 2010.
- ^ "Latitude ON". YouTube. http://www.youtube.com/watch?v=y40Z1mvGOt8. Retrieved 20 November 2010.
- ^ Brown, Eric (2008-11-07). "Linux boots in 2.97 seconds". linuxdevices.com. http://www.linuxdevices.com/news/NS5185504436.html. Retrieved 20 November 2010.
- ^ "News". linuxdevices.com. http://www.linuxdevices.com/news/NS8282586707.html?kc=rss. Retrieved 20 November 2010.
- How Computers Boot Up
- Practical bootloader tutorial for ATmega microcontrollers
- Booting with Grub at OSDEV Community
- Tutorial on writing hello world bootloader
- x86 BootStrap Programming Tutorial
- Bootstrapping FreeBSD
- The Linux boot process unveiled
- Mac OS X Boot Process
- The DOS and DOS/Windows boot processes
- Windows Mobile 5.0 Soft Reset
- Pocket PC devices hard reset and soft reset
- Cell phone, Tablet and Pocket PC devices hard reset and soft reset
- Understanding Multibooting
Operating system General KernelArchitecturesGeneralSubtypesComponents Process managementConceptsProtected mode · Supervisor mode Memory management Examples Miscellaneous concepts
Wikimedia Foundation. 2010.