System Booting Process overview

rampalliraj 11,141 views 11 slides Mar 18, 2014
Slide 1
Slide 1 of 11
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11

About This Presentation

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.


Slide Content

Booting Process By Raj Kumar Rampelli

What is Booting Process ? Sequence of operations for initialization of hardware blocks including the memory controller, the processor and I/O peripherals etc .

Booting process in x86 based device Power 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)

Booting process in ARM based device Bootloader loads Kernel

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 B ootloader into SDRAM Perform all these operations in AVP (Audio Video Processor) mode only Bootloader Tasks 1 st stage Bootloader 2 nd stage Bootloader

Bootloader Tasks ( 1 st stage Bootloader) Runs in AVP (Audio Video Processor) Read BCT file and Initializes SDRAM Check B attery level If its value is meeting the target battery level then continue booting process Else charge the device Read BCT for 2 nd stage Bootloader location Load 2 nd stage Bootloader into SDRAM Initialize clock sources and enable clocks to required peripherals Enable UART Initialize CPU and transfer control to 2 nd stage Bootloader Power up CPU Enable CPU clock Take CPU out of the reset

Bootloader Tasks ( 2 nd 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

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 s tart () When zImage is invoked, the control begins at start() function located at arch/<arm/i386>/boot/ head.S and d o 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.

Start init process Kernel starts 1 st user application / sbin / init 1 st 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

References Inside the Linux boot process: https://www.ibm.com/developerworks/library/l-linuxboot / Basic Boot Terminology http :// stackoverflow.com/questions/12002089/basic-boot-terms?rq=1

THANK YOU  Have a look at My PPTs: http://www.slideshare.net/rampalliraj/ My Tech Blog: http://practicepeople.blogspot.in/