Allow debug option to be communicated at boot

This commit is contained in:
Justin C. Miller
2019-03-11 03:04:57 -07:00
parent 74a5c301f8
commit 870ca1db45
20 changed files with 128 additions and 68 deletions

View File

@@ -152,8 +152,11 @@ build $
$modulefile $
{{ generator }}
build $builddir/flash.img : cp $srcroot/assets/ovmf/x64/OVMF.fd
name = flash.img
build $builddir/ovmf.fd : cp $srcroot/assets/ovmf/x64/ovmf.fd
name = ovmf.fd
build $builddir/ovmf_debug.fd : cp $srcroot/assets/ovmf/x64/ovmf_debug.fd
name = ovmf_debug.fd
build $builddir/popcorn.elf | $builddir/popcorn.elf.debug : strip $builddir/host/popcorn.elf
name = kernel
@@ -177,5 +180,5 @@ build $builddir/popcorn.img : makefat | $
$builddir/fatroot/efi/boot/bootx64.efi
name = popcorn.img
# vim: et ts=4 sts=4 sw=4
# vim: ft=ninja et ts=4 sts=4 sw=4

View File

@@ -2,18 +2,13 @@
{% block variables %}
{{ super() }}
ld = ld
cc = clang
cxx = clang++
ccflags = $ccflags $
-DKERNEL_FILENAME=L\"popcorn.elf\" $
-DGNU_EFI_USE_MS_ABI $
-DHAVE_USE_MS_ABI $
-DEFI_DEBUG=0 $
-DEFI_DEBUG_CLEAR_MEMORY=0 $
-DBOOTLOADER_DEBUG $
-fPIC
-DBOOTLOADER_DEBUG
ldflags = $ldflags $
-T ${srcroot}/src/arch/x86_64/boot.ld $
@@ -27,3 +22,6 @@ build $builddir/boot.efi : makeefi ${builddir}/{{ module.output }}
name = boot.efi
{% endblock %}
# vim: ft=ninja et ts=4 sts=4 sw=4

View File

@@ -2,11 +2,7 @@
{% block variables %}
{{ super() }}
libs = $
-L${builddir} $
{%- for dep in module.libdeps %}
-l{{ dep.name }} $
{%- endfor %}
$libs
{% endblock %}
# vim: ft=ninja et ts=4 sts=4 sw=4

View File

@@ -7,3 +7,6 @@ libs = $libs
ldflags = $ldflags -T ${srcroot}/src/arch/x86_64/kernel.ld
{% endblock %}
# vim: ft=ninja et ts=4 sts=4 sw=4

View File

@@ -5,3 +5,6 @@
ccflags = $ccflags -ggdb
{% endblock %}
# vim: ft=ninja et ts=4 sts=4 sw=4

View File

@@ -1 +1,4 @@
{% extends "module.base.j2" %}
# vim: ft=ninja et ts=4 sts=4 sw=4

View File

@@ -1,35 +1,41 @@
{% extends "target.default.j2" %}
{% block binaries %}
ld = ld
cc = clang
cxx = clang++
ld = ld
ar = ar
nasm = nasm
objcopy = objcopy
{% endblock %}
{% block variables %}
ccflags = $ccflags $
-ggdb $
-nostdlib $
-ffreestanding $
-nodefaultlibs $
-fno-builtin $
-mno-sse $
-fno-omit-frame-pointer $
-mno-red-zone $
-fshort-wchar
-ggdb $
-nostdlib $
-ffreestanding $
-nodefaultlibs $
-fno-builtin $
-mno-sse $
-fno-omit-frame-pointer $
-mno-red-zone $
-fshort-wchar $
-D__ELF__ $
-fPIC
cxxflags = $cxxflags $
-nostdlibinc $
-fno-exceptions $
-fno-rtti
-fno-exceptions $
-fno-rtti $
ldflags = $ldflags $
-g $
-nostdlib $
-znocombreloc $
-g $
-nostdlib $
-znocombreloc $
-Bsymbolic $
-nostartfiles
-nostartfiles
{% endblock %}
# vim: ft=ninja et ts=4 sts=4 sw=4

View File

@@ -22,3 +22,5 @@ build ${builddir}/cxx.defs : dump_cxx_defs | {{ buildfile }}
build ${builddir}/cc.run : dump_cc_run | {{ buildfile }}
build ${builddir}/cxx.run : dump_cxx_run | {{ buildfile }}
# vim: ft=ninja et ts=4 sts=4 sw=4

View File

@@ -40,4 +40,6 @@ ldflags = $ldflags $
-Bstatic
{% endblock %}
# vim: et ts=4 sts=4 sw=4
# vim: ft=ninja et ts=4 sts=4 sw=4

View File

@@ -5,4 +5,6 @@
ccflags = $ccflags -g -ggdb
{% endblock %}
# vim: et ts=4 sts=4 sw=4
# vim: ft=ninja et ts=4 sts=4 sw=4