All Topics  
Bootstrapping (computing)

 

   Email Print
   Bookmark   Link






 

Bootstrapping (computing)



 
 
In computing, bootstrapping (from an old expression "to pull oneself up by one's bootstraps") is a technique by which a simple computer program activates a more complicated system of programs. In the start up process of a computer system, a small program such as BIOS
BIOS

In computing, the Basic Input/Output System , also known as the System BIOS, is a de facto standard defining a firmware interface for IBM PC Compatible computers....
, initializes and tests that hardware
Computer hardware

A personal computer is made up of computer hardware, multiple physical components onto which can be loaded into a multitude of software that perform the functions of the computer....
, peripherals and external memory devices are connected, then loads a program from one of them and passes control to it, thus allowing loading of larger programs, such as an operating system
Operating system

An operating system is an interface between hardware and applications; it is responsible for the management and coordination of activities and the sharing of the limited resources of the computer....
.

A different use of the term bootstrapping is to use a compiler
Compiler

A compiler is a computer program that transforms source code written in a programming language into another computer language . The most common reason for wanting to transform source code is to create an executable program....
 to compile itself, by first writing a small part of a compiler of a new programming language
Programming language

A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer....
 in an existing language to compile more programs of the new compiler written in the new language.






Discussion
Ask a question about 'Bootstrapping (computing)'
Start a new discussion about 'Bootstrapping (computing)'
Answer questions from other users
Full Discussion Forum



Encyclopedia


In computing, bootstrapping (from an old expression "to pull oneself up by one's bootstraps") is a technique by which a simple computer program activates a more complicated system of programs. In the start up process of a computer system, a small program such as BIOS
BIOS

In computing, the Basic Input/Output System , also known as the System BIOS, is a de facto standard defining a firmware interface for IBM PC Compatible computers....
, initializes and tests that hardware
Computer hardware

A personal computer is made up of computer hardware, multiple physical components onto which can be loaded into a multitude of software that perform the functions of the computer....
, peripherals and external memory devices are connected, then loads a program from one of them and passes control to it, thus allowing loading of larger programs, such as an operating system
Operating system

An operating system is an interface between hardware and applications; it is responsible for the management and coordination of activities and the sharing of the limited resources of the computer....
.

A different use of the term bootstrapping is to use a compiler
Compiler

A compiler is a computer program that transforms source code written in a programming language into another computer language . The most common reason for wanting to transform source code is to create an executable program....
 to compile itself, by first writing a small part of a compiler of a new programming language
Programming language

A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer....
 in an existing language to compile more programs of the new compiler written in the new language. This solves the "chicken and egg" causality dilemma.

For the historical origins of the term bootstrapping, see Bootstrapping
Bootstrapping

Bootstrapping or booting refers to a group of metaphors that share a common meaning, a self-sustaining process that proceeds without external help....
.

Booting


Bootstrapping was shortened to booting
Booting

In computing, booting is a Bootstrapping process that starts operating systems when the user turns on a computer system. A boot sequence is the initial set of operations that the computer performs when it is switched on....
, or the process of starting up any computer, which is the most common meaning for non-technical computer users. The verb
Verb

In syntax, a verb is a word that usually denotes an action , an occurrence , or a state of being . Depending on the language, a verb may vary in form according to many factors, possibly including its grammatical tense, grammatical aspect, grammatical mood and grammatical voice....
 "boot" is similarly derived.

A "bootstrap" most commonly refers to the simple program itself that actually begins the initialization of the computer's operating system, like GRUB, LILO or NTLDR
NTLDR

NTLDR is the Booting for all releases of Microsoft's Windows NT operating system up to and including Windows XP and Windows Server 2003. NTLDR is typically run from the primary hard disk drive, but it can also run from portable storage devices such as a CD-ROM, USB flash drive, or floppy disk....
. Modern personal computer
Personal computer

A personal computer is any general-purpose computer whose original sales price, size, and capabilities make it useful for individuals, and which is intended to be operated directly by an end user, with no intervening computer operator....
s have the ability of using their network interface card (NIC) for bootstrapping; on IA-32
IA-32

IA-32 , often generically called x86 or x86-32, is the instruction set architecture of Intel's most commercially successful microprocessors....
 (x86) and IA-64 (Itanium
Itanium

Itanium is the brand name for 64-bit Intel microprocessors that implement the Intel Itanium architecture . Intel has released two processor families using the brand: the original Itanium and the Itanium 2....
) this method is implemented by PXE
Preboot Execution Environment

