All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christopher Covington <cov@codeaurora.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] AArch64 ELF File Loading
Date: Fri, 25 Jul 2014 11:05:06 -0400	[thread overview]
Message-ID: <53D27222.6030505@codeaurora.org> (raw)
In-Reply-To: <CAFEAcA9s5RQHCEcNxwtJ37M-=8O2jJdgOTaqeoj2a8pfnnrNGw@mail.gmail.com>

Hi Peter,

On 07/25/2014 10:41 AM, Peter Maydell wrote:
> On 25 July 2014 15:35, Christopher Covington <cov@codeaurora.org> wrote:
>> qemu-system-aarch64 -nodefaults -nographic -monitor none -M virt \
>>   -cpu cortex-a57 -m 3G -semihosting -kernel hello
>>
>> qemu: fatal: Trying to execute code outside RAM or ROM at 0x0000000000000000
> 
> This means your code took an exception (and there's
> no RAM at the low address where the vector table is
> by default). Try "-d in_asm,exec,int" to get a better idea
> of what's being executed.

qemu-system-aarch64 -nodefaults -nographic -monitor none \
  -M virt -cpu cortex-a57 -m 3G -semihosting -kernel hello \
  -d in_asm,exec,int

qemu: fatal: Trying to execute code outside RAM or ROM at 0x0000000000000000

PC=0000000000000000  SP=0000000000000000
X00=0000000000000000 X01=0000000000000000 X02=0000000000000000 ...

The binary runs fine on at least one other simulator.

> Also, where do you expect the output from that printf
> to be going? Does your gcc/bare metal libc write to
> the UART? How does it know what address the UART is?
> If it's expecting to do semihosting for output, then you're
> running into the fact that we don't implement semihosting
> for AArch64 yet.

I have local patches adding semihosting for AArch64. I hope eventually be able
to share them and other changes, but the approvals will likely take a while
longer. Here is an example that doesn't use semihosting.

wget
http://releases.linaro.org/14.06/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.9-2014.06-02_linux.tar.xz
tar xf gcc-linaro-aarch64-none-elf-4.9-2014.06-02_linux.tar.xz
echo '.global _start
_start:
  mrs x0, midr_el1
  b _start' > hello.S
gcc-linaro-aarch64-none-elf-4.9-2014.06-02_linux/bin/aarch64-none-elf-gcc \
  -nostdlib -Ttext=0x40000000 hello.S -o hello
qemu-system-aarch64 -nodefaults -nographic -monitor none -M virt \
  -cpu cortex-a57 -m 3G -semihosting -kernel hello -d in_asm,exec,int

qemu: fatal: Trying to execute code outside RAM or ROM at 0x0000000000000000

Thanks,
Christopher

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by the Linux Foundation.

  reply	other threads:[~2014-07-25 15:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-25 14:01 [Qemu-devel] AArch64 ELF File Loading Christopher Covington
2014-07-25 14:07 ` Peter Maydell
2014-07-25 14:35   ` Christopher Covington
2014-07-25 14:41     ` Peter Maydell
2014-07-25 15:05       ` Christopher Covington [this message]
2014-07-25 15:17         ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53D27222.6030505@codeaurora.org \
    --to=cov@codeaurora.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.