The document details the booting process for x86 and ARM-based devices, outlining the sequence of operations from power-on to loading the operating system. Key components include BIOS/bootrom for hardware initialization, bootloaders for loading the OS kernel, and the initialization of system services through the 'init' process. It also describes various bootloader tasks, including battery checks and memory configuration, as well as the run levels defined in the init process.
What is BootingProcess ?
Sequence of operations for initialization of
hardware blocks including the memory controller,
the processor and I/O peripherals etc.
3.
Booting process inx86 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)
4.
Booting process inARM 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
5.
Booting Stages….!!
BIOS/BootROMstored 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
6.
Bootloader Tasks
(1st stageBootloader)
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
7.
Bootloader Tasks
(2nd stageBootloader)
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
8.
The Kernel
Bootloaderloads 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 at
arch/<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.
9.
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