From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-arm@nongnu.org
Cc: Massimiliano Cialdi <cialdi@gmail.com>
Subject: Re: [Qemu-arm] QEMU user mode for cortex M
Date: Fri, 15 Mar 2019 10:56:59 +0000 [thread overview]
Message-ID: <87ftroxv5w.fsf@zen.linaroharston> (raw)
In-Reply-To: <CAFEAcA8xqO=iV9oJWWdPHhhDFRmAoegMpwUZQUszXLwG7zS=Hw@mail.gmail.com>
Peter Maydell <peter.maydell@linaro.org> writes:
> On Thu, 14 Mar 2019 at 22:30, Massimiliano Cialdi <cialdi@gmail.com> wrote:
>>
>> hello,
>> I would like to try some algorithms on cortex M (especially cortex M4). I don't need to emulate the whole machine, I just need the user mode.
>> To test the feasibility, I wrote the trivial "hello world".
>>
>> I can compile it with arm-none-eabi-gcc, but the newlib associated with it does not implement any syscall.
>> So I tried, on ubuntu, with the cross compiler arm-linux-gnueabihf-gcc and its libc6, but the latter is only distributed for cortex A.
>>
>> What do you suggest? Should I recompile the libc6 for cortex M (or do I find it pre-compiled)? Should I implement (and how?) syscalls on newlib?
>>
>> In summary, I would need a step-by-step guide to running Cortex M code on QEMU arm user mode.
>
> User-mode in Cortex-M is a weird thing to do, because what QEMU
> gives you is the A-profile Linux syscalls.
<snip>
> System emulation mode will get you something that actually
> works the way the real hardware does. You can then do
> output either via the UART or via semihosting (you need to
> enable the latter on the commandline).
We've recently added the ability to compile system-mode tests although
we currently only have one test for Cortex-M0 (see
tests/tcg/test-armv6m-undef.s). However if you could write a boot.S for
cortex-m4 with a semihosting __sys_outc and link it with
tests/tcg/minilib then you have a reasonable test harness for building C
binaries (albeit without a proper libc) you can run with the system
emulator.
--
Alex Bennée
next prev parent reply other threads:[~2019-03-15 10:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-14 21:46 [Qemu-arm] QEMU user mode for cortex M Massimiliano Cialdi
2019-03-15 10:04 ` Peter Maydell
2019-03-15 10:56 ` Alex Bennée [this message]
2019-03-15 22:12 ` Massimiliano Cialdi
2019-03-16 12:01 ` Alex Bennée
2019-03-16 14:06 ` Peter Maydell
2019-03-16 20:34 ` Massimiliano Cialdi
2019-03-17 11:10 ` Massimiliano Cialdi
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=87ftroxv5w.fsf@zen.linaroharston \
--to=alex.bennee@linaro.org \
--cc=cialdi@gmail.com \
--cc=qemu-arm@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.