[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Role of qemu-arm
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: Role of qemu-arm |
Date: |
Mon, 22 Jun 2020 11:29:42 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
Hi Vincent,
On 6/22/20 10:57 AM, Alex Bennée wrote:
>
> vincent Dupaquis <v.dupaquis@trusted-objects.com> writes:
>
>> Hello,
>>
>> I am using qemu for doing simulations of code, and currently find
>> qemu-system-arm convienient.
>>
>> But, I cannot understand how to use qemu-arm. In fact, what I am
>> searching for is a way of simulating only the ARM core, not any
>> peripherals.
You can start a machine with only a CPU core using:
$ qemu-system-arm -M none -cpu cortex-r5
The core will start running at full speed looping taking
exception because there is no memory on its bus to fetch
the code to run:
$ qemu-system-arm -M none -cpu cortex-r5 -d mmu,int
PMSA MPU lookup for execute at 0x00000000 mmu_idx 33 -> Hit (prot rwx)
Taking exception 3 [Prefetch Abort]
...from EL1 to EL1
...with ESR 0x21/0x8600003f
...with IFSR 0x8 IFAR 0x0
Taking exception 3 [Prefetch Abort]
...from EL1 to EL1
...with ESR 0x21/0x8600003f
...with IFSR 0x8 IFAR 0xc
You can use the '-m <size_mb>' option to add memory (mapped
at the 0x00000000 address).
You can use the '-S' flag to start QEMU with the cores not
running.
Example of use is via gdbstub, filling some instructions in
memory, set $sp and $pc and singlestep.
You can also use the 'loader' device to load a file into
memory (it can understand ELF/hex format, see
docs/generic-loader.txt).
Finally I also recommend you the -semihosting option.
For example you can run an RTOS Fibonacci test displaying
progress via semihosting calls, by using something like
(mapping 2MB of DRAM at 0x0):
$ qemu-system-arm -M none \
-m 2 \
-cpu cortex-r5 -d in_asm \
-semihosting-config enable=on \
-device loader,file=fibonacci.elf
>
> There are two modes:
>
> - system emulation (CPU + board and peripherals)
> - linux-user (CPU but with a Linux syscall interface)
>
>> I can work with qemu-system-arm, and could not find a way
>> to use qemu-arm.
>
> If you are installing via your distros package manager you probably want
> a package called qemu-user. You can build the only the user-mode
> packages by issuing --disable-system to the configure script.
>
> The closest thing to being a "pure" just the CPU is probably a
> standalone usermode binary that uses semihosting calls rather than a
> libc/syscall interface.
>
>>
>> Would anyone have any pointers to a documentation or a tutorial
>> using this tool ?
>>
>> Best regards,
>>
>> Vincent.
>
>
- [PATCH] target/arm: Remove unnecessary gen_io_end() calls, Peter Maydell, 2020/06/19
- Re: [PATCH] target/arm: Remove unnecessary gen_io_end() calls, Alex Bennée, 2020/06/19
- Re: [PATCH] target/arm: Remove unnecessary gen_io_end() calls, no-reply, 2020/06/19
- Re: [PATCH] target/arm: Remove unnecessary gen_io_end() calls, Richard Henderson, 2020/06/19
- Re: [PATCH] target/arm: Remove unnecessary gen_io_end() calls, Pavel Dovgalyuk, 2020/06/22
- Role of qemu-arm, vincent Dupaquis, 2020/06/22
- Re: Role of qemu-arm, Alex Bennée, 2020/06/22
- Re: Role of qemu-arm,
Philippe Mathieu-Daudé <=
- Re: Role of qemu-arm, vincent Dupaquis, 2020/06/22
- Re: Role of qemu-arm, Peter Maydell, 2020/06/22
- Re: Role of qemu-arm, vincent Dupaquis, 2020/06/22
- Re: Role of qemu-arm, Peter Maydell, 2020/06/22
- Re: Role of qemu-arm, vincent Dupaquis, 2020/06/24
- Re: Role of qemu-arm, Alex Bennée, 2020/06/24
- Re: Role of qemu-arm, vincent Dupaquis, 2020/06/25
- Re: Role of qemu-arm, Peter Maydell, 2020/06/25
- Re: Role of qemu-arm, Alex Bennée, 2020/06/25