From 04104fc051d44f4f9b3328f29b4be91fa4060f34 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 28 Apr 2021 23:12:17 +0200 Subject: Started conversion to Grub (#17) Yes, the CI won't like this. --- run | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'run') diff --git a/run b/run index 3e41d71..6e9ea7e 100755 --- a/run +++ b/run @@ -158,11 +158,8 @@ make_build() { echo "quit" ) | $SUDO fdisk -e $VND >/dev/null $SUDO mkfs.ext2 -F /dev/${VND}i >/dev/null - - $SUDO dd if=build/boot.bin of=/dev/${VND}i conv=notrunc status=none else $SUDO mke2fs -b 1024 -q build/disk.img - dd if=build/boot.bin of=build/disk.img conv=notrunc status=none fi # Set test app as init @@ -179,10 +176,14 @@ make_build() { $SUDO cp -r disk/* mnt/ $SUDO chmod -R 0 mnt/conf/ $SUDO cp -r build/apps/ mnt/apps/ - $SUDO cp build/load.bin mnt/ $SUDO umount mnt/ rm -rf mnt/ + mkdir -p iso/boot/grub/ + cp build/apps/kernel/exec iso/boot/melvix + cp boot/grub.cfg iso/boot/grub/ + grub-mkrescue -o build/melvix.iso iso/ + if [ "$(uname -s)" = "OpenBSD" ]; then $SUDO vnconfig -u $VND fi @@ -192,17 +193,17 @@ make_build() { make_test() { if [ "$mode" = "test" ]; then - qemu_with_flags -serial file:test.log -nographic -drive file=build/disk.img,format=raw,index=1,media=disk + qemu_with_flags -serial file:test.log -nographic -cdrom build/melvix.iso -drive file=build/disk.img,format=raw,index=1,media=disk echo grep -E 'PASS|FAIL' test.log if grep -q "All tests passed" test.log; then exit 0; else exit 1; fi else - qemu_with_flags -serial stdio -drive file=build/disk.img,format=raw,index=1,media=disk + qemu_with_flags -serial stdio -cdrom build/melvix.iso -drive file=build/disk.img,format=raw,index=1,media=disk fi } make_debug() { - qemu_with_flags -serial stdio -drive file=build/disk.img,format=raw,index=1,media=disk -s -S + qemu_with_flags -serial stdio -cdrom build/melvix.iso -drive file=build/disk.img,format=raw,index=1,media=disk -s -S } make_disasm() { @@ -251,8 +252,7 @@ make_sync() { echo "$output" | make_append_commands libk libgui libs/libgui echo "$output" | make_append_commands libgui libtxt libs/libtxt echo "$output" | make_append_commands libtxt kernel kernel - echo "$output" | make_append_commands kernel boot boot - echo "$output" | make_append_commands boot apps apps + echo "$output" | make_append_commands kernel apps apps tr tmp mv tmp compile_commands.json } -- cgit v1.2.3