qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Support for new target emulator
@ 2009-10-23 10:50 Boyapati, Anitha
  2009-10-23 11:03 ` Alexander Graf
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Boyapati, Anitha @ 2009-10-23 10:50 UTC (permalink / raw)
  To: qemu-devel


Hello,

We have a proposal to add support for AVR32 target emulation in Qemu. So far, we are able to build qemu from sources on windows using Mingw.

Besides looking at sources for other targets in qemu tar ball, I have gone through docs for information on how to start adding support for a new target. I will appreciate if someone can give additional pointers on this. Also, kindly let me know the rough estimate of adding basic support to a new target like AVR32.

There are some threads in Qemu user forums regarding the same. However, link for Qemu user forums is currently reporting a lost connection to mysql server (for the past 4 days?). I did a basic search on Qemu developer mailing list archives and I could not find a relevant thread yet.

Thanks
Anitha

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Support for new target emulator
  2009-10-23 10:50 [Qemu-devel] Support for new target emulator Boyapati, Anitha
@ 2009-10-23 11:03 ` Alexander Graf
  2009-10-23 11:18   ` Christoph Egger
  2009-10-23 12:20   ` Boyapati, Anitha
  2009-10-23 11:09 ` Pablo Virolainen
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 14+ messages in thread
From: Alexander Graf @ 2009-10-23 11:03 UTC (permalink / raw)
  To: Boyapati, Anitha; +Cc: qemu-devel


On 23.10.2009, at 12:50, Boyapati, Anitha wrote:

>
> Hello,
>
> We have a proposal to add support for AVR32 target emulation in  
> Qemu. So far, we are able to build qemu from sources on windows  
> using Mingw.

I would suggest you try and do this on Linux first. You'll see why  
below.

> Besides looking at sources for other targets in qemu tar ball, I  
> have gone through docs for information on how to start adding  
> support for a new target. I will appreciate if someone can give  
> additional pointers on this. Also, kindly let me know the rough  
> estimate of adding basic support to a new target like AVR32.

Luckily Uli just added support for s390x, so you can take a look at  
his patchset and see what needs to be done.

> There are some threads in Qemu user forums regarding the same.  
> However, link for Qemu user forums is currently reporting a lost  
> connection to mysql server (for the past 4 days?). I did a basic  
> search on Qemu developer mailing list archives and I could not find  
> a relevant thread yet.

I don't know about the user forum, but you should really take a look  
at his patchset.

The reason you should try to do things on Linux is that it's a lot  
easier to implement a user-mode target than a system emulation target.  
So if I were you, I'd start off by implementing an AVR32 Linux  
userspace target. Apart from the syscall translation that should be  
almost completely a subset of the system emulation.

Once you have found your user mode emulation to work, you can start  
implementing the softmmu and privileged opcodes. Also, you'll need  
some sort of "machine" you're running on then. So if I were you again,  
I'd implement a typical AVR32 developer board emulation.

It's great to see someone from Atmel actually taking on the challenge!  
I'd love to see AVR32 support in Qemu. It's FWIW the only completely  
missing major target.

Alex

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Support for new target emulator
  2009-10-23 10:50 [Qemu-devel] Support for new target emulator Boyapati, Anitha
  2009-10-23 11:03 ` Alexander Graf
@ 2009-10-23 11:09 ` Pablo Virolainen
  2009-10-27 16:03 ` Rabin Vincent
  2009-10-28 17:02 ` Stefan Weil
  3 siblings, 0 replies; 14+ messages in thread
From: Pablo Virolainen @ 2009-10-23 11:09 UTC (permalink / raw)
  Cc: qemu-devel

Boyapati, Anitha kirjoitti:
> Hello,
> 
> We have a proposal to add support for AVR32 target emulation in Qemu. So far, we are able to build qemu from sources on windows using Mingw.
> 
> Besides looking at sources for other targets in qemu tar ball, I have gone through docs for information on how to start adding support for a new target. I will appreciate if someone can give additional pointers on this. Also, kindly let me know the rough estimate of adding basic support to a new target like AVR32.
> 
> There are some threads in Qemu user forums regarding the same. However, link for Qemu user forums is currently reporting a lost connection to mysql server (for the past 4 days?). I did a basic search on Qemu developer mailing list archives and I could not find a relevant thread yet.

The forums are up. (for some reason the database didn't come up 
automatically after reboot)

Pablo

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Support for new target emulator
  2009-10-23 11:03 ` Alexander Graf
