0

I am using Rust to code in a [no_std] environment, targeting ARM's aarch64-unknown-none. When I enable -semihosting as stipulated in the qemu-system-aarch64 command options below, I never see any display on my host computer qemu or terminal.

Is semihosting option known to work for aarch64-unknown-none known to work? If yes, can someone please share experience on the options, code snippet that works?

The qemu-system-aarch64 command to start up the built kernel binary is: qemu-system-aarch64 -machine virt -cpu cortex-a57 -m 256M -semihosting -semihosting-config enable=on,target=native,chardev=semi0 -chardev stdio,id=semi0,signal=off -kernel kernel.bin

1 Answers1

1

You don't say what QEMU version you're using, but yes, semihosting works on aarch64. If you want an independent check, there is a set of tests at https://git.linaro.org/people/pmaydell/semihosting-tests.git/ which includes A64 tests.

My guess is that something else is going wrong in your program and it's crashing before it gets to the point of sending any output to the semihosting terminal. Using QEMU's debug stub or '-d' logging options is a good way to find out what a bare-metal program is doing wrong.

PS: if you just want to send semihosting to stdout then '-semihosting' is sufficient, you don't need to mess around with a chardev just for that.

Peter Maydell
  • 9,707
  • 1
  • 19
  • 25