I want to write into a selected memory address in GEM5. Normally on a testboard, I would interrupt the kernel after bootloader/BIOS and directly access the physical address. However, I am unable to figure out how to do the same in GEM5. I tried doing this in FS mode (X86) just before kernel came up. But it didnt work. Any help would be great. Thanks in advance
Asked
Active
Viewed 295 times
1
-
I would re-title this question "Writing into a memory addres in GEM5 before booting the Linux kernel". For ARM, bootloaders are present at `system/arm/aarch64_bootloader/` and `simple_bootloader`, and loaded through `M5_PATH`. There is no obvious x86 analogue though. Try to log the instructions executed to determine what is the first instruction, and see if it is in the kernel or not already. Also try to look for a way to load multiple ELF files, or maybe hack the kernel linker script to make the kernel ELF load that data for you. – Ciro Santilli Sep 05 '18 at 12:28
-
I've also learnt that it is possible to load raw binary to arbitrary memory addresses from the command line, which might also be of interest: https://stackoverflow.com/questions/60993870/how-to-preload-memory-with-given-raw-bytes-in-gem5-from-the-command-line-in-addi/60993871#60993871 – Ciro Santilli Apr 02 '20 at 14:24