@ 2009-10-23 11:18   ` Christoph Egger
  2009-10-23 11:19     ` Alexander Graf
  2009-10-23 11:44     ` Laurent Desnogues
  2009-10-23 12:20   ` Boyapati, Anitha
  1 sibling, 2 replies; 14+ messages in thread
From: Christoph Egger @ 2009-10-23 11:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexander Graf, Boyapati, Anitha

On Friday 23 October 2009 13:03:54 Alexander Graf wrote:
> On 23.10.2009, at 12:50, Boyapati, Anitha wrote:
> > Hello,
> >
> > We have a proposal to add support for AVR32 target emulation in
> > Qemu. So far, we are able to build qemu from sources on windows
> > using Mingw.
>
> I would suggest you try and do this on Linux first.

Why is wrong with  *BSD or OpenSolaris in your eyes ?

Christoph


-- 
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Andrew Bowd, Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Support for new target emulator
  2009-10-23 11:18   ` Christoph Egger
@ 2009-10-23 11:19     ` Alexander Graf
  2009-10-23 11:44     ` Laurent Desnogues
  1 sibling, 0 replies; 14+ messages in thread
From: Alexander Graf @ 2009-10-23 11:19 UTC (permalink / raw)
  To: Christoph Egger; +Cc: qemu-devel, Boyapati, Anitha


On 23.10.2009, at 13:18, Christoph Egger wrote:

> On Friday 23 October 2009 13:03:54 Alexander Graf wrote:
>> On 23.10.2009, at 12:50, Boyapati, Anitha wrote:
>>> Hello,
>>>
>>> We have a proposal to add support for AVR32 target emulation in
>>> Qemu. So far, we are able to build qemu from sources on windows
>>> using Mingw.
>>
>> I would suggest you try and do this on Linux first.
>
> Why is wrong with  *BSD or OpenSolaris in your eyes ?

Nothing is wrong there, the Linux user mode target is simply the best  
tested one.

Alex

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Support for new target emulator
  2009-10-23 11:18   ` Christoph Egger
  2009-10-23 11:19     ` Alexander Graf
@ 2009-10-23 11:44     ` Laurent Desnogues
  2009-10-23 12:00       ` Alexander Graf
  1 sibling, 1 reply; 14+ messages in thread
From: Laurent Desnogues @ 2009-10-23 11:44 UTC (permalink / raw)
  To: Christoph Egger; +Cc: Boyapati, Anitha, qemu-devel, Alexander Graf

On Fri, Oct 23, 2009 at 1:18 PM, Christoph Egger
<Christoph.Egger@amd.com> wrote:
> On Friday 23 October 2009 13:03:54 Alexander Graf wrote:
>> On 23.10.2009, at 12:50, Boyapati, Anitha wrote:
>> > Hello,
>> >
>> > We have a proposal to add support for AVR32 target emulation in
>> > Qemu. So far, we are able to build qemu from sources on windows
>> > using Mingw.
>>
>> I would suggest you try and do this on Linux first.
>
> Why is wrong with  *BSD or OpenSolaris in your eyes ?

Their lack of AVR32 port?


Laurent

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Support for new target emulator
  2009-10-23 11:44     ` Laurent Desnogues
