* Re: [Qemu-devel] How to get started with the source code of Qemu?
2015-10-06 14:17 [Qemu-devel] How to get started with the source code of Qemu? Aaron Elkins
@ 2015-10-06 16:41 ` Eric Blake
2015-10-06 17:04 ` Bastian Koppelmann
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Eric Blake @ 2015-10-06 16:41 UTC (permalink / raw)
To: Aaron Elkins, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 2494 bytes --]
On 10/06/2015 08:17 AM, Aaron Elkins wrote:
> Hi all,
>
> I am new to Qemu, and I’m extremely interested in understanding how the source code of Qemu work. But after
> I downloaded the whole project, I just lost in it, the project is too large for me to get started.
Welcome.
As a piece of general advice, one of the best ways to get started (on
any project, not just qemu) is to start reading the mailing list, pick a
subject line that sounds interesting, and reviewing someone else's
patches on that topic. Even if you admit that your review is weak
because you are not familiar with the code, the mere act of trying to
understand why someone else's patch was submitted will get you more
familiar with that part of the code base than randomly looking through
files on your own.
It also helps to point out that reviews tend to be the bottleneck, so
the more people that are contributing reviews in addition to their own
code, the faster the project can evolve. It's easier to write your own
patches, and have a chance of them being reviewed in turn, if you have
already proven your willingness to review code from others first.
>
> If anyone here can point me to some useful document or some guides, to make me get started in understanding
> the source code?
Qemu is probably big enough that no one person understands the entire
code base. Rather, we have quite a few subject-matter experts on
various pieces of the overall project. So don't feel bad if you don't
understand everything; it is enough to pick one topic that sounds
interesting and try to understand that.
There may be good wiki or blog pages with introductions to high-level
overviews of what qemu is doing, but I'll let others point those out (as
I'm not personally familiar with where such introductory materials would
live). In fact, if you'd like to take good notes of what you are
learning, perhaps you could turn that into a tutorial for the next new
contributor, and do a much better job at the task than someone who has
been on the list for years and takes certain things for granted.
>
> What knowledge are required to understand the source code?
Most of qemu is written in C, so having a good grasp on the language
helps. But even if you are weak in C, studying qemu and reading the
mailing list will help you learn and improve your skills.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] How to get started with the source code of Qemu?
2015-10-06 14:17 [Qemu-devel] How to get started with the source code of Qemu? Aaron Elkins
2015-10-06 16:41 ` Eric Blake
@ 2015-10-06 17:04 ` Bastian Koppelmann
2015-10-07 3:55 ` Aaron Elkins
2015-10-06 20:08 ` Peter Crosthwaite
2015-10-07 7:37 ` Thomas Huth
3 siblings, 1 reply; 7+ messages in thread
From: Bastian Koppelmann @ 2015-10-06 17:04 UTC (permalink / raw)
To: Aaron Elkins, qemu-devel
Hi Aaron,
On 10/06/2015 04:17 PM, Aaron Elkins wrote:
> Hi all,
>
> I am new to Qemu, and I’m extremely interested in understanding how the source code of Qemu work. But after
> I downloaded the whole project, I just lost in it, the project is too large for me to get started.
>
> If anyone here can point me to some useful document or some guides, to make me get started in understanding
> the source code?
it depends of the area of your interest. Or do you seek a general
overview regarding QEMU?
When I started with QEMU, I picked some part that looked interesting,
looked at an interesting sounding function, added a breakpoint in gdb,
and slowly stepped through it in order to understand it. Looking at the
backtrace helps to see where this function was called to find more
interesting function for the breakpoint stepping.
Sadly there is not a lot of documentation today. For some areas you have
good chance, if you look into the docs/ directory. But mostly the
sourcecode is the documentation. We talked about that issue on the QEMU
Summit 2015 and would like to change it. However it depends on how
people are willing to write high level documentation.
If you are interested in the tcg-frontend part of QEMU, I can give you
some hints.
>
> What knowledge are required to understand the source code?
>
> BTW, i know this project is not that simple to understand, but I would like to try, even I need to know a lot
> of other knowledge before that, but at least let me get started.
>
> Thanks
>
> -Aaron
>
>
Cheers,
Bastian
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] How to get started with the source code of Qemu?
2015-10-06 17:04 ` Bastian Koppelmann
@ 2015-10-07 3:55 ` Aaron Elkins
0 siblings, 0 replies; 7+ messages in thread
From: Aaron Elkins @ 2015-10-07 3:55 UTC (permalink / raw)
To: Bastian Koppelmann; +Cc: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1832 bytes --]
Hi Bastian,
Thanks for you suggestion, I decide to do as you said, started by picking some interesting parts.
-Aaron
On Oct 7, 2015, at 1:04 AM, Bastian Koppelmann <kbastian@mail.uni-paderborn.de> wrote:
Hi Aaron,
On 10/06/2015 04:17 PM, Aaron Elkins wrote:
> Hi all,
>
> I am new to Qemu, and I’m extremely interested in understanding how the source code of Qemu work. But after
> I downloaded the whole project, I just lost in it, the project is too large for me to get started.
>
> If anyone here can point me to some useful document or some guides, to make me get started in understanding
> the source code?
it depends of the area of your interest. Or do you seek a general overview regarding QEMU?
When I started with QEMU, I picked some part that looked interesting, looked at an interesting sounding function, added a breakpoint in gdb, and slowly stepped through it in order to understand it. Looking at the backtrace helps to see where this function was called to find more interesting function for the breakpoint stepping.
Sadly there is not a lot of documentation today. For some areas you have good chance, if you look into the docs/ directory. But mostly the sourcecode is the documentation. We talked about that issue on the QEMU Summit 2015 and would like to change it. However it depends on how people are willing to write high level documentation.
If you are interested in the tcg-frontend part of QEMU, I can give you some hints.
>
> What knowledge are required to understand the source code?
>
> BTW, i know this project is not that simple to understand, but I would like to try, even I need to know a lot
> of other knowledge before that, but at least let me get started.
>
> Thanks
>
> -Aaron
>
>
Cheers,
Bastian
[-- Attachment #2: Type: text/html, Size: 4919 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] How to get started with the source code of Qemu?
2015-10-06 14:17 [Qemu-devel] How to get started with the source code of Qemu? Aaron Elkins
2015-10-06 16:41 ` Eric Blake
2015-10-06 17:04 ` Bastian Koppelmann
@ 2015-10-06 20:08 ` Peter Crosthwaite
2015-10-07 3:56 ` Aaron Elkins
2015-10-07 7:37 ` Thomas Huth
3 siblings, 1 reply; 7+ messages in thread
From: Peter Crosthwaite @ 2015-10-06 20:08 UTC (permalink / raw)
To: Aaron Elkins; +Cc: qemu-devel@nongnu.org Developers
On Tue, Oct 6, 2015 at 7:17 AM, Aaron Elkins <threcius@yahoo.com> wrote:
> Hi all,
>
> I am new to Qemu, and I’m extremely interested in understanding how the source code of Qemu work. But after
> I downloaded the whole project, I just lost in it, the project is too large for me to get started.
>
It does a lot, what is your use case? Very few people have an
understanding of the entire code base. Someone might be able to point
you in a specific direction if you give more.
> If anyone here can point me to some useful document or some guides, to make me get started in understanding
> the source code?
>
> What knowledge are required to understand the source code?
>
C coding. Git. Computer hardware architecture.
Regards,
Peter
> BTW, i know this project is not that simple to understand, but I would like to try, even I need to know a lot
> of other knowledge before that, but at least let me get started.
>
> Thanks
>
> -Aaron
>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] How to get started with the source code of Qemu?
2015-10-06 20:08 ` Peter Crosthwaite
@ 2015-10-07 3:56 ` Aaron Elkins
0 siblings, 0 replies; 7+ messages in thread
From: Aaron Elkins @ 2015-10-07 3:56 UTC (permalink / raw)
To: Peter Crosthwaite; +Cc: qemu-devel@nongnu.org Developers
Hi peter,
Thanks for suggestion.
Computer hardware architecture, that’s an interesting thing.
-Aaron
On Oct 7, 2015, at 4:08 AM, Peter Crosthwaite <crosthwaitepeter@gmail.com> wrote:
On Tue, Oct 6, 2015 at 7:17 AM, Aaron Elkins <threcius@yahoo.com> wrote:
> Hi all,
>
> I am new to Qemu, and I’m extremely interested in understanding how the source code of Qemu work. But after
> I downloaded the whole project, I just lost in it, the project is too large for me to get started.
>
It does a lot, what is your use case? Very few people have an
understanding of the entire code base. Someone might be able to point
you in a specific direction if you give more.
> If anyone here can point me to some useful document or some guides, to make me get started in understanding
> the source code?
>
> What knowledge are required to understand the source code?
>
C coding. Git. Computer hardware architecture.
Regards,
Peter
> BTW, i know this project is not that simple to understand, but I would like to try, even I need to know a lot
> of other knowledge before that, but at least let me get started.
>
> Thanks
>
> -Aaron
>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] How to get started with the source code of Qemu?
2015-10-06 14:17 [Qemu-devel] How to get started with the source code of Qemu? Aaron Elkins
` (2 preceding siblings ...)
2015-10-06 20:08 ` Peter Crosthwaite
@ 2015-10-07 7:37 ` Thomas Huth
3 siblings, 0 replies; 7+ messages in thread
From: Thomas Huth @ 2015-10-07 7:37 UTC (permalink / raw)
To: Aaron Elkins, qemu-devel
On 06/10/15 16:17, Aaron Elkins wrote:
> Hi all,
>
> I am new to Qemu, and I’m extremely interested in understanding how the source code of Qemu work. But after
> I downloaded the whole project, I just lost in it, the project is too large for me to get started.
A very rough survey:
- The main() function is in "vl.c"
- The target CPU emulation code is in the "target-xxx" directories
- The host backends for the CPU emulation is in the "tcg" directory
(TCG means Tiny Code Generator)
- Other hardware emulation can be found in the "hw" directory
- Host networking code is in the "net" folder
- Guest firmware (BIOS) code can be found in the "pc-bios" folder
That's at least the folders I have been in touch with since I started
working on QEMU. I hope that helps at least a little bit.
Thomas
^ permalink raw reply [flat|nested] 7+ messages in thread