Hello, Peter Maydell Thank you so much again! I'll try your suggestions. Thanks! Chan Kim
> -----Original Message----- > From: Peter Maydell <peter.mayd...@linaro.org> > Sent: Tuesday, January 26, 2021 6:47 PM > To: Chan Kim <c...@etri.re.kr> > Cc: qemu-discuss <qemu-discuss@nongnu.org> > Subject: Re: qemu hello world prints nothing.. > > On Tue, 26 Jan 2021 at 07:02, <c...@etri.re.kr> wrote: > > I wish someone could help me here. Running a simple program on qemu is > not easy for me. > > > > I tried to run baremetal hello world program and found this web page. > > > > (https://balau82.wordpress.com/2010/02/28/hello-world-for-bare-metal-a > > rm-using-qemu/) > > > > This page is somewhat so old, but I decided to give it a try. > [details of changes for aarch64 skipped] > > When I execute > > > > “qemu-system-aarch64 -M virt -cpu cortex-a57 -kernel test.bin -nographic” > > > > nothing comes out. > > > > What can be wrong? > > You tried to run a bare-metal program, and it isn't built correctly, so it > has crashed. "Nothing happens" is the most common visible effect of a bug > in initial startup of bare-metal programs. It's not specific to QEMU -- if > you try to do bare metal development on real hardware you will see a lot > of "nothing happened" there too. > Now you have to debug it :-) > > This is a good point to look into how to use gdb and connect it to the > QEMU debug stub so that you can single step the initial startup of your > program and see where it does something you don't expect it to. > > As a more specific suggestion: the linker script in the tutorial is > written for the 32-bit 'versatilepb' board, which has RAM starting at > address 0. You're running on the aarch64 'virt' board, where address 0 has > flash (ROM) memory, and RAM starts at 0x4000_0000. The UART also is not at > the same address in 'virt' > as it is in 'versatilepb'. You will need to adjust your linker script and > the definition of UART0DR to work on the 'virt' board. > > thanks > -- PMM