feat: add initial impl of efi-stub and kernel

This commit is contained in:
2026-01-28 16:01:38 +08:00
commit 1233ae9e9b
21 changed files with 845 additions and 0 deletions

60
arch/x86/boot/kcapsule.ld Normal file
View File

@@ -0,0 +1,60 @@
OUTPUT_ARCH(i386:x86_64)
SECTIONS {
. = 0x1000;
.text : {
_text = .;
*(.text)
*(.text.*)
_etext = .;
}
.rodata : {
_rodata = .;
*(.rodata)
*(.rodata.*)
_erodata = .;
}
. = ALIGN(0x1000);
.data : {
_data = .;
*(.data)
*(.data.*)
. = ALIGN(0x1000);
_edata = .;
}
.bss : {
_bss = .;
*(.bss)
*(.bss.*)
*(COMMON)
_ebss = .;
}
.pgtable : {
_pgtable = .;
*(.pgtable)
_epgtable = .;
}
. = ALIGN(0x1000);
_end = .;
.got.plt (INFO) : {
*(.got.plt)
}
ASSERT(SIZEOF(.got.plt) == 0 ||
SIZEOF(.got.plt) == 0x18,
"Unexpected GOT/PLT entries detected!")
/*
* Sections that should stay zero sized, which is safer to
* explicitly check instead of blindly discarding.
*/
.got : {
*(.got)
}
ASSERT(SIZEOF(.got) == 0, "Unexpected GOT entries detected!")
.plt : {
*(.plt) *(.plt.*)
}
ASSERT(SIZEOF(.plt) == 0, "Unexpected run-time procedure linkages detected!")
}