@ 2009-10-23 12:00       ` Alexander Graf
  0 siblings, 0 replies; 14+ messages in thread
From: Alexander Graf @ 2009-10-23 12:00 UTC (permalink / raw)
  To: Laurent Desnogues; +Cc: Christoph Egger, qemu-devel, Boyapati, Anitha


On 23.10.2009, at 13:44, Laurent Desnogues wrote:

> On Fri, Oct 23, 2009 at 1:18 PM, Christoph Egger
> <Christoph.Egger@amd.com> wrote:
>> On Friday 23 October 2009 13:03:54 Alexander Graf wrote:
>>> On 23.10.2009, at 12:50, Boyapati, Anitha wrote:
>>>> Hello,
>>>>
>>>> We have a proposal to add support for AVR32 target emulation in
>>>> Qemu. So far, we are able to build qemu from sources on windows
>>>> using Mingw.
>>>
>>> I would suggest you try and do this on Linux first.
>>
>> Why is wrong with  *BSD or OpenSolaris in your eyes ?
>
> Their lack of AVR32 port?

Hey, at least someone tried:

http://mail-index.netbsd.org/port-avr32/

:-)

Alex

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [Qemu-devel] Support for new target emulator
  2009-10-23 11:03 ` Alexander Graf
  2009-10-23 11:18   ` Christoph Egger
@ 2009-10-23 12:20   ` Boyapati, Anitha
  2009-10-23 12:24     ` Alexander Graf
  1 sibling, 1 reply; 14+ messages in thread
From: Boyapati, Anitha @ 2009-10-23 12:20 UTC (permalink / raw)
  To: Alexander Graf; +Cc: qemu-devel

 
> On 23.10.2009, at 12:50, Boyapati, Anitha wrote:
> 
> 
> Luckily Uli just added support for s390x, so you can take a look at
> his patchset and see what needs to be done.
> 

Yes. Recent S390x support should give us a good idea.

> The reason you should try to do things on Linux is that it's a lot
> easier to implement a user-mode target than a system emulation target.
> So if I were you, I'd start off by implementing an AVR32 Linux
> userspace target. Apart from the syscall translation that should be
> almost completely a subset of the system emulation.
> 
> Once you have found your user mode emulation to work, you can start
> implementing the softmmu and privileged opcodes. Also, you'll need
> some sort of "machine" you're running on then. So if I were you again,
> I'd implement a typical AVR32 developer board emulation.
> 

This definitely sounds logical. Thanks for the immediate response.

> It's great to see someone from Atmel actually taking on the challenge!
> I'd love to see AVR32 support in Qemu. It's FWIW the only completely
> missing major target.

It was in queue for sometime now. As there is very little support for AVR32 emulation, it has become increasingly important to have a full-fledged AVR32 emulator. Hence QEMU.

Regards
Anitha

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Support for new target emulator
  2009-10-23 12:20   ` Boyapati, Anitha
@ 2009-10-23 12:24     ` Alexander Graf
  2009-10-23 17:05       ` Boyapati, Anitha
  0 siblings, 1 reply; 14+ messages in thread
From: Alexander Graf @ 2009-10-23 12:24 UTC (permalink / raw)
  To: Boyapati, Anitha; +Cc: qemu-devel


On 23.10.2009, at 14:20, Boyapati, Anitha wrote:

>> It's great to see someone from Atmel actually taking on the  
>> challenge!
>> I'd love to see AVR32 support in Qemu. It's FWIW the only completely
>> missing major target.
>
> It was in queue for sometime now. As there is very little support  
> for AVR32 emulation, it has become increasingly important to have a  
> full-fledged AVR32 emulator. Hence QEMU.

Great choice :-).

Btw now that I have someone from Atmel who apparently knows the  
architecture:

Would virtualization work on AVR32? I mean, is there anything that  
would keep you from running kernel code in user mode and just trap  
everything?

I really know very little about AVR32, probably due to the fact that  
it's still a missing target in Qemu :-).

Alex

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [Qemu-devel] Support for new target emulator
  2009-10-23 12:24     ` Alexander Graf
@ 2009-10-23 17:05       ` Boyapati, Anitha
  0 siblings, 0 replies; 14+ messages in thread
From: Boyapati, Anitha @ 2009-10-23 17:05 UTC (permalink / raw)
  To: Alexander Graf; +Cc: qemu-devel



> 
> Btw now that I have someone from Atmel who apparently knows the
> architecture:
> 
> Would virtualization work on AVR32? I mean, is there anything that
> would keep you from running kernel code in user mode and just trap
> everything?

Some attempts are going on with AP7 series. It is not the processor mode that poses a problem but the memory limitation. Memory footprint is the fat issue. Despite the fact that AP7 series has MMU and allows external 16-bit SRAM for additional memory, experience shows that virtualization still remains a fairly big challenge.

UC3 series have no MMU at all. Except for UC3A, no other series has extended memory support either. AFAIK, it is mostly a closed alley.

Anitha

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Support for new target emulator
  2009-10-23 10:50 [Qemu-devel] Support for new target emulator Boyapati, Anitha
  2009-10-23 11:03 ` Alexander Graf
  2009-10-23 11:09 ` Pablo Virolainen
