riscvarchive / riscv-qemu

QEMU with RISC-V (RV64G, RV32G) Emulation Support
387 stars 154 forks source link

Why is '-nographic' required to use qemu ? #138

Closed vsiles closed 6 years ago

vsiles commented 6 years ago

Hi ! I'm testing bare metal development using qemu and riscv, and I successfully tested the freedom-e-sdk from sifive:

qemu-system-riscv32 -machine sifive_e -kernel /tmp/freedom-e-sdk/software/hello/hello -nographic
core freq at 11597503 Hz
hello world!

Progam has exited with code:0x00000000
# I have to get the qemu monitor using ctrl-a c + quit to exit

However if I run the exact same command without the -nographic flag, I don't get any output, nor can I go to qemu monitor with ctrl-a c. I can only kill my command using ctrl c.

Am I missing something ?

My current revision is

$ git log -1
commit 4d37030aa03e07ae927174c8fce0227648552e51
Author: Michael Clark <mjc@sifive.com>
Date:   Tue Apr 24 10:12:27 2018 +1200
alistair23 commented 6 years ago

Hey Vincent,

You need to tell QEMU where the console output should go. To do this you can use the -serial options. From memory -nographic will automatically imply them, which is why it doesn't work without -nographic.

There really isn't any reason to remove -nographic for an embedded board though.

vsiles commented 6 years ago

Oh ok, I thought -stdio serial was the default. Thank you Alistair for the info !