[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-discuss] QEMU NIOS2 "Hello world"

From: Peter Maydell
Subject: Re: [Qemu-discuss] QEMU NIOS2 "Hello world"
Date: Tue, 20 Nov 2018 18:21:29 +0000

On 20 November 2018 at 18:11, Zeeshan Hayat <address@hidden> wrote:
> Hi,
> I am trying to run a simple program by running,
> qemu-system-nios2 -nographic -kernel a.out
> Where a.out is the binary file of hello world program.
> The terminal just hangs by running this. Is there a way to print the "hello 
> world" in the same terminal as QEMU.

Your command line should direct the output from a serial
port to the terminal. If your guest program is hanging
without printing anything I would start by trying to
debug what it is doing -- it's probable that it is
crashing before it gets to sending anything to the
serial port. For instance, if the binary has not
been compiled for the correct target machine model or
has been compiled to load somewhere there is no RAM
you can see this sort of behaviour.

Using the QEMU debug stub (pass QEMU the '-s' and '-S'
options and then connect a nios2-aware gdb to it on
port 1234) is probably a good place to start.

If your binary is actually a Linux userspace binary
(ie not a standalone image for running on a bare-metal
board), then the problem is that you're trying to run it
with the wrong QEMU executable. qemu-system-nios2 is
for system images, and qemu-nios2 is for single Linux

-- PMM

reply via email to

[Prev in Thread] Current Thread [Next in Thread]