⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 booting.arm.svn-base

📁 vivi源代码
💻 SVN-BASE
字号:
                               Booting ARM LinuxIn order to boot ARM Linux, you require a boot loader, which is a small programthat runs before the main kernel. The boot loader is expected to initialisevarious devices, and eventually call the Linux kernel, passing information tothe kernel.Essentially, the boot loader should provide (as a minimum) the following: 1. Setup and initialise the RAM. 2. Initialise one serial port. 3. Detect the machine type. 4. Setup the kernel tagged list. 5. Call the kernel image.1. Setup and initialise RAMExisting boot loaders: MANDATORYNew boot loaders: MANDATORYThe boot loader is expected to find and initialise all RAM that the kernel willuse for volatile data storage in the system. It performs this in a machinedependent manner. (It may use internal algorithms to automatically locate andsize all RAM, or it may use knowledge of the RAM in the machine, or any othermethod the boot loader designer sees fit.)2. Initialise one serial portExisting boot loaders: OPTIONAL, RECOMMENDEDNew boot loaders: OPTIONAL, RECOMMENDEDThe boot loader should initialise and enable one serial port on the target.This allows the kernel serial driver to automatically detect which serial portit should use for the kernel console (generally used for debugging purposes, orcommunication with the target.)As an alternative, the boot loader can pass the relevant 'console=' option tothe kernel via the tagged lists specifing the port, and serial format optionsas described inlinux/Documentation/kernel-parameters.txt.3. Detect the machine typeExisting boot loaders: OPTIONALNew boot loaders: MANDATORYThe 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 theconnected hardware is beyond the scope of this document. The boot loader mustultimately be able to provide a MACH_TYPE_xxx value to the kernel. (see linux/arch/arm/tools/mach-types).4. Setup the kernel tagged listExisting boot loaders: OPTIONAL, HIGHLY RECOMMENDEDNew boot loaders: MANDATORYThe boot loader must create and initialise the kernel tagged list. A validtagged list starts with ATAG_CORE and ends with ATAG_NONE. The ATAG_CORE tagmay 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 arepeated tag appends to the information carried by the previous tag, or whetherit 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 systemmemory, and root filesystem location. Therefore, the minimum tagged list shouldlook:        +-----------+base -> | ATAG_CORE |  |        +-----------+  |        | ATAG_MEM  |  | increasing address        +-----------+  |        | ATAG_NONE |  |        +-----------+  vThe tagged list should be stored in system RAM.The tagged list must be placed in a region of memory where neither the kerneldecompressor nor initrd 'bootp' program will overwrite it. The recommendedplacement is in the first 16KiB of RAM.5. Calling the kernel imageExisting boot loaders: MANDATORYNew boot loaders: MANDATORYThere are two options for calling the kernel zImage. If the zImage is stored inflash, and is linked correctly to be run from flash, then it is legal for theboot 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. Therecommended 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. · The boot loader is expected to call the kernel image by jumping directly to    the first instruction of the kernel image.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -