diff --git a/kernel/common/glib.h b/kernel/common/glib.h index cb458d98..4dec60a6 100644 --- a/kernel/common/glib.h +++ b/kernel/common/glib.h @@ -4,8 +4,6 @@ // #pragma once -#ifndef GLIB_H -#define GLIB_H //引入对bool类型的支持 #include @@ -102,4 +100,3 @@ static inline int strlen(char *s) return __res; } -#endif \ No newline at end of file diff --git a/run_in_bochs.sh b/run_in_bochs.sh index 9ccb5e1e..c9362ba0 100644 --- a/run_in_bochs.sh +++ b/run_in_bochs.sh @@ -13,18 +13,19 @@ if [ ! "$1" == "--nobuild" ]; then fi # ==============检查文件是否齐全================ -if [ ! -x "bin/bootloader/boot.bin" ]; then - echo "bin/bootloader/boot.bin 不存在!" + +bins[0]=bin/bootloader/boot.bin +bins[1]=bin/bootloader/loader.bin +bins[2]=bin/boot.img +bins[3]=bin/kernel/kernel.bin + +for file in ${bins[*]};do +if [ ! -x $file ]; then + echo "$file 不存在!" exit -fi -if [ ! -x "bin/bootloader/loader.bin" ]; then - echo "bin/bootloader/loader.bin 不存在!" - exit -fi -if [ ! -x "bin/boot.img" ]; then - echo "bin/boot.img 不存在!" - exit -fi + fi +done + # ===============文件检查完毕=================== diff --git a/run_in_qemu.sh b/run_in_qemu.sh index 3d81712e..6b2f1ef7 100644 --- a/run_in_qemu.sh +++ b/run_in_qemu.sh @@ -13,18 +13,17 @@ if [ ! "$1" == "--nobuild" ]; then fi # ==============检查文件是否齐全================ -if [ ! -x "bin/bootloader/boot.bin" ]; then - echo "bin/bootloader/boot.bin 不存在!" +bins[0]=bin/bootloader/boot.bin +bins[1]=bin/bootloader/loader.bin +bins[2]=bin/boot.img +bins[3]=bin/kernel/kernel.bin + +for file in ${bins[*]};do +if [ ! -x $file ]; then + echo "$file 不存在!" exit -fi -if [ ! -x "bin/bootloader/loader.bin" ]; then - echo "bin/bootloader/loader.bin 不存在!" - exit -fi -if [ ! -x "bin/boot.img" ]; then - echo "bin/boot.img 不存在!" - exit -fi + fi +done # ===============文件检查完毕===================