@ 2009-10-27 16:03 ` Rabin Vincent
  2009-10-28  7:45   ` Boyapati, Anitha
  2009-11-24 12:02   ` Boyapati, Anitha
  2009-10-28 17:02 ` Stefan Weil
  3 siblings, 2 replies; 14+ messages in thread
From: Rabin Vincent @ 2009-10-27 16:03 UTC (permalink / raw)
  To: Boyapati, Anitha; +Cc: qemu-devel

On Fri, Oct 23, 2009 at 12:50:03PM +0200, Boyapati, Anitha wrote:
> We have a proposal to add support for AVR32 target emulation in Qemu.

I've been working on and off on AVR32 target support for a little while
now.  It's still far from being complete or mergeable, but enough of the
architecture has been implemented to boot a minimal Linux kernel in
system emulation and run busybox in linux-user emulation.

I've put up the current source at http://repo.or.cz/w/qemu/avr32.git,
and a small README and some prebuilt kernel and busybox binaries to play
with at http://rab.in/qemu/avr32/.

Current status and a TODO list are below.  Have a look.  I still hope to
complete this and get it merged at some point, but you're welcome to
beat me to it.  If you (or anyone else) decide to work off this, I'd
be happy to take patches or give you push access to the repo.

Current status:
- linux-user: Busybox (ash, ls, gzip, etc) works.

- system: Linux kernel (built for ATSTK1000) boots and is able to get a
  userspace printf("Hello") init process to run.  Busybox init doesn't
  work because fork/exec appears to be broken with the current MMU code.

TODO, off the top of my head:
- Get fork/exec working under Linux in system mode
- Code cleanup (especially remove duplicated code in translate.c)
- Make kernel args/atags work (removes need for kernel hack)
- Disassembler code integration
- Single stepping
- GDB support
- more devices (atleast framebuffer), sysbus conversion
- Implement missing insns (mul variants, packed data insns, saturating
  arithmetic, various odds & ends)
- processor variants support (UC3)?
- ...

Rabin

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [Qemu-devel] Support for new target emulator
  2009-10-27 16:03 ` Rabin Vincent
@ 2009-10-28  7:45   ` Boyapati, Anitha
  2009-11-24 12:02   ` Boyapati, Anitha
  1 sibling, 0 replies; 14+ messages in thread
From: Boyapati, Anitha @ 2009-10-28  7:45 UTC (permalink / raw)
  To: Rabin Vincent; +Cc: qemu-devel



> -----Original Message-----
> From: Rabin Vincent [mailto:rabin.vincent@gmail.com] On Behalf Of Rabin
> Vincent
> Sent: Tuesday, October 27, 2009 9:33 PM
> To: Boyapati, Anitha
> Cc: qemu-devel@nongnu.org
> Subject: Re: [Qemu-devel] Support for new target emulator
> 
> On Fri, Oct 23, 2009 at 12:50:03PM +0200, Boyapati, Anitha wrote:
> > We have a proposal to add support for AVR32 target emulation in Qemu.
> 
> I've been working on and off on AVR32 target support for a little while
> now.  It's still far from being complete or mergeable, but enough of the
> architecture has been implemented to boot a minimal Linux kernel in
> system emulation and run busybox in linux-user emulation.
> 

That's great!

> I've put up the current source at http://repo.or.cz/w/qemu/avr32.git,
> and a small README and some prebuilt kernel and busybox binaries to play
> with at http://rab.in/qemu/avr32/.
> 
> Current status and a TODO list are below.  Have a look.  I still hope to
> complete this and get it merged at some point, but you're welcome to
> beat me to it.  

Sure. I am running around the patches from the repo. On a quick note, UC3 support is currently a top priority (yes, than AP7). The idea is to first get the basic AVR32 emulator up and run a GCC regression test suite.
 
>If you (or anyone else) decide to work off this, I'd
> be happy to take patches or give you push access to the repo.
>

Thanks indeed. It is a pleasant surprise that support for QEMU AVR32 is going on. I shall get back to the details of work done shortly and Yes, I am willing to work on this.


Anitha

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] Support for new target emulator
  2009-10-23 10:50 [Qemu-devel] Support for new target emulator Boyapati, Anitha
                   ` (2 preceding siblings ...)
  2009-10-27 16:03 ` Rabin Vincent
@ 2009-10-28 17:02 ` Stefan Weil
  3 siblings, 0 replies; 14+ messages in thread
