[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: What is the purpose for "none" machine?
From: |
Thomas Huth |
Subject: |
Re: What is the purpose for "none" machine? |
Date: |
Mon, 23 Jan 2023 21:08:23 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 |
On 23/01/2023 19.07, Matwey V. Kornilov wrote:
пн, 23 янв. 2023 г. в 21:02, Peter Maydell <peter.maydell@linaro.org>:
On Mon, 23 Jan 2023 at 17:36, Matwey V. Kornilov
<matwey.kornilov@gmail.com> wrote:
I am playing with qemu-system-avr currently.
I see that there is an "empty machine" called "none" in
qemu-system-avr -M help
list.
Is it a real thing? I am failed to run any code with "none" machine.
It is mostly for the benefit of management layer code (eg libvirt)
that wants to probe capabilities of QEMU[*], and secondarily used
in some of QEMU's own test suite. The 'none' machine has no CPU,
no devices and no RAM, which is why you can't run any code on it.
Thanks for the explanation. Is there a way to manually add CPU, RAM
and other devices in the command line if 'none' is used?
It's doable on some targets, e.g. m68k. avr seems to be working, too:
- You can specify a CPU with the "-cpu" command line option
(use "-cpu help" for a list)
- You can specify a RAM region with the "-m" command line option
(it will be created at address 0)
- You can load some code with the "loader" device
(see "-device loader,help" for information how to use it)
For example:
wget
https://github.com/seharris/qemu-avr-tests/raw/master/free-rtos/Demo/AVR_ATMega2560_GCC/demo.elf
$ ./qemu-system-avr -M none -cpu avr6-avr-cpu -m 512 -d in_asm \
-device loader,file=demo.elf 2>&1 | head -n 15
----------------
IN:
0x00000000: JMP 0x110
----------------
IN:
0x00000110: EOR r1, r1
0x00000112: OUT $63, r1
0x00000114: LDI r28, 255
0x00000116: LDI r29, 33
0x00000118: OUT $62, r29
0x0000011a: OUT $61, r28
0x0000011c: LDI r16, 0
0x0000011e: OUT $60, r16
0x00000120: LDI r17, 2
... of course you might also want to attach an avr GDB to QEMU to interact
with the code, but I don't have such a GDB here right now, so no way to
check whether that's working here or not.
HTH,
Thomas