diff options
author | Gunnar Beutner <gbeutner@serenityos.org> | 2021-06-24 13:08:19 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-25 15:19:09 +0200 |
commit | c9747a32366f9d0f6d37970579a2661233ea40bf (patch) | |
tree | 3202311d0abd795a9b10ce2c9a7893ca3098a4ba /Meta/debug-kernel.sh | |
parent | 04ba5cfcad6771de04fc8c7fa7bc0be810c72beb (diff) | |
download | serenity-c9747a32366f9d0f6d37970579a2661233ea40bf.zip |
Kernel: Build the x86_64 kernel as an ELF32 executable
Multiboot only supports ELF32 executables. This changes the build
process to build an ELF32 executable which has a 32-bit entry point,
but consists of mostly 64-bit code.
Diffstat (limited to 'Meta/debug-kernel.sh')
-rwxr-xr-x | Meta/debug-kernel.sh | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Meta/debug-kernel.sh b/Meta/debug-kernel.sh index 0f78ee6ceb..70130d11cb 100755 --- a/Meta/debug-kernel.sh +++ b/Meta/debug-kernel.sh @@ -8,9 +8,17 @@ # remote on localhost:1234. So point our debugger there, and inform # the debugger which binary to load symbols, etc from. # +if [ "$SERENITY_ARCH" = "x86_64" ]; then + gdb_arch=i386:x86-64 + kernel_binary=Kernel64 +else + gdb_arch=i386:intel + kernel_binary=Kernel +fi + exec $SERENITY_KERNEL_DEBUGGER \ - -ex "file $(dirname "$0")/../Build/${SERENITY_ARCH:-i686}/Kernel/Kernel" \ - -ex 'set arch i386:intel' \ + -ex "file $(dirname "$0")/../Build/${SERENITY_ARCH:-i686}/Kernel/$kernel_binary" \ + -ex "set arch $gdb_arch" \ -ex 'target remote localhost:1234' \ -ex "source $(dirname "$0")/serenity_gdb.py" \ "$@" |