mirror of
https://github.com/justinian/jsix.git
synced 2025-12-09 16:04:32 -08:00
Created the framework for using different loadable panic handlers, loaded by the bootloader. Initial panic handler is panic.serial, which contains its own serial driver and stacktrace code. Other related changes: - Asserts are now based on the NMI handler - panic handlers get installed as the NMI interrupt handler - Changed symbol table generation: now use nm's own demangling and sorting, and include symbol size in the table - Move the linker script argument out of the kernel target, and into the kernel's specific module, so that other programs (ie, panic handlers) can use the kernel target as well - Some asm changes to boot.s to help GDB see stack frames - but this might not actually be all that useful - Renamed user_rsp to just rsp in cpu_state - everything in there is describing the 'user' state
133 lines
2.3 KiB
TOML
133 lines
2.3 KiB
TOML
[targets.boot]
|
|
cc = "clang"
|
|
cxx = "clang++"
|
|
ld = "clang++"
|
|
ar = "ar"
|
|
nasm = "nasm"
|
|
objcopy = "objcopy"
|
|
|
|
ccflags = [
|
|
"${ccflags}",
|
|
"-I${source_root}/external",
|
|
"--target=x86_64-unknown-windows",
|
|
"-ffreestanding",
|
|
"-mno-red-zone",
|
|
"-fshort-wchar",
|
|
"-fno-omit-frame-pointer",
|
|
"-ggdb",
|
|
"-g3",
|
|
'-DKERNEL_FILENAME=L"jsix.elf"',
|
|
]
|
|
|
|
cxxflags = [
|
|
"${cxxflags}",
|
|
"-fno-exceptions",
|
|
"-fno-rtti",
|
|
]
|
|
|
|
ldflags = [
|
|
"${ldflags}",
|
|
"--target=x86_64-unknown-windows",
|
|
"-nostdlib",
|
|
"-Wl,-entry:efi_main",
|
|
"-Wl,-subsystem:efi_application",
|
|
"-fuse-ld=lld-link",
|
|
"-g"
|
|
]
|
|
|
|
|
|
[targets.kernel]
|
|
cc = "clang"
|
|
cxx = "clang++"
|
|
ld = "ld.lld"
|
|
ar = "ar"
|
|
nasm = "nasm"
|
|
objcopy = "objcopy"
|
|
|
|
asflags = [
|
|
"${asflags}",
|
|
"-I${source_root}/src/kernel/",
|
|
]
|
|
|
|
ccflags = [
|
|
"${ccflags}",
|
|
"--target=x86_64-unknown-elf",
|
|
"-I${source_root}/external",
|
|
"-nostdlib",
|
|
"-ffreestanding",
|
|
"-nodefaultlibs",
|
|
"-fno-builtin",
|
|
"-mno-sse",
|
|
"-fno-omit-frame-pointer",
|
|
"-mno-red-zone",
|
|
"-g",
|
|
"-mcmodel=large",
|
|
"-D__ELF__",
|
|
"-D__JSIX__",
|
|
"-isystem${source_root}/sysroot/include",
|
|
"-isystem${source_root}/src/libraries/libc/include",
|
|
"--sysroot='${source_root}/sysroot'",
|
|
"-U__linux",
|
|
"-U__linux__",
|
|
]
|
|
|
|
cxxflags = [
|
|
"${cxxflags}",
|
|
"-fno-exceptions",
|
|
"-fno-rtti",
|
|
"-isystem${source_root}/sysroot/include/c++/v1"
|
|
]
|
|
|
|
ldflags = [
|
|
"${ldflags}",
|
|
"-g",
|
|
"-nostdlib",
|
|
"-Bstatic",
|
|
"-z", "norelro",
|
|
"-z", "separate-code",
|
|
]
|
|
|
|
|
|
[targets.user]
|
|
cc = "clang"
|
|
cxx = "clang++"
|
|
ld = "ld.lld"
|
|
ar = "ar"
|
|
nasm = "nasm"
|
|
objcopy = "objcopy"
|
|
|
|
asflags = [
|
|
"${asflags}",
|
|
"-I${source_root}/src/kernel/",
|
|
]
|
|
|
|
ccflags = [
|
|
"${ccflags}",
|
|
"-mno-sse",
|
|
"-fno-omit-frame-pointer",
|
|
"-g",
|
|
"-D__ELF__",
|
|
"-D__JSIX__",
|
|
"-isystem${source_root}/sysroot/include",
|
|
"-isystem${source_root}/src/libraries/libc/include",
|
|
"--sysroot='${source_root}/sysroot'",
|
|
"-U__linux",
|
|
"-U__linux__",
|
|
]
|
|
|
|
cxxflags = [
|
|
"${cxxflags}",
|
|
"-fno-exceptions",
|
|
"-fno-rtti",
|
|
"-isystem${source_root}/sysroot/include/c++/v1"
|
|
]
|
|
|
|
ldflags = [
|
|
"${ldflags}",
|
|
"-g",
|
|
"-Bstatic",
|
|
"--sysroot='${source_root}/sysroot'",
|
|
"-L", "${source_root}/sysroot/lib",
|
|
"-z", "separate-code",
|
|
]
|