The difference between bootloader and bootstrap

Source: Internet
Author: User


The difference between bootloader and bootstrap
In "Embedded Linux Primer" see, in fact, there are some differences and imprecise places,
For example, bootstrap and bootstrap loader seem to be different on PCs, but they don't affect understanding.
Http://www.devbone.com/leadbbs/MINI/Default.asp?100-2246-0-0-0-0-0-a-.htm
Also such as Redboot (RedHat Embedded Debug and Bootstrap), the essence is a bootloader but the name has Bootstrap, let people depressed
http://sourceware.org/redboot/



This is limited to embedded +arm+linux environments



Bootloader translation for (first stage) boot loader
Bootstrap loader translation for the second stage boot loader



Bootloader can understand without much explanation--the first program that executes after power, and it never relies on the kernel. Like Uboot, Vivi.
Bootstrap, the second stage boot loader, belongs to kernel code (not compiled into vmlinux, but executable mirrors like zimage contain bootstrap) that act as a link between bootloader and kernel mirroring.
Bootstrap typically verifies kernel mirroring, compresses kernel mirroring, deploys kernel mirroring to memory, and provides the appropriate context for kernel execution (nothing more than interruption, command cache and data cache, setting the C language operating environment)



Execution Process
-->bootloader-->bootstrap (HEAD.O)--> kernel vmlinux (HEAD.O)--> kernel Start_kernel (MAIN.O)
The above two head.o are not the same
Bootstrap used/arch/arm/boot/compressed/head. The S
Kernel vmlinux is/arch/arm/kernel/head. S
Although all are head.o, but not an era, since this distinguishes open bootstrap and kernel vmlinux
equals you see uncompressing Linux ... done, booting the kernel. Also belongs to the bootstrap
wait until the second line of kernel version information is printed, it is already the real kernel main.o of the time
a strict sense of the kernel, make one of the most important makefile Vmlinux
Remove the symbol, tags and annotations It's the image.
gzip compressed to piggy.gz
Next, a file named Piggy.s is compiled into PIGGY.O
It's interesting that it has only 7 lines of code, and in fact only the role of piggy.gz included
. Section. Piggydata, #alloc
           globl input_data
   input_data:
           incbin "arch/arm/ Boot/compressed/piggy.gz "
           globl input_data_end
   input_data_end:


then piggy.o together with MISC.O, HEAD.O, and other code belonging to Bootstrap to become a synthetic mirror, such as zimage, that can be booted. 

where MISC.O is responsible for decompressing, HEAD.O HEAD_XX.O is responsible for initializing the kernel context


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.