boot: Add EFISTUB and refactor boot protocols

This commit is contained in:
2026-10-27 22:50:43 +01:00
parent 6827dc309e
commit 196543c3d3
40 changed files with 1923 additions and 208 deletions
+42 -4
View File
@@ -1,6 +1,44 @@
kernel_sources += files(
'cmdline.c',
'main.c',
objcopy = find_program('objcopy')
zinnia_bootdir = zinnia_datadir / 'boot'
loader_sources = files(
'loader/elf.c',
'loader/lib.c',
'loader/loader.c',
)
subdir('limine')
loader_c_args = [
'-ffreestanding',
'-nostdinc',
'-fno-stack-protector',
'-fno-omit-frame-pointer',
'-mgeneral-regs-only',
]
loader_includes = include_directories('loader', 'loader' / target_machine.cpu_family())
loader_objcopy_format = 'unknown'
subdir('loader' / target_machine.cpu_family())
loader_kernel = custom_target(
'loader-kernel.o',
input: kernel,
output: 'loader-kernel.o',
command: [
objcopy,
'-I', 'binary',
'-O', loader_objcopy_format,
'--rename-section', '.data=.kernel,alloc,load,readonly,data,contents',
'@INPUT@',
'@OUTPUT@',
],
)
if kconfig.get('CONFIG_BOOT_EFISTUB', 'n') == 'y'
subdir('efi')
endif
if kconfig.get('CONFIG_BOOT_LIMINE', 'n') == 'y'
subdir('limine')
endif