- Mastering Embedded Linux Programming
- Chris Simmonds
- 322字
- 2021-07-30 09:45:00
What does a bootloader do?
In an embedded Linux system, the bootloader has two main jobs: basic system initialization and the loading of the kernel. In fact, the first job is somewhat subsidiary to the second in that it is only necessary to get as much of the system working as is needed to load the kernel.
When the first lines of bootloader code are executed, following power-on or a reset, the system is in a very minimal state. The DRAM controller will not have been set up so main memory is not accessible, likewise other interfaces will not have been configured so storage accessed via NAND flash controllers, MMC controllers, and so on, are also not usable. Typically, the only resources operational at the beginning are a single CPU core and some on-chip static memory. As a result, system bootstrap consists of several phases of code, each bringing more of the system into operation.
The early boot phase stops once the interfaces required to load a kernel are working. That includes main memory and the peripherals used to access the kernel and other images, be they mass storage or network. The final act of the bootloader is to load the kernel into RAM and create an execution environment for it. The details of the interface between the bootloader and the kernel are architecture-specific but, in all cases, it means passing a pointer to information about the hardware that the bootloader knows about and passing a kernel command line, which is an ASCII string containing essential information for Linux. Once the kernel has begun executing, the bootloader is no longer needed and all the memory it was using can be reclaimed.
A subsidiary job of the bootloader is to provide a maintenance mode for updating boot configurations, loading new boot images into memory and, maybe, running diagnostics. This is usually controlled by a simple command-line user interface, commonly over a serial interface.
- Puppet 4 Essentials(Second Edition)
- 黑客攻防從入門到精通(實(shí)戰(zhàn)秘笈版)
- C語言程序設(shè)計(jì)(第3版)
- Angular UI Development with PrimeNG
- MariaDB High Performance
- Java加密與解密的藝術(shù)
- Java程序設(shè)計(jì)與實(shí)踐教程(第2版)
- Troubleshooting PostgreSQL
- SSM輕量級(jí)框架應(yīng)用實(shí)戰(zhàn)
- Building Serverless Applications with Python
- 利用Python進(jìn)行數(shù)據(jù)分析
- PHP編程基礎(chǔ)與實(shí)例教程
- HTML5從入門到精通(第4版)
- Go語言底層原理剖析
- Beginning C++ Game Programming