From e8df6ec6286d6ab2bcaaba11ffaca8c55d306a75 Mon Sep 17 00:00:00 2001 From: Nigel Date: Mon, 11 Sep 2023 23:21:43 +0200 Subject: [PATCH] Updating Build scripts --- kernel/Makefile | 4 ++-- run.sh | 21 +++++++++++---------- scripts/run_qemu.sh | 8 +++++++- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/kernel/Makefile b/kernel/Makefile index 0c8f291..8fdb8ad 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -39,7 +39,7 @@ OFILES = $(OBJ_DIR)/boot.o \ OBJ_LINK_LIST = $(CRTI_OBJ) $(CRTBEGIN_OBJ) $(OFILES) $(CRTEND_OBJ) $(CRTN_OBJ) INTERNAL_OBJS = $(CRTI_OBJ) $(OFILES) $(CRTN_OBJ) -all: build +all: clean build clean: rm $(OBJ_DIR)/* -r @@ -49,7 +49,7 @@ build: $(OBJ_LINK_LIST) $(CPP) -T linker.ld -o $(BUILD_DIR)/myos.bin -ffreestanding -ggdb -Og -nostdlib $(OBJ_LINK_LIST) -lgcc -L ../build/CoreLib -lCoreLib # C++ definition -> Object files -$(OBJ_DIR)/kernel.o: +$(OBJ_DIR)/kernel.o: kernel.cpp $(CPP) -c kernel.cpp -o $(OBJ_DIR)/kernel.o $(CFLAGS) -fno-exceptions -fno-rtti $(OBJ_DIR)/kterm.o: diff --git a/run.sh b/run.sh index 99d34c5..6013267 100755 --- a/run.sh +++ b/run.sh @@ -3,23 +3,24 @@ PROC=$$ # Build the Corelib static library (cd CoreLib -if ! make; then - echo "Build failed!" +if ! make 2> warnings.log 1> /dev/null ; then + echo "Build Corelib failed!" kill -10 $PROC fi) # Build the kernel image (cd kernel -make clean -make -if ! make; then - echo "Build failed!" +# make clean +if ! make 2> warnings.log 1> /dev/null ; then + echo "Build kernel failed!" kill -10 $PROC fi) ./scripts/update_harddrive.sh - - -./scripts/run_qemu.sh - +args=""; +if [[ $1 == "-d" ]] +then + args="debug" +fi +./scripts/run_qemu.sh $args diff --git a/scripts/run_qemu.sh b/scripts/run_qemu.sh index 072a4bd..f728be6 100755 --- a/scripts/run_qemu.sh +++ b/scripts/run_qemu.sh @@ -1,7 +1,13 @@ #!/bin/bash +if [[ $1 == "debug" ]] +then + qemu-system-i386 -boot d -drive format=raw,file=disk.img -serial stdio -vga std -display gtk -m 2G -cpu core2duo -d int -no-shutdown -no-reboot +else + qemu-system-i386 -boot d -drive format=raw,file=disk.img -serial stdio -vga std -display gtk -m 2G -cpu core2duo +fi # Run from harddisk -qemu-system-i386 -boot d -drive format=raw,file=disk.img -serial stdio -vga std -display gtk -m 2G -cpu core2duo +#qemu-system-i386 -boot d -drive format=raw,file=disk.img -serial stdio -vga std -display gtk -m 2G -cpu core2duo -d int -no-shutdown -no-reboot # Run disk version # qemu-system-i386 -cdrom barinkOS.iso -serial stdio -vga std -display gtk -m 2G -cpu core2duo -s -d int -no-shutdown -no-reboot