The Preboot eXecution Environment is an environment to booting computers using a network interface card independently of available data storage devices or installed operating systems....
 and Etherboot.

The computer is regarded as starting in a "blank slate" condition - either its main memory is blank, or else its content is suspect due to a prior crash. Although magnetic core memory retains its state with the power off, there would still exist the problem of loading in to it the very first program. A special start program could be very large, and given the modern affordability of read-only memory chips, could constitute the entire program to be run (as in embedded systems) but such an arrangement is inflexible. The bootstrap part would be a short simple piece of code that loads the main code.

Example

The precise workings of a computer's bootstrap sequence are utterly dependent on the precise features of its hardware. This example avoids the detailed complexity of actual computers in favour of the simplicities of the AMI computer, a simulated computer used for teaching purposes at the university of Auckland. It is a decimal-based computer with a thousand words of five-digit memory, having two-digit operation codes with a three-digit address field. Its only input device is a paper-tape like reader that delivers five digits at a go. On starting, its memory is cleared to all zeroes, the next-instruction address register is set to zero, and the instruction register is loaded with the special value 17000. Clearing memory and registers to zero is a simple action for hardware, a facility that will likely find other use, but the arbitrary value would have to be held in special-purpose memory. It is none other than the operation code for "Read", to address zero. The computer's designer could have chosen 00 to be the operation code for "Read", except that other considerations lead to it being preferred as the operation code for "Stop".

Previously, a paper tape has been prepared with the sequence 17001,17002,12000 (commas added for legibility), and is notionally, in the paper tape reader, ready. Action proceeds as follows:

17000 is executed, causing 17001 to be read from tape and placed in address 000.

Because the next instruction address (IA) is 000, the word at memory address 000 is loaded into the instruction register (IR) and IA is incremented, giving the value 001. This is the standard machine code instruction cycle: load the word at IA into IR, increment IA, decode and execute the instruction in IR. Because the (just placed) content of address 000 is 17001, the next word of input is read and placed at address 001, thus it holds 17002.

IA = 001, so the (just placed) value 17002 is loaded to IR and IA incremented. On execution, the 12000 is read from the input and placed at address 002.

IA = 002, so the (just placed) value 12000 is loaded to IR and IA incremented. The operation code 12 is the "Jump" instruction, and although IA had been incremented to 003 after the instruction had been loaded, its action is to change IA to 000 ready for the next instruction cycle.

So at this point, three instructions have been loaded into memory and now the tempo changes; no longer is the input like a carpet unrolled before you as you walk on it. The current state: Address Content Purpose. 000 17001 Read a word from the input into the following memory location. 001 17002 Execute what was just read above. 002 12000 Go back and do it again. This is the bootstrap loader. The content of memory 001 is irrelevant as it will be overwritten by the first instruction. With IA = 002, the 12000 instruction begins its operation. Further input is now in pairs: a read instruction to some address, followed by the word that the read instruction will read and place in that address. Supposing you wished to load something to address 900, 901, etc. the pairs would be 17900,word,17901,word, etc. though they could be loaded in any order. When the sequence is complete, the last pair would be followed by 12900 (instead of a read) so as to start execution at address 900 (or wherever was desired), changing the tempo again. The most usual follower of the bootstrap program would be a "loader", that is a program that is able to read consecutive words of input and place them at consecutive addresses from some specified starting point, thus halving the amount of input required.

Thus the bootstrap sequence begins with a very simple hardware state, plus arrangements that cause something to be read into memory and executed. That something is the bootstrap loader, which is capable of loading an arbitrary program into an arbitrary part of memory, and then starting it. Note the changes in tempo along the way. The initial state is half-way through the hardware's instruction cycle, as if the instruction had been read into the instruction register but before it is executed. This is followed by the execution of a program that is not in memory except that its instructions are read (from specially-prepared input) into memory just before they are executed, then that simple program is executed, that (due to carefully-prepared input) places a program somewhere in memory, that finally is executed.

Software bootstrapping

Bootstrapping can also refer to the development of successively more complex, faster programming environments. The simplest environment will be, perhaps, a very basic text editor (e.g., ed) and an assembler
Assembly language

An assembly language is a low-level language for programming computers. It implements a symbolic representation of the numeric machine codes and other constants needed to program a particular CPU architecture....
 program. Using these tools, one can write a more complex text editor, and a simple compiler for a higher-level language and so on, until one can have a graphical
