[PATCH v5 1/2] docs/LoongArch: Add booting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Describes the meaning and value of the image header field.

Suggested-by: Xiaotian Wu <wuxiaotian@xxxxxxxxxxx>
Signed-off-by: Yanteng Si <siyanteng@xxxxxxxxxxx>
---
 Documentation/loongarch/booting.rst | 43 +++++++++++++++++++++++++++++
 Documentation/loongarch/index.rst   |  1 +
 2 files changed, 44 insertions(+)
 create mode 100644 Documentation/loongarch/booting.rst

diff --git a/Documentation/loongarch/booting.rst b/Documentation/loongarch/booting.rst
new file mode 100644
index 000000000000..d893f495ca58
--- /dev/null
+++ b/Documentation/loongarch/booting.rst
@@ -0,0 +1,43 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+=======================
+Booting Linux/LoongArch
+=======================
+
+:Author: Yanteng Si <siyanteng@xxxxxxxxxxx>
+:Date:   18 Nov 2022
+
+Bootloader passing parameters to the kernel
+============================================
+
+LoongArch supports ACPI and FDT. The information that needs to be
+passed to the kernel includes the memmap, the initrd, the command
+line, optionally the FDT, and so on.
+The kernel is passed the following arguments on `kernel_entry` :
+
+      - a0 = efi_boot: `efi_boot` is a flag indicating whether
+        this boot environment isfully UEFI-compliant.
+
+      - a1 = cmdline: `cmdline` is a pointer to the kernel command line.
+
+      - a2 = systemtable: `systemtable` points to the EFI system table.
+        All pointers involved at this stage are in
+        physical addresses.
+
+Header of Linux/LoongArch kernel images
+=======================================
+
+Linux/LoongArch kernel images are EFI images. Being PE files, they have
+a 64-byte header structured like::
+
+	u32	MZ_MAGIC		    /* "MZ", MS-DOS header */
+	u32	res0 = 0		    /* reserved */
+	u64	kernel_entry		/* Kernel entry point */
+	u64	_end - _text		/* Kernel image effective size */
+	u64	0			        /* Kernel image load offset from start of RAM */
+	u64	res1 = 0		    /* reserved */
+	u64	res2 = 0		    /* reserved */
+	u64	res3 = 0		    /* reserved */
+	u32	LINUX_PE_MAGIC		/* Magic number */
+	u32	pe_header - _head	/* Offset to the PE header */
+
diff --git a/Documentation/loongarch/index.rst b/Documentation/loongarch/index.rst
index aaba648db907..df0174d6d227 100644
--- a/Documentation/loongarch/index.rst
+++ b/Documentation/loongarch/index.rst
@@ -10,6 +10,7 @@ LoongArch Architecture
 
    introduction
    irq-chip-model
+   booting
 
    features
 
-- 
2.31.1




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux