baremetal: working aarch64 svc example adapted from takeharukato

Not yet generalized for usage on multiple files.
This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-02-15 00:00:00 +00:00
parent b13b140499
commit 62d2152f39
3 changed files with 259 additions and 3 deletions

View File

@@ -8967,7 +8967,13 @@ less "$(./getvar --arch aarch64 run_dir)/trace.txt"
Output the trace to stdout instead of a file:
....
./run --arch aarch64 --eval 'm5 exit' --emulator gem5 --trace Exec --trace-stdout
./run \
--arch aarch64 \
--emulator gem5 \
--eval 'm5 exit' \
--trace Exec \
--trace-stdout \
;
....
This would produce a lot of output however, so you will likely not want that when tracing a Linux kernel boot instructions. But it can be very convenient for smaller traces.
@@ -11201,6 +11207,14 @@ output:
Setup a handler for `svc`, do an `svc`, and observe that the handler got called and returned:
....
./run --arch aarch64 --baremetal arch/aarch64/svc_asm
....
Source: link:baremetal/arch/aarch64/svc_asm.S[]
TODO: factor out the above, and make it also work on C:
....
./run --arch aarch64 --baremetal arch/aarch64/svc
....
@@ -11261,6 +11275,7 @@ This reset value is defined `UNKNOWN` by <<armarm8>> D10.2.116 "VBAR_EL1, Vector
Bibliography:
* https://github.com/torvalds/linux/blob/v4.20/arch/arm64/kernel/entry.S#L430 this is where the kernel defines the vector table
* https://github.com/dwelch67/qemu_arm_samples/tree/07162ba087111e0df3f44fd857d1b4e82458a56d/swi01
* https://github.com/NienfengYao/armv8-bare-metal/blob/572c6f95880e70aa92fe9fed4b8ad7697082a764/vector.S#L168
* https://stackoverflow.com/questions/51094092/how-to-make-timer-irq-work-on-qemu-machine-virt-cpu-cortex-a57