(WIP) Loader for 64 bit kernel.
This commit is contained in:
10
SConstruct
10
SConstruct
@@ -14,6 +14,7 @@ AddOption(
|
||||
target = GetOption('target')
|
||||
|
||||
env = Environment(tools = ['default', 'compilation_db'])
|
||||
env.Append(CFLAGS = ['-ffreestanding'])
|
||||
env.Append(CXXFLAGS = ['-ffreestanding', '-fno-exceptions', '-fno-rtti', '-std=c++20'])
|
||||
env.Append(LINKFLAGS = ['-T', 'linker.ld', '-ffreestanding', '-nostdlib'])
|
||||
env.Append(CPPPATH = ['#targets/_any/include', '#bastl/include'])
|
||||
@@ -21,6 +22,7 @@ env.Append(CCFLAGS = ['-g', '-O0'])
|
||||
|
||||
env['KERNEL_SOURCES'] = []
|
||||
env['KERNEL_DEPENDENCIES'] = []
|
||||
env['ISO_FILES'] = []
|
||||
env = SConscript('bastl/SConscript', exports = 'env')
|
||||
env = SConscript('targets/_any/SConscript', exports = 'env')
|
||||
env = SConscript(f'targets/{target}/SConscript', exports = 'env')
|
||||
@@ -28,9 +30,15 @@ env = SConscript(f'targets/{target}/SConscript', exports = 'env')
|
||||
prog_os = env.Program(
|
||||
target = 'os.bin',
|
||||
source = env['KERNEL_SOURCES'],
|
||||
LIBS = ['gcc']
|
||||
LIBS = ['gcc'],
|
||||
LINKCOM = env['KERNEL_LINKCOM']
|
||||
)
|
||||
env.Depends(prog_os, env['KERNEL_DEPENDENCIES'])
|
||||
env.Default(prog_os)
|
||||
comp_db = env.CompilationDatabase(target = '#compile_commands.json')
|
||||
env.Default(comp_db)
|
||||
|
||||
iso_targets = []
|
||||
for iso_file in env['ISO_FILES']:
|
||||
iso_targets.append(env.Command(f'iso/{iso_file["target"]}', iso_file["source"], Copy("$TARGET", "$SOURCE")))
|
||||
env.Command('os.iso', iso_targets, 'grub-mkrescue -o "$TARGET" "iso"')
|
||||
Reference in New Issue
Block a user