From b46b152fd868000809a2d909a420dd2f2355a46a Mon Sep 17 00:00:00 2001 From: Noah Krim Date: Tue, 3 Sep 2024 01:58:09 -0700 Subject: [PATCH] resources: Move to gem5 bridge devices in x86 disk files --- src/x86-ubuntu/files/after_boot.sh | 10 +++++----- src/x86-ubuntu/files/exit.sh | 2 +- src/x86-ubuntu/files/gem5_init.sh | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/x86-ubuntu/files/after_boot.sh b/src/x86-ubuntu/files/after_boot.sh index c503c0f1f..04126264c 100755 --- a/src/x86-ubuntu/files/after_boot.sh +++ b/src/x86-ubuntu/files/after_boot.sh @@ -14,7 +14,7 @@ # gem5-bridge exit signifying that after_boot.sh is running printf "In after_boot.sh...\n" -gem5-bridge exit # TODO: Make this a specialized event. +echo 0 > /dev/gem5/exit # TODO: Make this a specialized event. # Read /proc/cmdline and parse options @@ -28,19 +28,19 @@ fi printf "Interactive mode: $interactive\n" if [[ $interactive == true ]]; then - printf "Interactive mode enabled, dropping to shell." + printf "Interactive mode enabled, dropping to shell.\n" /bin/bash else # Try to read the file from the host when running with gem5 if ! [ -z $IGNORE_M5 ]; then printf "Starting gem5 init... trying to read run script file via readfile.\n" - if ! gem5-bridge readfile > /tmp/script; then + if ! cat /dev/gem5/readfile > /tmp/script; then printf "Failed to run gem5-bridge readfile, exiting!\n" rm -f /tmp/script # If we can't read the script exit the simulation. If we cannot exit the # simulation, this probably means that we are running in QEMU. So, ignore # future calls to gem5-bridge. - if ! gem5-bridge exit; then + if ! echo 0 > /dev/gem5/exit; then # Useful for booting the disk image in (e.g.,) qemu for debugging printf "gem5-bridge exit failed, dropping to shell.\n" IGNORE_M5=1 /bin/bash @@ -51,7 +51,7 @@ else /tmp/script printf "Done running script from gem5-bridge, exiting.\n" rm -f /tmp/script - gem5-bridge exit + echo 0 > /dev/gem5/exit fi fi fi diff --git a/src/x86-ubuntu/files/exit.sh b/src/x86-ubuntu/files/exit.sh index 4b147e01f..c0447857c 100755 --- a/src/x86-ubuntu/files/exit.sh +++ b/src/x86-ubuntu/files/exit.sh @@ -3,4 +3,4 @@ # Copyright (c) 2020 The Regents of the University of California. # SPDX-License-Identifier: BSD 3-Clause -m5 exit +echo 0 > /dev/gem5/exit diff --git a/src/x86-ubuntu/files/gem5_init.sh b/src/x86-ubuntu/files/gem5_init.sh index 9e4d47c14..2993ac1fd 100755 --- a/src/x86-ubuntu/files/gem5_init.sh +++ b/src/x86-ubuntu/files/gem5_init.sh @@ -22,7 +22,7 @@ modprobe gem5_bridge || insmod /lib/modules/$(uname -r)/gem5/gem5_bridge.ko # This will cause the simulation to exit. Note that this will # cause qemu to fail. printf "Kernel booted, In gem5 init...\n" -gem5-bridge exit # TODO: Make this a specialized event. +echo 0 > /dev/gem5/exit # TODO: Make this a specialized event. if [[ $cmdline == *"no_systemd"* ]]; then no_systemd=true