qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Internal documentation
@ 2012-12-11 18:40 Michael Eager
  2012-12-12 13:39 ` Stefan Hajnoczi
  2012-12-12 14:25 ` Andreas Färber
  0 siblings, 2 replies; 6+ messages in thread
From: Michael Eager @ 2012-12-11 18:40 UTC (permalink / raw)
  To: qemu-devel

Hi --

Is there any internal documentation for QEMU?

I'm adding support for a new processor.  I'm currently
adding semihosting support and a new command line option.
I find that I'm reading a lot of uncommented code and
trying to reverse engineer QEMU's design by reading how
various targets are implemented.

Is there a better way?

-- 
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077

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

* Re: [Qemu-devel] Internal documentation
  2012-12-11 18:40 [Qemu-devel] Internal documentation Michael Eager
@ 2012-12-12 13:39 ` Stefan Hajnoczi
  2012-12-12 14:34   ` Michael Eager
  2012-12-12 14:25 ` Andreas Färber
  1 sibling, 1 reply; 6+ messages in thread
From: Stefan Hajnoczi @ 2012-12-12 13:39 UTC (permalink / raw)
  To: Michael Eager; +Cc: qemu-devel

On Tue, Dec 11, 2012 at 10:40:45AM -0800, Michael Eager wrote:
> Is there any internal documentation for QEMU?

Nothing up-to-date and complete.

> I'm adding support for a new processor.  I'm currently
> adding semihosting support and a new command line option.
> I find that I'm reading a lot of uncommented code and
> trying to reverse engineer QEMU's design by reading how
> various targets are implemented.

Try the #qemu IRC channel on irc.oftc.net for specific questions.

One nice thing is that, despite the lack of documentation or comments,
the nature of QEMU is that there are often multiple examples (target
CPUs, emulated devices, etc) similar to what you're trying to implement.
Read them to see which core functions you'll need and how to call them.

Stefan

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

* Re: [Qemu-devel] Internal documentation
  2012-12-11 18:40 [Qemu-devel] Internal documentation Michael Eager
  2012-12-12 13:39 ` Stefan Hajnoczi
@ 2012-12-12 14:25 ` Andreas Färber
  2012-12-12 14:57   ` Michael Eager
  1 sibling, 1 reply; 6+ messages in thread
From: Andreas Färber @ 2012-12-12 14:25 UTC (permalink / raw)
  To: Michael Eager; +Cc: qemu-devel, Stefan Hajnoczi

Hi,

Am 11.12.2012 19:40, schrieb Michael Eager:
> Is there any internal documentation for QEMU?
> 
> I'm adding support for a new processor.  I'm currently
> adding semihosting support and a new command line option.
> I find that I'm reading a lot of uncommented code and
> trying to reverse engineer QEMU's design by reading how
> various targets are implemented.
> 
> Is there a better way?

Look at the latest added target-openrisc in qemu.git and/or at my
target-rl78 at GitHub.com/afaerber/qemu-rl78/. That will also give you
some ideas how to split your new target into reviewable patches.

Also look at the mailing list, you may find old/bad examples in our code
base but patch review usually points out the right ways to do things
nowadays. When in doubt, ask. :)

Regards,
Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

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

* Re: [Qemu-devel] Internal documentation
  2012-12-12 13:39 ` Stefan Hajnoczi
@ 2012-12-12 14:34   ` Michael Eager
  2012-12-12 15:00     ` Peter Maydell
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Eager @ 2012-12-12 14:34 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-devel

On 12/12/2012 05:39 AM, Stefan Hajnoczi wrote:
> On Tue, Dec 11, 2012 at 10:40:45AM -0800, Michael Eager wrote:
>> Is there any internal documentation for QEMU?
>
> Nothing up-to-date and complete.
>
>> I'm adding support for a new processor.  I'm currently
>> adding semihosting support and a new command line option.
>> I find that I'm reading a lot of uncommented code and
>> trying to reverse engineer QEMU's design by reading how
>> various targets are implemented.
>
> Try the #qemu IRC channel on irc.oftc.net for specific questions.

Thanks.  I'll try that.

> One nice thing is that, despite the lack of documentation or comments,
> the nature of QEMU is that there are often multiple examples (target
> CPUs, emulated devices, etc) similar to what you're trying to implement.
> Read them to see which core functions you'll need and how to call them.

I've been doing that.  A lot.  That's the reverse engineering I mentioned.
Any documentation about what the core functions do would be helpful.

My target is mostly working, but a lot of the development has been
stepping through execution of other targets to figure out execution
flow and why each implements similar features differently, then doing
the same with my target, trying to understand the differences.  It's
much slower than reading a paragraph or two which says "to do this,
call this, register that, use these options".


-- 
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077

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

* Re: [Qemu-devel] Internal documentation
  2012-12-12 14:25 ` Andreas Färber
@ 2012-12-12 14:57   ` Michael Eager
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Eager @ 2012-12-12 14:57 UTC (permalink / raw)
  To: Andreas Färber; +Cc: qemu-devel, Stefan Hajnoczi

On 12/12/2012 06:25 AM, Andreas Färber wrote:
> Hi,
>
> Am 11.12.2012 19:40, schrieb Michael Eager:
>> Is there any internal documentation for QEMU?
>>
>> I'm adding support for a new processor.  I'm currently
>> adding semihosting support and a new command line option.
>> I find that I'm reading a lot of uncommented code and
>> trying to reverse engineer QEMU's design by reading how
>> various targets are implemented.
>>
>> Is there a better way?
>
> Look at the latest added target-openrisc in qemu.git and/or at my
> target-rl78 at GitHub.com/afaerber/qemu-rl78/. That will also give you
> some ideas how to split your new target into reviewable patches.

Thanks.  I've been using openrisc as well as others as examples.

It isn't clear whether the support will be submitted.  The target
is a proprietary processor.  So I don't get the benefit of public
review of the code.

> Also look at the mailing list, you may find old/bad examples in our code
> base but patch review usually points out the right ways to do things
> nowadays. When in doubt, ask. :)

Thanks.


-- 
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077

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

* Re: [Qemu-devel] Internal documentation
  2012-12-12 14:34   ` Michael Eager
@ 2012-12-12 15:00     ` Peter Maydell
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2012-12-12 15:00 UTC (permalink / raw)
  To: Michael Eager; +Cc: Stefan Hajnoczi, qemu-devel

On 12 December 2012 14:34, Michael Eager <eager@eagerm.com> wrote:
> Any documentation about what the core functions do would be helpful.

There's unlikely to be any documentation about the internals
unless the next person who writes a CPU target also wants to
write some documentation as they go along...

-- PMM

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

end of thread, other threads:[~2012-12-12 15:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-11 18:40 [Qemu-devel] Internal documentation Michael Eager
2012-12-12 13:39 ` Stefan Hajnoczi
2012-12-12 14:34   ` Michael Eager
2012-12-12 15:00     ` Peter Maydell
2012-12-12 14:25 ` Andreas Färber
2012-12-12 14:57   ` Michael Eager

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).