booting.rst 1.5 KB

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