feat: add initial impl of efi-stub and kernel

This commit is contained in:
2026-01-28 16:01:38 +08:00
commit 1233ae9e9b
21 changed files with 845 additions and 0 deletions

30
arch/x86/boot/helper.sh Normal file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
generate_offset_header() {
echo "processing $1"
nm -n "$1" \
| grep -e ' _\(end\|edata\|data\)$' \
| awk '{print "#define CAP_" $3 " 0x" $1}' \
> arch/x86/boot/offset.h
nm -n "$1" \
| grep -e ' efi_pe_entry$' \
| awk '{print "#define efi_pe_entry 0x" $1}' \
>> arch/x86/boot/offset.h
}
build_image() {
echo "building image from $1 and $2"
(dd if=$1 bs=4k conv=sync; cat $2) > yukiImage
}
# Main dispatcher
case "$1" in
generate_offset_header)
generate_offset_header "$2"
;;
build_image)
build_image "$2" "$3"
;;
*)
echo "Usage: $0 {generate_offset_header|build_image} [args...]"
exit 1
;;
esac