Graphical user interface

A graphical user interface is a type of user interface which allows people to human-computer interaction such as computers; hand-held devices such as MP3 Players, Portable Media Players or Gaming devices; household appliances and office equipment....
 IDE
Integrated development environment

An integrated development environment also known as integrated design environment or integrated debugging environment is a software application that provides comprehensive facilities to computer programmers for software development....
 and an extremely high-level programming language
High-level programming language

In computing, a high-level programming language is a programming language with strong Abstraction from the details of the computer. In comparison to low-level programming languages, it may use natural language elements, be easier to use, or more Porting across platforms....
.

Historically, bootstrapping also refers to early computer program development which has been obviated by emulation software now executed in pre-existing computers. Bootstrapping in program development began during the 1950s when each program was constructed on paper in decimal code or in binary code, bit by bit (1s and 0s), because there was no high-level computer language, no compiler
Compiler

A compiler is a computer program that transforms source code written in a programming language into another computer language . The most common reason for wanting to transform source code is to create an executable program....
, no assembler, and no linker
Linker

In computer science, a linker or link editor is a computer program that takes one ormore object file generated by a compiler and combines them into a single executable program....
. A tiny assembler program was hand-coded for a new computer (for example the IBM 650
IBM 650

The IBM 650 was one of International Business Machines?s early computers, and the world?s first mass production computer. It was announced in 1953, and over 2000 systems were produced between the first shipment in 1954 and its final manufacture in 1962....
) which converted a few instructions into binary or decimal code: A1. This simple assembler program was then rewritten in its just-defined assembly language
Assembly language

An assembly language is a low-level language for programming computers. It implements a symbolic representation of the numeric machine codes and other constants needed to program a particular CPU architecture....
 but with extensions that would enable the use of some additional mnemonics for more complex operation codes. The enhanced assembler's source program was then assembled by its predecessor's executable (A1) into binary or decimal code to give A2, and the cycle repeated (now with those enhancements available), until the entire instruction set was coded, branch addresses were automatically calculated, and other conveniences (such as conditional assembly, macros, optimisations, etc.) established. This was how the early assembly program SOAP (Symbolic Optimal Assembly Program) was developed. Compilers, linkers, loaders, and utilities were then coded in assembly language, further continuing the bootstrapping process of developing complex software systems by using simpler software.

Compiler bootstrapping


In compiler
Compiler

A compiler is a computer program that transforms source code written in a programming language into another computer language . The most common reason for wanting to transform source code is to create an executable program....
 design, a bootstrap or bootstrapping compiler is a compiler that is written in the source language, or a subset of the language, that it compiles. Examples include gcc
GNU Compiler Collection

The GNU Compiler Collection is a compiler system produced by the GNU Project supporting various programming languages. GCC is a key component of the GNU toolchain....
, GHC
Glasgow Haskell Compiler

The Glorious Glasgow Haskell Compilation System, more commonly known as the Glasgow Haskell Compiler or GHC, is an open source Machine language compiler for the functional programming Computer programming Programming language Haskell ....
, OCaml, BASIC
BASIC

In computer programming, BASIC is a family of high-level programming languages. The Dartmouth BASIC was designed in 1964 by John George Kemeny and Thomas Eugene Kurtz at Dartmouth College in New Hampshire, United States to provide computer access to non-science students....
, PL/I
PL/I

PL/I is an imperative programming computer programming programming language designed for scientific, engineering, and business applications. It is one of the most feature-rich programming languages and one of the very first in the highly-feature-rich category....
 and more recently the Mono C# compiler
Mono (software)

Mono is a project led by Novell to create an Ecma International standard compliant, .NET Framework-compatible set of tools, including among others a C Sharp compiler and a Common Language Runtime....
.

See also

  • Linux startup process
    Linux startup process

    The Linux startup process is the process of Linux-operating system initialize. It is in many ways similar to the BSD and other Unix style boot processes, from which it derives....
  • Windows NT startup process
    Windows NT Startup Process

    The Windows NT startup process is the process by which Microsoft's Windows NT, Windows 2000, Windows XP and Windows Server 2003 operating systems initialize....
  • Windows Vista startup process
    Windows Vista Startup Process

    The startup process of Microsoft's Windows Vista and Windows Server 2008 operating systems is slightly different from previous versions....