What happens when you throw the switch?

March 15, 2001, 06:00 PM —  Unix Insider — 

Booting is a shortened version of bootstrapping, which comes from the expression "to lift yourself up by your own bootstraps." Oddly enough, that would be impossible, but the expression means "to help yourself."


On a computer, bootstrapping is the process of loading and executing a startup standalone program. Although that description may not be exactly accurate for any given computer, all computers must go through similar steps to start up.


Deep in the bowels of the computer lies a Read Only Memory (ROM) that contains a short program burned into the memory. When the computer is switched on, the CPU is configured to start its internal program counter at the beginning of the ROM program.


The ROM program varies in length, but basically performs the following:

  • Diagnostics, usually called Power On Self Test (POST)
  • Location, loading, and execution of a larger bootstrap program from the bootable drive
  • Loading and execution of the kernel by the bootstrap program


The ROM bootstrap program does the following, though not necessarily in this order:

  • Performs POST, including testing memory, keyboard, and console.
  • Polls all addresses where a device can reside, and either runs diagnostics in the ROM or asks the device to run a self-diagnostic and report the results.
  • Finds the device that is bootable, usually the first drive.
  • Determines whether that device has a program in its own ROM that needs to be loaded in order to control the device, then loads it.
  • Jumps to the now-loaded device control program that lets you load the disk bootstrap program, and loads it. The program resides in the boot block or boot sector of a disk. That sector has become a favorite target area for virus writers, because it's very hard to boot a computer without loading and executing the boot sector.
  • Jumps to the beginning of the now-loaded disk bootstrap program and executes it.


Then the disk bootstrap program locates and loads a larger program (usually the Unix/Linux kernel) and begins executing. In an alternative version, the disk bootstrap program loads and runs a very extensive booting program. When complete, that booting program finally loads and executes the Unix kernel.


You can see why this process is called booting. The ROM program A loads small disk program B (the boot sector) and executes it. Disk program B loads larger program C and executes it. Possible program C ends by loading program D and executing it.


This process is similar for all machines, unless you're working with an embedded operating system, in which most or all of the operating system is preburned into a ROM and doesn't have to load from a disk drive.


In the above example, the standalone program that's loaded, the kernel, doesn't have to be a full operating system. For example, if you boot a SPARC system in diagnostic mode, a diagnostic monitor operating system is loaded for running tests on system hardware. That operating system is used only for SPARC testing.


A typical Unix boot sequence is:

  • Power-on
  • ROM boot starts and runs POST
  • ROM boot loads
I like it!
Post a comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
Resources
White Paper

Symantec Backup Exec 12 and Backup Exec System Recovery 8 deliver industry leading Windows data protection and system recovery. Download this whitepaper to find out the top reasons to upgrade and how to get continuous data protection and complete system recovery.

Webcast

Data and system loss — from a hard drive failure, malicious attack, natural disaster, or simple human error — can happen anytime. Don’t leave your business vulnerable. Make sure you have a secure recovery strategy in place. Symantec's latest backup and system recovery technology can efficiently restore critical applications, individual emails and documents and even restore your entire system in minutes in the event of a loss.

White Paper

Businesses face a growing challenge to ensure that the IT environment is properly protected. Backup Exec 12 integrates with other applications in the Symantec family of products, to complement your current data protection strategy, keep your data securely backed up and make it recoverable when you need it most.

Free stuff

Crimeware: Understanding New Attacks and Defenses
By Markus Jakobsson, Zulfikar Ramzan
Published Apr 6, 2008 by Addison-Wesley Professional. Part of the Symantec Press series.
Enter now! | Official rules | Sample chapter

Securing VoIP Networks: Threats, Vulnerabilities, and Countermeasures
By Peter Thermos, Ari Takanen
Published Aug 1, 2007 by Addison-Wesley Professional.
Enter now! | Official rules | Sample chapter

Featured Sponsor

AISO founders envisioned a Web hosting company that was environmentally friendly. While the company employed energy-efficient innovations like solar panels, its infrastructure produced unacceptable power and cooling requirements. Find out how AISO leveraged AMD technology to overcome their challenge in this case study white paper.

In this whitepaper, Scalar explores the opportunity to change the landscape with respect to mission critical databases built around Oracle. Leveraging technologies such as Linux, high-end commodity processing power and Oracle RAC technology to architect, design, build and maintain database infrastructure that delivers maximum availability, reliability and performance at a fraction of traditional cost.

On a typical day, weather.com, the Web site for The Weather Channel in Atlanta, serves up between 15 million and 20 million page views. But in September 2004, when back-to-back hurricanes ransacked Florida, the peak traffic on one day more than tripled: over 70 million page views by more than 7 million unique visitors. Read the full success story now.

More Resources