-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
21 lines (17 loc) · 1.02 KB
/
justfile
File metadata and controls
21 lines (17 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
build_mode := "debug"
target_arch := arch()
default: (run "bios" target_arch)
build arch=target_arch:
cp targets/{{arch}}-kalneon_os.json targets/current-kalneon_os.json
cargo build {{ if build_mode == "release" {"--release"} else {""} }}
iso firmware="bios" arch=target_arch: (build arch)
mkdir -p build/iso-{{arch}}/boot/grub
cp build/current-kalneon_os/{{build_mode}}/kernel build/iso-{{arch}}/boot/kernel
cp grub.cfg build/iso-{{arch}}/boot/grub/grub.cfg
grub-mkrescue -o build/kalneon_os-{{arch}}.iso build/iso-{{arch}} \
-d /usr/lib/grub/{{ if firmware == "uefi" { "x86_64-efi" } else { "i386-pc" } }}
run firmware="bios" arch=target_arch: (iso firmware arch)
{{ if arch == "x86" { "qemu-system-x86" } else { "qemu-system-x86_64" } }} \
{{ if firmware == "uefi" { "-bios /usr/share/ovmf/OVMF.fd" } else { "" } }} \
-cdrom build/kalneon_os-{{arch}}.iso -m 1024M -smp 4 -gdb tcp::26000 -S -d int,cpu_reset -D /tmp/qemu.log -enable-kvm -cpu host &
gdb build/iso-{{arch}}/boot/kernel