Skip to contentSkip to conversation

Question about target port

Qemu-devel 郭智偉 4 participants 4 messages Oct 5, 2006 – Oct 16, 2006

lore
Share & tools
lore

郭智偉

author
#0 lore raw

How can I change target CPU to Atmel's AVR and don't care about host. i.e:host CPU is X86(PC),target CPU is Atmel's AVR.
Can it implementation?If it can,where can I find any discussion about this question?
tks!

#1 lore raw
Quoted 2 lines

How can I change target CPU to Atmel's AVR and don't care about host. i.e:host CPU is X86(PC),target CPU is Atmel's AVR.

Hi
Atmel AVR is a different processor from the ones that QEMU emulates.
You would need to implement an entire new emulation inside QEMU; that is a LOT of work in C programming. It is also an 8-bit processor, while all the ones that qemu currently emulates are 32-bit, so you may need to restructure the code as well to support 8-bit.

M

#2 lore raw
Quoted 9 lines · Martin Guy
Quoted 2 lines

How can I change target CPU to Atmel's AVR and don't care about host. i.e:host CPU is X86(PC),target CPU is Atmel's AVR.

Hi
Atmel AVR is a different processor from the ones that QEMU emulates.
You would need to implement an entire new emulation inside QEMU; that is a LOT of work in C programming. It is also an 8-bit processor, while all the ones that qemu currently emulates are 32-bit, so you may need to restructure the code as well to support 8-bit.

I got the impression the AVR was a fairly straightforward CPU. I wouldn't expect the 8-bitness to be a particular problem. x86 has lots of crufty 16 and 8-bit corners :-) It might not be amazingly efficient, but real AVR silicon is really slow anyway.

IIRC AVR has separate code and data address spaces. However as these are both <32-bit you can probably fake this by implementing them as offsets within a single 32-bit address space.

That said, porting qemu to a new cpu is a fair amount of work, especially if you're not familiar with qemu internals. I recommend looking back in the list archives to CVS for where the mips and SH ports were added. That will give you some indication of the magnitude of the changes required.

Paul

#3 lore raw
In reply to Martin Guy

In message: <[email protected]>
"Martin Guy" <[email protected]> writes:
: > How can I change target CPU to Atmel's AVR and don't care about host. : > i.e:host CPU is X86(PC),target CPU is Atmel's AVR.
:
: Hi
: Atmel AVR is a different processor from the ones that QEMU emulates.
: You would need to implement an entire new emulation inside QEMU; that : is a LOT of work in C programming. It is also an 8-bit processor, : while all the ones that qemu currently emulates are 32-bit, so you may : need to restructure the code as well to support 8-bit.

There's a new AVR32 as well, which is a 32-bit beast.

Warner