boot: Add EFISTUB and refactor boot protocols
This commit is contained in:
+42
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user