From: Stefan Weil @ 2009-10-28 17:02 UTC (permalink / raw)
  To: Boyapati, Anitha; +Cc: qemu-devel

Boyapati, Anitha schrieb:
> Hello,
>
> We have a proposal to add support for AVR32 target emulation in Qemu. So far, we are able to build qemu from sources on windows using Mingw.
>
> Besides looking at sources for other targets in qemu tar ball, I have gone through docs for information on how to start adding support for a new target. I will appreciate if someone can give additional pointers on this. Also, kindly let me know the rough estimate of adding basic support to a new target like AVR32.
>
> There are some threads in Qemu user forums regarding the same. However, link for Qemu user forums is currently reporting a lost connection to mysql server (for the past 4 days?). I did a basic search on Qemu developer mailing list archives and I could not find a relevant thread yet.
>
> Thanks
> Anitha

Hi,

are you planning qemu host support for avr32, too?
I suppose that running i386 linux binaries on avr32
could be interesting for some users.

If yes, TCI (Tiny Code Interpreter) might be a
good starting point.

Kind regards
Stefan

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [Qemu-devel] Support for new target emulator
  2009-10-27 16:03 ` Rabin Vincent
  2009-10-28  7:45   ` Boyapati, Anitha
@ 2009-11-24 12:02   ` Boyapati, Anitha
  1 sibling, 0 replies; 14+ messages in thread
From: Boyapati, Anitha @ 2009-11-24 12:02 UTC (permalink / raw)
  To: Rabin Vincent; +Cc: qemu-devel



> -----Original Message-----
> From: Rabin Vincent [mailto:rabin.vincent@gmail.com] On Behalf Of Rabin
> Vincent

Hello Rabin,

> I've put up the current source at http://repo.or.cz/w/qemu/avr32.git,
> and a small README and some prebuilt kernel and busybox binaries to play
> with at http://rab.in/qemu/avr32/.
> 
> Current status and a TODO list are below.  Have a look.  I still hope to
> complete this and get it merged at some point, but you're welcome to
> beat me to it.  If you (or anyone else) decide to work off this, I'd
> be happy to take patches or give you push access to the repo.
> 
> Current status:
> - linux-user: Busybox (ash, ls, gzip, etc) works.
> 

I am playing around the code downloaded from git repo and tried something like the following in linux-user mode:

$ qemu-avr32 a.out

[a.out is a simple elf file created using avr32-gcc by compiling a file containing a blank main()].

#test.c

int main() {
	return 0;
}

I get an error "mmap: Invalid argument". The same behavior can be seen for all elf programs (as simple as a blank main function). Not sure what I expected, but definitely not an error. This kind of execution is important for providing gdb support.

Further analysis shows that the error directly narrows down to target_mmap in mmap.c. The check for offset and target_page_mask fails for stack segment mapping and results in this error. Any idea why this happened? Let me know your insights on this issue.


Some more info about helloworld using readelf:

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000400 0x00000000 0x00000000 0x07a8c 0x07a90 RWE 0x400
  LOAD           0x008000 0x24000000 0x00007a90 0x00848 0x00848 RW  0x400
  LOAD           0x008848 0x24000848 0x24000848 0x00000 0x00050 RW  0x400
  LOAD           0x008c00 0x24007000 0x24007000 0x00000 0x01000 RW  0x400

 Section to Segment mapping:
  Segment Sections...
   00     .reset .init .text .fini .rodata .dalign 
   01     .ctors .dtors .jcr .got .data 
   02     .bss 
   03     .stack


Anitha

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2009-11-24 12:02 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-23 10:50 [Qemu-devel] Support for new target emulator Boyapati, Anitha
2009-10-23 11:03 ` Alexander Graf
2009-10-23 11:18   ` Christoph Egger
2009-10-23 11:19     ` Alexander Graf
2009-10-23 11:44     ` Laurent Desnogues
2009-10-23 12:00       ` Alexander Graf
2009-10-23 12:20   ` Boyapati, Anitha
2009-10-23 12:24     ` Alexander Graf
2009-10-23 17:05       ` Boyapati, Anitha
2009-10-23 11:09 ` Pablo Virolainen
2009-10-27 16:03 ` Rabin Vincent
2009-10-28  7:45   ` Boyapati, Anitha
2009-11-24 12:02   ` Boyapati, Anitha
2009-10-28 17:02 ` Stefan Weil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).