os/build.sh
2024-07-09 08:05:07 +02:00

17 lines
608 B
Bash
Executable file

#!/bin/sh
set -e
rm -rf img
mkdir -p img/boot/efi/boot
cd lib/acpica-build && make -j4 && cd ../..
cd kernel && cargo build --release && cd ..
cd loader && cargo build --release && cd ..
cp loader/target/x86_64-unknown-uefi/release/loader.efi img/boot/efi/boot/bootx64.efi
cd img
dd if=/dev/zero of=boot.img bs=1M count=16 status=none
mformat -i boot.img
mcopy -si boot.img boot/* ::
dd if=/dev/zero of=os.img bs=1M count=32 status=none
parted -s os.img mklabel gpt
parted -s os.img mkpart primary fat32 2048s 100%
parted -s os.img set 1 esp on
dd if=boot.img of=os.img bs=1M seek=1 conv=notrunc status=none