System startup and initialization of Linux

Source: Internet
Author: User

Boot's origins:

The term bootstrap refers to a person who tries to stand up by pulling her own boots. (Understanding the Linux Kernel)

Western proverb: Grab your shoelaces and stand up (similar to what we say: Pick up your own hair with your hands).

The start of the system is like the proverb above: Start yourself up with your own boot program. Boot program in the hard disk partition, the bootstrapper must be loaded into memory to be CPU

There is a contradiction between executing and completing the initialization process of the subsequent kernel, and only the kernel can complete the loading work.

First stage: BIOS load memory

The following procedure solves the process of " chicken eggs, or chicken eggs ":

The computer at the moment of power-up, the operating system has not been started, the RAM chip (memory) contains useless random data, at startup, there is a special hardware circuit in the CPU of a

A reset logic value is generated on the pin, and then (the chip) sets some registers of the processor (including CS=FFFFH and eip=0000fff0h) to the default values, then

Perform physical address Cs:eip i.e. oxfffffff0~oxffffffff(a total of 16byte for the system BIOS in shadow memory).

Note : The process reference for Reset:

IA-32 Intel Architecture software Developer ' s Manual_volume 3_sysytemProgramming Guide

9.1.1 Processor Stat after Reset

Biso Four steps to perform the boot process:

1) power-on self-test (post,power-on self-test): Perform a series of tests on the computer hardware to detect which devices and devices are currently working properly.

Displays some information such as the BIOS version number;

2) Initialize the hardware device and display a list of all the PCI devices installed in the system;

3) based on the user's predefined access order in the BIOS, search the operating system MBR for boot, BIOS setup may be hard disk, CD-ROM or floppy disk, etc.

The first sector (the No. 0 sector, which is where the system MBR resides);

4) Once a valid device is found in the above device, copy the contents of the first sector (MBR) to the initial physical address of RAM to OX00007C00,

The pointer then jumps to the ox00007c00 and executes the code for that copy.

Second Stage: Boot loader (bootLoader)

MBR: Master boot Record (512bytes)
Master Boot Record
Main Boot Record
Composition structure:
446bytes:bootloader (program, boot loader)
64bytes:
Each 16bytes: Mark a partition (that is, the partition table)
2bytes:magic number
Mark MBR is valid

Phase three: booting Linux from disk

Stage four: Operating system (kernel boot)

Above stage See also: http://www.cnblogs.com/ant-colonies/p/6443838.html

System startup and initialization of Linux

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.