From c76ccf2907ab75f6f72b98893a00ef27e9ae4540 Mon Sep 17 00:00:00 2001 From: Liric Mechan Date: Wed, 17 Aug 2022 23:24:32 -0400 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8D=E4=BA=86macOS=E4=B8=8B?= =?UTF-8?q?=E7=9A=84=E5=8A=A0=E9=80=9F=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- run.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) mode change 100644 => 100755 run.sh diff --git a/run.sh b/run.sh old mode 100644 new mode 100755 index ab462b1d..30574d40 --- a/run.sh +++ b/run.sh @@ -9,24 +9,19 @@ IN_DOCKER=0 # 第一个参数如果是--notbuild 那就不构建,直接运行 if [ ! "$1" == "--nobuild" ]; then - if [ "$1" == "--nomake" ]; then - echo "将会跳过make过程直接构建镜像..." - echo "开始构建..." - GENERATE_ISO=1 - elif [ "$1" == "--docker" ]; then + echo "开始构建..." + if [ "$1" == "--docker" ]; then echo "使用docker构建" - echo "开始构建..." sudo bash tools/build_in_docker.sh GENERATE_ISO=0 elif [ "$1" == "--current_in_docker" ]; then echo "运行在docker内" - echo "开始构建..." IN_DOCKER=1 make all -j 16 make clean GENERATE_ISO=1 else - echo "开始构建..." + make all -j 16 make clean GENERATE_ISO=1 @@ -136,6 +131,11 @@ allflags=$(qemu-system-x86_64 -cpu help | awk '/flags/ {y=1; getline}; y {print} # 调试usb的trace qemu_trace_usb=trace:usb_xhci_reset,trace:usb_xhci_run,trace:usb_xhci_stop,trace:usb_xhci_irq_msi,trace:usb_xhci_irq_msix,trace:usb_xhci_port_reset +qemu_accel=kvm +if [ "${OS}" == "Darwin" ]; then + qemu_accel=hvf +fi + if [ $flag_can_run -eq 1 ]; then if [ ${IA32_USE_QEMU} == 0 ]; then bochs -q -f ${bochsrc} -rc ./tools/bochsinit @@ -143,13 +143,13 @@ if [ $flag_can_run -eq 1 ]; then qemu-system-x86_64 -d bin/disk.img -m 512M -smp 2,cores=2,threads=1,sockets=1 \ -boot order=d \ -monitor stdio -d cpu_reset,guest_errors,trace:check_exception,exec,cpu,out_asm,in_asm,${qemu_trace_usb} \ - -s -S -cpu "IvyBridge,+apic,+x2apic,+fpu,check,${allflags}" --enable-kvm -rtc clock=host,base=localtime -serial file:serial_opt.txt \ + -s -S -cpu IvyBridge,apic,x2apic,+fpu,check,${allflags} -rtc clock=host,base=localtime -serial file:serial_opt.txt \ -drive id=disk,file=bin/disk.img,if=none \ -device ahci,id=ahci \ -device ide-hd,drive=disk,bus=ahci.0 \ -usb \ - -device qemu-xhci,id=xhci,p2=8,p3=4 - + -device qemu-xhci,id=xhci,p2=8,p3=4 \ + -machine accel=${qemu_accel} fi else echo "不满足运行条件"