ARM Linux Kernel Boot Requirements
2012-09-01 22:23
344 查看
Author: Russell King
Initial date: May 18, 2002
Revision: 1 - 17 September 2004 2 - 30 September 2004
原文地址: http://www.arm.linux.org.uk/developer/booting.php
=================================================================================================================
In order to boot ARM Linux, you require a boot loader, which is a small program that runs before the main kernel. The boot loader is expected to initialise various devices, and eventually call
the Linux kernel, passing information to the kernel.
Essentially, the boot loader should provide (as a minimum) the following:
Setup and initialise the RAM.
Initialise one serial port.
Detect the machine type.
Setup the kernel tagged list.
Call the kernel image.
1. Setup and initialise RAM
Existing boot loaders: MANDATORY
New boot loaders: MANDATORY
The boot loader is expected to find and initialise all RAM that the kernel will use for volatile data storage in the system. It performs this in a machine dependent manner. (It may use internal
algorithms to automatically locate and size all RAM, or it may use knowledge of the RAM in the machine, or any other method the boot loader designer sees fit.)
2. Initialise one serial port
Existing boot loaders: OPTIONAL, RECOMMENDED
New boot loaders: OPTIONAL, RECOMMENDED
The boot loader should initialise and enable one serial port on the target. This allows the kernel serial driver to automatically detect which serial port it should use for the kernel console
(generally used for debugging purposes, or communication with the target.)
As an alternative, the boot loader can pass the relevant 'console=' option to the kernel via the tagged lists specifing the port, and serial format options as described in
linux/Documentation/kernel-parameters.txt.
3. Detect the machine type
Existing boot loaders: OPTIONAL
New boot loaders: MANDATORY
The boot loader should detect the machine type its running on by some method. Whether this is a hard coded value or some algorithm that looks at the connected hardware is beyond the scope of
this document. The boot loader must ultimately be able to provide a MACH_TYPE_xxx value to the kernel. (see linux/arch/arm/tools/mach-types).
4. Setup the kernel tagged list
Existing boot loaders: OPTIONAL, HIGHLY RECOMMENDED
New boot loaders: MANDATORY
The boot loader must create and initialise the kernel tagged list. A valid tagged list starts with ATAG_CORE and ends with ATAG_NONE. The ATAG_CORE tag may or may not be empty. An empty ATAG_CORE
tag has the size field set to '2' (0x00000002). The ATAG_NONE must set the size field to zero.
Any number of tags can be placed in the list. It is undefined whether a repeated tag appends to the information carried by the previous tag, or whether it replaces the information in its entirety;
some tags behave as the former, others the latter.
The boot loader must pass at a minimum the size and location of the system memory, and root filesystem location. Therefore, the minimum tagged list should look:
The tagged list should be stored in system RAM.
The tagged list must be placed in a region of memory where neither the kernel decompressor nor initrd 'bootp' program will overwrite it. The recommended placement is in the first 16KiB of RAM.
5. Calling the kernel image
Existing boot loaders: MANDATORY
New boot loaders: MANDATORY
There are two options for calling the kernel zImage. If the zImage is stored in flash, and is linked correctly to be run from flash, then it is legal for the boot loader to call the zImage in
flash directly.
The zImage may also be placed in system RAM (at any location) and called there. Note that the kernel uses 16K of RAM below the image to store page tables. The recommended placement is 32KiB into
RAM.
In either case, the following conditions must be met:
CPU register settings
r0 = 0.
r1 = machine type number discovered in (3) above.
r2 = physical address of tagged list in system RAM.
CPU mode
All forms of interrupts must be disabled (IRQs and FIQs.)
The CPU must be in SVC mode. (A special exception exists for Angel.)
Caches, MMUs
The MMU must be off.
Instruction cache may be on or off.
Data cache must be off and must not contain any stale data.
Devices
DMA to/from devices should be quiesced.
The boot loader is expected to call the kernel image by jumping directly to the first instruction of the kernel image.
=================================================================================================================
Initial date: May 18, 2002
Revision: 1 - 17 September 2004 2 - 30 September 2004
原文地址: http://www.arm.linux.org.uk/developer/booting.php
=================================================================================================================
In order to boot ARM Linux, you require a boot loader, which is a small program that runs before the main kernel. The boot loader is expected to initialise various devices, and eventually call
the Linux kernel, passing information to the kernel.
Essentially, the boot loader should provide (as a minimum) the following:
Setup and initialise the RAM.
Initialise one serial port.
Detect the machine type.
Setup the kernel tagged list.
Call the kernel image.
1. Setup and initialise RAM
Existing boot loaders: MANDATORY
New boot loaders: MANDATORY
The boot loader is expected to find and initialise all RAM that the kernel will use for volatile data storage in the system. It performs this in a machine dependent manner. (It may use internal
algorithms to automatically locate and size all RAM, or it may use knowledge of the RAM in the machine, or any other method the boot loader designer sees fit.)
2. Initialise one serial port
Existing boot loaders: OPTIONAL, RECOMMENDED
New boot loaders: OPTIONAL, RECOMMENDED
The boot loader should initialise and enable one serial port on the target. This allows the kernel serial driver to automatically detect which serial port it should use for the kernel console
(generally used for debugging purposes, or communication with the target.)
As an alternative, the boot loader can pass the relevant 'console=' option to the kernel via the tagged lists specifing the port, and serial format options as described in
linux/Documentation/kernel-parameters.txt.
3. Detect the machine type
Existing boot loaders: OPTIONAL
New boot loaders: MANDATORY
The boot loader should detect the machine type its running on by some method. Whether this is a hard coded value or some algorithm that looks at the connected hardware is beyond the scope of
this document. The boot loader must ultimately be able to provide a MACH_TYPE_xxx value to the kernel. (see linux/arch/arm/tools/mach-types).
4. Setup the kernel tagged list
Existing boot loaders: OPTIONAL, HIGHLY RECOMMENDED
New boot loaders: MANDATORY
The boot loader must create and initialise the kernel tagged list. A valid tagged list starts with ATAG_CORE and ends with ATAG_NONE. The ATAG_CORE tag may or may not be empty. An empty ATAG_CORE
tag has the size field set to '2' (0x00000002). The ATAG_NONE must set the size field to zero.
Any number of tags can be placed in the list. It is undefined whether a repeated tag appends to the information carried by the previous tag, or whether it replaces the information in its entirety;
some tags behave as the former, others the latter.
The boot loader must pass at a minimum the size and location of the system memory, and root filesystem location. Therefore, the minimum tagged list should look:
+-----------+ base -> | ATAG_CORE | | +-----------+ | | ATAG_MEM | | increasing address +-----------+ | | ATAG_NONE | | +-----------+ v
The tagged list should be stored in system RAM.
The tagged list must be placed in a region of memory where neither the kernel decompressor nor initrd 'bootp' program will overwrite it. The recommended placement is in the first 16KiB of RAM.
5. Calling the kernel image
Existing boot loaders: MANDATORY
New boot loaders: MANDATORY
There are two options for calling the kernel zImage. If the zImage is stored in flash, and is linked correctly to be run from flash, then it is legal for the boot loader to call the zImage in
flash directly.
The zImage may also be placed in system RAM (at any location) and called there. Note that the kernel uses 16K of RAM below the image to store page tables. The recommended placement is 32KiB into
RAM.
In either case, the following conditions must be met:
CPU register settings
r0 = 0.
r1 = machine type number discovered in (3) above.
r2 = physical address of tagged list in system RAM.
CPU mode
All forms of interrupts must be disabled (IRQs and FIQs.)
The CPU must be in SVC mode. (A special exception exists for Angel.)
Caches, MMUs
The MMU must be off.
Instruction cache may be on or off.
Data cache must be off and must not contain any stale data.
Devices
DMA to/from devices should be quiesced.
The boot loader is expected to call the kernel image by jumping directly to the first instruction of the kernel image.
=================================================================================================================
相关文章推荐
- arm linux内核启动条件(ARM Linux Kernel Boot Requirements)
- ARM Linux Kernel Boot Requirements
- ARM Linux Kernel Boot Requirements
- ARM Linux Kernel Boot Requirements
- arm-linux-uboot-kernel-rootfs移植
- ubuntu14.04下编译linux uboot和kernel时提示arm-linux-gcc: not found 的解决过程
- arm linux kernel 从入口到start_kernel 的代码分析
- ARMlinux kernel 启动之start_kernel (二)
- 单独编译 u-boot 交叉编译工具安装----交叉编译工具arm-none-linux-gnueabi-gcc安装
- How SMP schedule work in Linux kernel? (ARM architecture)
- Android arm linux kernel启动流程(一)
- 在Linux运行期间升级Linux系统(Uboot+kernel+Rootfs)
- QEMU 运行ARM Linux Kernel
- ARM64 Linux kernel virtual address space
- Exynos4412 Uboot 编译工具 —— 交叉工具链 arm-linux-gcc 的安装
- imx6sx-sdb.dtb imx6sx-sdb.dts 设备树 (d:\swwork\solo\linux-3.14.28\arch\arm\boot\dts)
- 修复VirtualBox "This kernel requires the following features not present on the CPU: pae Unable to boot – please use a kernel appropriate for your CPU"(安装深度Linux的时候就需要)
- 常用u-boot命令详解(全) 2 分类: arm-linux-Ubuntu 2013-07-22 16:28 309人阅读 评论(0) 收藏
- 在Linux运行期间升级Linux系统(Uboot+kernel+Rootfs)