mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:37:34 +00:00
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.
This commit is contained in:
parent
04ba5cfcad
commit
c9747a3236
3 changed files with 37 additions and 11 deletions
|
@ -1,6 +1,11 @@
|
|||
#!/bin/sh
|
||||
tmp=$(mktemp)
|
||||
nm -n Kernel | awk '{ if ($2 != "a") print; }' | uniq > "$tmp"
|
||||
if [ -f Kernel32 ]; then
|
||||
kernel_binary=Kernel32
|
||||
else
|
||||
kernel_binary=Kernel64
|
||||
fi
|
||||
nm -n $kernel_binary | awk '{ if ($2 != "a") print; }' | uniq > "$tmp"
|
||||
printf "%08x\n" "$(wc -l "$tmp" | cut -f1 -d' ')" > kernel.map
|
||||
cat "$tmp" >> kernel.map
|
||||
rm -f "$tmp"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue