Clean-up loader and added fetching of the memory map.

This commit is contained in:
2024-01-15 14:21:25 +01:00
parent 8f6cc36637
commit bf8949113b
11 changed files with 210 additions and 252 deletions

View File

@@ -10,7 +10,7 @@ kernel_env['LD'] = 'x86_64-elf-g++'
kernel_env.Append(CFLAGS = ['-ffreestanding'])
kernel_env.Append(CXXFLAGS = ['-ffreestanding', '-fno-exceptions', '-fno-rtti', '-std=c++20'])
kernel_env.Append(LINKFLAGS = ['-T', kernel_env.File('linker.ld').abspath, '-ffreestanding', '-nostdlib', '-mcmodel=large', '-mno-red-zone', '-mno-mmx', '-mno-sse', '-mno-sse2'])
kernel_env.Append(CPPPATH = ['#targets/_any/include', '#bastl/include'])
kernel_env.Append(CPPPATH = ['#targets/_any/include', '#bastl/include', 'include', '/usr/include/efi'])
def get_crt_object(name: str) -> str:
import subprocess
@@ -65,10 +65,9 @@ uefi_env['LD'] = 'x86_64-w64-mingw32-g++'
uefi_env.Append(CFLAGS = ['-ffreestanding'])
uefi_env.Append(CXXFLAGS = ['-ffreestanding', '-fno-exceptions', '-fno-rtti', '-std=c++20'])
uefi_env.Append(LINKFLAGS = ['-nostdlib', '-Wl,-dll', '-shared', '-Wl,--subsystem,10', '-e', 'efi_main'])
uefi_env.Append(CPPPATH = ['/usr/include/efi'])
uefi_env.Append(CPPPATH = ['/usr/include/efi', 'include'])
loader_sources = Split('''
src/loader/data.c
src/loader/main.cpp
src/loader/minimalloc.cpp
src/loader/miniprintf.cpp