The code implements a basic bootloader

Source: Internet
Author: User

What is bootloader? Baidu a lot of, it is to optimize the processor for a suitable environment, and then the leader point to the kernel, the rest of the matter to the kernel, there will be no more of it (here bootloader is not uboot). Then someone asked: what if it wants to pass to the kernel what some parameters like in the execution? Isn't that ridiculous? That's certainly not so easy.

Hardware initialization of the work you should be able to guess one or two, 1, must be the clock, but before this need to turn off the watchdog, 2, of course, memory (that is, RAM), and then to the kernel (simple bar), but before this, if our bootloader is too large, we also need to relocate it to ram. Here's a tip: if you want to speed up the bootloader, you can turn on Icache to speed up the process. Then go to the main function to perform the jump work.

In this process, we bootloader a space in memory to add some parameters to the RAM segment in a way that the kernel can recognize, so that whenever the kernel needs bootloader parameters, she takes the memory to parse the data in a specific way, Then bootloader can indirectly pass the parameter to the kernel. As for the relocation of the address and how the kernel jumps, I have more detailed comments in the code. Some of the data in the code is copied from the previous uboot, and the operation of the Register is different for each processor. This bootloader is just an introduction to Uboot, and the complete uboot is much more complicated than that.

Code reference Address: http://www.oschina.net/code/snippet_2241389_52110




The code implements a basic bootloader

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.