Files
jsix_import/configs/custom.ninja
Justin C. Miller ea9d20a250 [panic] Add separate kernel-mode panic handler
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
2021-08-01 14:03:10 -07:00

74 lines
2.4 KiB
Plaintext

rule makest
description = Making symbol table
command = nm -n -S --demangle $in | ${source_root}/scripts/build_symbol_table.py $out
rule makefat
description = Creating $name
command = $
cp ${source_root}/assets/diskbase.img $out; $
mcopy -s -D o -i $out@@1M ${build_root}/fatroot/* ::/
rule strip
description = Stripping $name
command = $
cp $in $out; $
objcopy --only-keep-debug $out $out.debug; $
strip -g $out; $
objcopy --add-gnu-debuglink=$out.debug $out
build ${build_root}/ovmf_vars.fd : cp ${source_root}/assets/ovmf/x64/ovmf_vars.fd
name = ovmf_vars.fd
build ${build_root}/ovmf_vars_d.fd : cp ${source_root}/assets/ovmf/x64/ovmf_vars_d.fd
name = ovmf_vars_d.fd
build ${build_root}/jsix.elf | ${build_root}/jsix.elf.debug : strip ${build_root}/kernel/jsix.elf
name = kernel
build ${build_root}/jsix.dump : dump ${build_root}/kernel/jsix.elf
name = kernel
build ${build_root}/jsix.elf-gdb.py : cp ${source_root}/assets/debugging/jsix.elf-gdb.py
name = kernel debug python scripts
build ${build_root}/fatroot/jsix.elf : cp ${build_root}/jsix.elf
name = kernel to FAT image
build ${build_root}/fatroot/efi/boot/bootx64.efi : cp ${build_root}/boot/boot.efi
name = bootloader to FAT image
build ${build_root}/fatroot/testapp.elf : cp ${build_root}/user/testapp.elf
name = null driver to FAT image
build ${build_root}/fatroot/drv.uefi_fb.elf : cp ${build_root}/user/drv.uefi_fb.elf
name = UEFI framebuffer driver to FAT image
build ${build_root}/fatroot/panic.serial.elf : cp ${build_root}/kernel/panic.serial.elf
name = UEFI framebuffer driver to FAT image
build ${build_root}/fatroot/srv.init.elf : cp ${build_root}/user/srv.init.elf
name = Init server to FAT image
build ${build_root}/fatroot/symbol_table.dat : makest ${build_root}/jsix.elf
build ${build_root}/jsix.img : makefat | $
${build_root}/fatroot/symbol_table.dat $
${build_root}/fatroot/testapp.elf $
${build_root}/fatroot/drv.uefi_fb.elf $
${build_root}/fatroot/srv.init.elf $
${build_root}/fatroot/jsix.elf $
${build_root}/fatroot/panic.serial.elf $
${build_root}/fatroot/efi/boot/bootx64.efi
name = jsix.img
default $
${build_root}/ovmf_vars.fd $
${build_root}/ovmf_vars_d.fd $
${build_root}/jsix.dump $
${build_root}/jsix.elf-gdb.py $
${build_root}/jsix.img
# vim: ft=ninja et ts=4 sts=4 sw=4