diff --git a/.gitignore b/.gitignore index 9d986ba..d3ebcdf 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ gitignore* # Specific files. /9p /README.html +/trace-[0-9]* # GEM5 /m5out diff --git a/README.adoc b/README.adoc index 71c41ee..17a1862 100644 --- a/README.adoc +++ b/README.adoc @@ -3240,6 +3240,22 @@ Does not work for subdirectories, gem5 crashes: m5 writefile myfileguest mydirhost/myfilehost .... +==== m5 readfile + +https://stackoverflow.com/questions/49516399/how-to-use-m5-readfile-and-m5-execfile-in-gem5/49538051#49538051 + +Host: + +.... +date >m5out/myreadfile +.... + +Guest: + +.... +m5 readfile +.... + === gem5 limitations * networking not working. We currently just disable it from `inittab` by default to prevent waiting at startup diff --git a/run b/run index 8cbe7c0..412788d 100755 --- a/run +++ b/run @@ -1,5 +1,5 @@ #!/usr/bin/env bash -set -e +set -eu . common # CLI handling. @@ -121,7 +121,8 @@ if "$gem5"; then else gem5_arch=ARM fi - gem5_cpt_dir="./m5out/cpts/${arch}" + m5out_dir="${root_dir}/m5out" + gem5_cpt_dir="${m5out_dir}/cpts/${arch}" mkdir -p "$gem5_cpt_dir" gem5_common="\ M5_PATH='${build_dir}/system' \ @@ -134,6 +135,7 @@ ${gem5opts} \ --kernel='${out_dir}/build/linux-custom/vmlinux' \ --mem-size=${memory} \ --num-cpus='${cpus}' \ +--script='${m5out_dir}/myreadfile' \ " if [ "$arch" = x86_64 ]; then if "$kvm"; then