Skip to content

Commit 38eb496

Browse files
Yanteng Sichenhuacai
authored andcommitted
docs/LoongArch: Add booting description
1, Describe the information passed from BootLoader to kernel. 2, Describe the meaning and values of the kernel image header field. Suggested-by: Xiaotian Wu <[email protected]> Signed-off-by: Yanteng Si <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent b681604 commit 38eb496

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

Documentation/loongarch/booting.rst

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
=======================
4+
Booting Linux/LoongArch
5+
=======================
6+
7+
:Author: Yanteng Si <[email protected]>
8+
:Date: 18 Nov 2022
9+
10+
Information passed from BootLoader to kernel
11+
============================================
12+
13+
LoongArch supports ACPI and FDT. The information that needs to be passed
14+
to the kernel includes the memmap, the initrd, the command line, optionally
15+
the ACPI/FDT tables, and so on.
16+
17+
The kernel is passed the following arguments on `kernel_entry` :
18+
19+
- a0 = efi_boot: `efi_boot` is a flag indicating whether
20+
this boot environment is fully UEFI-compliant.
21+
22+
- a1 = cmdline: `cmdline` is a pointer to the kernel command line.
23+
24+
- a2 = systemtable: `systemtable` points to the EFI system table.
25+
All pointers involved at this stage are in physical addresses.
26+
27+
Header of Linux/LoongArch kernel images
28+
=======================================
29+
30+
Linux/LoongArch kernel images are EFI images. Being PE files, they have
31+
a 64-byte header structured like::
32+
33+
u32 MZ_MAGIC /* "MZ", MS-DOS header */
34+
u32 res0 = 0 /* Reserved */
35+
u64 kernel_entry /* Kernel entry point */
36+
u64 _end - _text /* Kernel image effective size */
37+
u64 load_offset /* Kernel image load offset from start of RAM */
38+
u64 res1 = 0 /* Reserved */
39+
u64 res2 = 0 /* Reserved */
40+
u64 res3 = 0 /* Reserved */
41+
u32 LINUX_PE_MAGIC /* Magic number */
42+
u32 pe_header - _head /* Offset to the PE header */

Documentation/loongarch/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ LoongArch Architecture
99
:numbered:
1010

1111
introduction
12+
booting
1213
irq-chip-model
1314

1415
features

0 commit comments

Comments
 (0)