System boot Booting the system:the procedure of starting a computer by loading the 0S Bootstrap program or bootstrap loader:a small piece of code Loaded at power-up or reboot Typically stored in ROM or EPROM,generally known as firmware(固件) initializes hardware CPU registers,device control lers,memory content Locate the OS,load at least a part of the OS into main memory start executing it Platform dependent(平台相关/体系结构相关) Some use two-step process:a simple bootstrap loader fetches a more complex boot program from disk,which in turn loads the 0S Some systems store the entire oS in ROM 1口4自,4·4色至月QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . System boot ▶ Booting the system: the procedure of starting a computer by loading the OS ▶ Bootstrap program or bootstrap loader: a small piece of code ▶ Loaded at power-up or reboot ▶ Typically stored in ROM or EPROM, generally known as firmware(固件) ▶ initializes hardware ▶ CPU registers, device controllers, memory content ▶ Locate the OS, load at least a part of the OS into main memory & start executing it ▶ Platform dependent(平台相关/体系结构相关) ▶ Some use two-step process: a simple bootstrap loader fetches a more complex boot program from disk, which in turn loads the OS ▶ Some systems store the entire OS in ROM
Example:Linux system startup typical operating sytems startup course Power-on→Bootstrap:BI0S-→BootLoader:GRUB→OS:Linux Linux (Intel i386) Refer to appendix A of Understanding Linux Kernel →RESET pin of the CPU cs:ip=0xFFFF FFFO =ROM BIOS(基本输入输出系统) 1口4回,4在4色要刀QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Example: Linux system startup typical operating sytems startup course Power-on→Bootstrap: BIOS→BootLoader: GRUB→OS: Linux Linux (Intel i386) Refer to appendix A of 《Understanding Linux Kernel》 ▶ →RESET pin of the CPU ▶ cs:ip= 0xFFFF FFF0 ▶ ROM BIOS(基本输入输出系统)
Example:Linux system startup (cont. BI0S(基本输入输出系统) Basic 1/0 System (BIOS):A set of programs stored in ROM,including Several interrupt-driven low-level procedures A bootstrap procedure,who POST Power On Self-Test) Initializes hardware device Searches for an OS to boot Master Boot Record(MBR)on Hard drive,Boot Sector on floppy disk,network Copies the first sector of the OS into RAM 0x0000 7C00,and jumps executes 1口4回4在4也至QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Example: Linux system startup (cont.) BIOS(基本输入输出系统) Basic I/O System(BIOS): A set of programs stored in ROM, including ▶ Several interrupt-driven low-level procedures ▶ A bootstrap procedure, who ▶ POST ( Power On Self-Test) ▶ Initializes hardware device ▶ Searches for an OS to boot ▶ Master Boot Record(MBR) on Hard drive, Boot Sector on floppy disk, network ▶ Copies the first sector of the OS into RAM 0x0000 7C00, and jumps & executes
Example:Linux system startup (cont. Master Boot Record,MBR,主引导记录 the first sector on a hard drive,a special type of boot sector MBRMBR code (also called boot loader)+partition table MBR code:code necessary to startup the OS typical boot loader:GRUB 4口4回,4在4色要刀QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Example: Linux system startup (cont.) Master Boot Record, MBR, 主引导记录 ▶ the first sector on a hard drive, a special type of boot sector ▶ MBR = MBR code (also called boot loader) + partition table ▶ MBR code: code necessary to startup the OS ▶ typical boot loader: GRUB
Example:Linux system startup (cont. Master Boot Record,MBR,主引导记录 Structure of a classical generic MBR Address Description Size in bytes Hex Dec +000h +0 Bootstrap code area 446 +1BEh +446 Partition entry #1 16 +1CEh +462 Partition entry #2 Partition table 16 +1DEh +478 Partition entry #3 (for primary partitions) 16 +1EEh +494 Partition entry #4 16 +1FEh +510 55h Boot signature 2 +1FFh +511 AAh Total size:446 +4*6 +2 512 4口4包,4在4·在)QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Example: Linux system startup (cont.) Master Boot Record, MBR, 主引导记录 Structure of a classical generic MBR Address Description Size in bytes Hex Dec +000h +0 Bootstrap code area 446 +1BEh +446 Partition entry #1 16 +1CEh +462 Partition entry #2 Partition table 16 +1DEh +478 Partition entry #3 (for primary partitions) 16 +1EEh +494 Partition entry #4 16 +1FEh +510 55h Boot signature 2 +1FFh +511 AAh Total size: 446 + 4*6 + 2 512