system booting process overview

11
Booting Process By Raj Kumar Rampelli

Upload: raj-kumar-rampelli

Post on 31-Oct-2014

11 views

Category:

Education


4 download

DESCRIPTION

This PPT shares some information on what is booting process and different stages in it. Importance of BIOS and BootROM. Steps involved for loading kernel into RAM. What is the importance of init RAM disk (initrd), when 1st user space application is started and who will create init process.

TRANSCRIPT

Page 1: System Booting Process overview

Booting Process

ByRaj Kumar Rampelli

Page 2: System Booting Process overview

What is Booting Process ? Sequence of operations for initialization of

hardware blocks including the memory controller, the processor and I/O peripherals etc.

Page 3: System Booting Process overview

Booting process in x86 based devicePower on device

Start executing code in BIOS (H/W initialization), stored in EEPROM flash memory (Boot Flash) and Load Boot Vector

Machine start to execute at fixed location 0xFFFFFFF0 (Boot Vector) Loading Boot Vector

BIOS loads Bootloader (ex: GRUB) to select & load OS from multiple OSes installed on hard disks

Bootloader loads OS image (boot.img) into RAM by using Boot sector (of size 512MB) on disk (Master Boot Record in windows terminology)

Page 4: System Booting Process overview

Booting process in ARM based devicePower on Device

BootROM start execution, do H/W Initialization and Load Boot Vector

Machine start to execute at fixed location 0x0 (RESET)

BootROM reads bootable device info from fuse register to load Bootloader.

BootROM loads Bootloader

Bootloader loads Kernel

Page 5: System Booting Process overview

Booting Stages….!! BIOS/BootROM stored in flash memory on mother-board BIOS/BootROM Tasks:

Power-On Self Test (POST) H/W Initialization

Initialization of SDRAM: Read BCT (Board Configuration Table) file, initialize and configure SDRAM Cache memory Memory controller Clocks

Loading Boot Vector Loading Bootloader

BootROM/BIOS reads BCT file and loads Bootloader into SDRAM Perform all these operations in AVP (Audio Video Processor) mode only

Bootloader Tasks 1st stage Bootloader 2nd stage Bootloader

Page 6: System Booting Process overview

Bootloader Tasks (1st stage Bootloader) Runs in AVP (Audio Video Processor) Read BCT file and Initializes SDRAM Check Battery level

If its value is meeting the target battery level then continue booting process

Else charge the device Read BCT for 2nd stage Bootloader location Load 2nd stage Bootloader into SDRAM Initialize clock sources and enable clocks to required peripherals Enable UART Initialize CPU and transfer control to 2nd stage Bootloader

Power up CPU Enable CPU clock Take CPU out of the reset

Page 7: System Booting Process overview

Bootloader Tasks (2nd stage Bootloader)

Run in CPU mode CPU tasks

Initialize & enable Cache memory Configure General Interrupt Controller Enable Timer & enable MMU Initialize Page tables

Power on display Provide booting options to select

Fastboot Continue booting

Read GPT (General Partition Table) for kernel location Load initrd (initial RAM Disk) into RAM and mounted

Serves as temporary root file system in RAM and allows kernel to boot without having to mount any phisical disks.

After kernel is booted, this file system in unmounted and real root file system is mounted.

Load compressed Kernel image (zImage) into memory Prepare Kernel command line data to pass it to kernel Disable MMU and cache, now jump to kernel

Page 8: System Booting Process overview

The Kernel Bootloader loads compressed kernel image (zImage) into memory A Routine (at Head of Kernel Image) uncompresses the Kernel and

places into high memory

start ()• When zImage is invoked, the control begins at start() function located atarch/<arm/i386>/boot/head.S and do basic h/w setup

Startup_32()

• Located in arch/<arm/i386>/boot/compressed/head.S• Startup_32() setup environment ex: stack

decompress_kernel(

)

• Located in arch/<arm/i386>/boot/compressed/misc.c• Kernel is decompressed through this call

startup_32()

• Located in arch/<arm/i386>/kernel/head.S• Page tables are initialized, memory paging in enabled

start_kernel ()

• Located in init/main.c, which takes us to the non-architecture specific linux kernel

• Setup Interrupts, Memory configuration, load initial RAM disk

Kernel_thread()

• Start the init() process, which is the first user space process. Idle task is started and scheduler takes the control when cpu_idle() called.

Page 9: System Booting Process overview

Start init process Kernel starts 1st user application /sbin/init

1st program which compiled with std. C library Creates init process (id=1) (parent of all process) Start system services

Init process reads /etc/inittab and creates startup processes. /etc/inittab contains the settings for change the process behavior

and their run-levels Run level: S/W configuration of the system that allows only

selected group of processes to exist Init runs the system in any of the below run level at a

time 0 – Halt, 1 – Single user mode 2 – Multi user mode, without NFS 3 – Full multi user mode, 4 – unused, 5 – x11, 6 – Reboot

inittab instructs the init process which run level system should run at and describes the processes to be run ar each run level

Page 11: System Booting Process overview

THANK YOU

Have a look atMy PPTs:

http://www.slideshare.net/rampalliraj/

My Tech Blog:

http://practicepeople.blogspot.in/