barebox and linux booting

  • Barebox is a highly configurable bootloader tool.

  • Barebox is a basically a very small “linux kernel” in one binary file.

  • Barebox can implement a configurable booting sequence via a module named “bootchooser”. It is done by parameters `remaining atteptes`  `priority`

  • Barebox can store information about the booting process and pass it to the booted Linux kernel via a module named “state”

  • Proper booting can be confirmed via the “barebox-state” module from the already booted Linux.

 

 

Bootloader 

  • 1st Stage bootloader 

 

The First stage Boot Loader is situated in the Read Only Memory (ROM). The code situated in the ROM is the first block of code which automatically runs on device start-up or reset.

First stage of a boot loader with respect to NetworkThe first stage boot loader sets up the basic network connection. After the establishment of the connections, the client system communicates with the server through the Dynamic Host Configuration Protocol (DHCP) request (that is the client is requesting for a private IP address from the DHCP server). Once the private IP address is received from the DHCP Server a Bootstrap Protocol (BOOTP) request is made. Finally, a Trivial File Transfer Protocol (TFTP) request is done to start the second stage boot loader. The First stage boot loader has to store in ROM, and so it needs to be kept small. But the second stage loader may be larger than the size of ROM, because it gets loaded over the entire network.

First stage of a boot loader with respect to Operating System

First stage of a boot loader is a program stored in the (Master Boot Record) MBR and saved in the first sector of bootable disk /dev/hda or /dev/sda. Master Boot Record has the information regarding basic disk Input-Output operations and also the capability to handle those basic operations. But these operations do not fully accomplish to load the Operating System, because the size of MBR boot loader is only 448 bytes. The job of he First stage of the boot loader is simply to load the second stage, that is, New Technology File System (NTFS), which is a 16,512-bytes sector to load the Operating System kernel.

 

https://www.youtube.com/watch?v=ZtVpz5VWjAs

 

BIOS: Search (Hard drive, SD card, CD rom etc), load and excute the boot loader program,

MBR (master boot record) 512 byte, contains primay boot loader file; partition file and validation check.  excute next stage boot loader.

  •   primary boot loader has the address of the main boot loader (2nd stage bootloader). 

GRUB : can chose kernal to load. load  and load kernal to memory and extract the file. 

Kernal:  initilized the hw , and excutes /sbin/init with PID 1 . load file system and init.d 

init: load the program, mounting root fs on /sysroot. 

runlevel: 

  • single-user
  • reserved on most system 
  • full multi-user with no gui 
  • undefined 
  • full mutlti-user with gui
  • reboot

 

posted @ 2020-05-04 05:19  anyu686  阅读(188)  评论(0编辑  收藏  举报