Use QEMU ACPI shutdown to avoid bad exit code.

parent 1a9fb94d
Pipeline #59981452 canceled with stages
in 34 minutes and 44 seconds
image: debian:unstable
image: giomasce/testenv
variables:
GIT_STRATEGY: clone
......@@ -8,8 +8,8 @@ variables:
before_script:
- cat /proc/cpuinfo
- cat /proc/meminfo
- apt-get update -qq
- apt-get install -y -qq eatmydata
- apt-get update
- apt-get install -y --no-upgrade eatmydata
stages:
- build
......@@ -18,7 +18,7 @@ stages:
build:
stage: build
script:
- eatmydata apt-get install -y -qq make nasm python3 qemu-utils
- eatmydata apt-get install -y --no-upgrade make nasm python3 qemu-utils
- bash test/build_all_variants.sh
- ls -l build/asmg.x86.exe build/asmg_dbg.x86.exe
artifacts:
......@@ -28,18 +28,18 @@ build:
tests:
stage: test
script:
- eatmydata apt-get install -y -qq python3 qemu-system-x86
- "(echo -n | qemu-system-i386 -hda artifacts/tests/boot_asmg.x86.qcow2 -serial stdio -device isa-debug-exit -display none -m 256M -enable-kvm -cpu host || true) | ./test/decode_tests.py"
- eatmydata apt-get install -y --no-upgrade python3 qemu-system-x86
- "qemu-system-i386 -hda artifacts/tests/boot_asmg.x86.qcow2 -serial file:/dev/stdout -display none -m 256M -enable-kvm | ./test/decode_tests.py"
mm0:
stage: test
script:
- eatmydata apt-get install -y -qq python3 qemu-system-x86
- "(echo -n | qemu-system-i386 -hda artifacts/mm0/boot_asmg.x86.qcow2 -serial stdio -device isa-debug-exit -display none -m 256M -enable-kvm -cpu host || true) | ./test/decode_tests.py just_malloc"
- eatmydata apt-get install -y --no-upgrade python3 qemu-system-x86
- "qemu-system-i386 -hda artifacts/mm0/boot_asmg.x86.qcow2 -serial file:/dev/stdout -display none -m 256M -enable-kvm | ./test/decode_tests.py just_malloc"
tinycc:
stage: test
script:
- eatmydata apt-get install -y -qq python3 qemu-system-x86
- eatmydata apt-get install -y --no-upgrade python3 qemu-system-x86
- cd http && python3 -m http.server 8080 &
- "(echo -n | qemu-system-i386 -hda artifacts/tinycc/boot_asmg.x86.qcow2 -serial stdio -device isa-debug-exit -display none -m 256M -enable-kvm -cpu host || true) | ./test/decode_tests.py just_malloc"
- "qemu-system-i386 -hda artifacts/tinycc/boot_asmg.x86.qcow2 -serial file:/dev/stdout -display none -m 256M -enable-kvm | ./test/decode_tests.py just_malloc"
......@@ -17,10 +17,12 @@
section .text
;; Try to shutdown a qemu host invoked with "-device isa-debug-exit"
qemu_shutdown:
mov edx, 0x501
out dx, al
;; mov edx, 0x501 ; QEMU debug shutdown (requires "-device isa-debug-exit")
;; out dx, al
mov edx, 0x604 ; QEMU ACPI shutdown (see https://wiki.osdev.org/Shutdown)
mov eax, 0x2000
out dx, ax
ret
shutdown:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment