天天看點

Documentation下ARM中的Booting文檔翻譯

//檔案位置: Documentation/arm/Booting

Booting ARM Linux

啟動ARM Linux

=================

Author: Russell King

Date  : 18 May 2002

The following documentation is relevant to 2.4.18-rmk6 and beyond.

下列文檔與2.4.18-rmk6和更高版本的核心有關。

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.

為了能夠啟動ARM Linux,你需要一個啟動器,這個啟動器是一個非常輕型的程式能夠在

主核心代碼啟動前啟動。啟動器能夠初始化一些裝置,并且最後能夠調用linux核心,

同時将資訊傳遞給核心。

Essentially, the boot loader should provide (as a minimum) the

following:

最重要的是,啟動器應該能夠至少提供:

1. Setup and initialise the RAM.   安裝和初始化ARM

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 RAM

1. 安裝和初始化ARM

---------------------------

Existing boot loaders: MANDATORY

New boot loaders:    MANDATORY

存在的啟動機:               MANDATORY

新的啟動機:                 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.)

啟動器應該能夠找到并且初始化所有的ARM,核心将使用該ARM在系統中用于易變資料的

存儲。它以一個機器獨立的方式進行運作。(他可能使用内部的算法自動的定位和計算所有

ARM的大小,或者是使用在機器中有關ARM的資訊,或者是使用啟動機設計者其他的方法。)

2. Initialise one serial port

2. 初始化一個序列端口

-----------------------------

Existing boot loaders: OPTIONAL, RECOMMENDED

New boot loaders: OPTIONAL, RECOMMENDED

現有的引導裝載程式:      OPTIONAL, RECOMMENDED

新的引導裝載程式:        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 specifying the port, and

serial format options as described in

       linux/Documentation/kernel-parameters.txt.

作為一個可選的選項,引導啟動程式能夠将相關的' console='選項通過标記清單

上指定的端口号傳遞到核心,并且一些格式選項在linux/Documentation/kernel-parameters.txt

中進行描述。

3. Detect the machine type

3. 檢測機器類型

--------------------------

Existing boot loaders: OPTIONAL

New boot loaders: MANDATORY

現有的引導裝載程式:      OPTIONAL

新的引導裝載程式:        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).

引導啟動程式應該通過一些方法檢測她正在運作的機器的類型。無論是一個硬體編碼值

還是一些檢視所連接配接硬體的算法都已經超越了這個文檔的範疇。引導啟動程式最後一定

能夠向核心提供一個MACH_TYPE_xxx值。

4. Setup the kernel tagged list

4. 安裝核心标記清單

-------------------------------

Existing boot loaders: OPTIONAL, HIGHLY RECOMMENDED

現有的引導裝載程式:      OPTIONAL, HIGHLY RECOMMENDED

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.

引導啟動程式一定能夠建立并初始化一個核心标記清單。一個有效的标記清單以

ATAG_CORE開始和以ATAG_NONE結束。ATAG_CORE标簽可能或者是可能不是空的。

一個空的ATAG_CORE标記有一個大小區域被設定成'2'(0x00000002).ATAG_NONE

标記的大小區域肯定被設定成0。

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.

标記清單應該在系統ARM中被儲存。

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.

标記清單核心解壓程式的區域,又不能被放置在initrd 'bootp'程式重寫的區域。

推薦使用得地方時ARM起始的16KiB的位置。

5. Calling the kernel image

5.調用核心鏡像

現有的引導裝載程式:     MANDATORY

新的引導裝載程式:       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.

有兩個調用核心zImage的選項。如果zImage被儲存在閃存中,并且被正确連接配接

能夠從閃存中正确運作的話,那麼引導啟動程式直接從閃存中調用zImage是合理

的。

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.

zImage也許可能被放置在系統ARM中的任何地方并且在那裡被調用。注意核心

使用在鏡像下ARM的16k來存儲頁表。推薦的位置是進入ARM的32KiB處。

In either case, the following conditions must be met:

在其他情況中,下列條件應該要滿足:

- CPU register settings                              

CPU寄存器設定

  r0 = 0,                                            

r0 = 0 

  r1 = machine type number discovered in (3) above.  

   r1 = 在上述(3) 中所發現的機器類型号

  r2 = physical address of tagged list in system RAM.

r2 = 在系統ARM中标記清單的位址

- CPU mode                                            

CPU模式

  All forms of interrupts must be disabled (IRQs and FIQs)

關閉所有形式的中斷(IRQs和FIQs)

  The CPU must be in SVC mode.  (A special exception exists for Angel)          CPU一定要在SVC模式下。

- 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.

  引導啟動程式通過直接跳轉到核心鏡像的第一條指令來調用核心鏡像。

繼續閱讀