Pradeep Singh, TLS-Chennai
2007-Feb-19 14:31 UTC
[Xen-devel] Structure of the Xen source code
Structure of the Xen source code hi all, I installed Xen on my Gentoo machine successfully from source. Now i am going through the code. instead of banging aimlessly for a week or so i thought i should ask the mailing list the following small doubts. I noticed that following directories are there in my xen-3.0.3_0-src directories. 1. linux-2.6.-xen-sparse 2. pristine-linux-2.6.16.29 3. linux-2.6.16.29-xen 4. ref-linux-2.6.16.29 5. linux-2.6.16.29-xen0 6. linux-2.6.16.29-xenU 7. xen 8. unmodified_drivers only these directories look like holding the source. As it looks from the directories i assumed that the xen dom0 patched code must be residing in the linux-2.6.16.29-xen0 directory and that of patched xen domU in linux-2.6.16.29-xen0. Am i right? or i am missing something? What exactly does the other directories signify? Secondly , if i want to start studying the Xen code what would be the correct path to follow. By path i mean is which the directory i should start digging first? If a doc about code organisation of the Xen can be given that will be great. Any other links or pointer''ll be appreciated. Thanks in Advance pradeep DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> -----Original Message----- > From: xen-devel-bounces@lists.xensource.com > [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of > Pradeep Singh, TLS-Chennai > Sent: 19 February 2007 14:32 > To: xen-devel@lists.xensource.com > Subject: [Xen-devel] Structure of the Xen source code > > > hi all, > > I installed Xen on my Gentoo machine successfully from source. > Now i am going through the code. > instead of banging aimlessly for a week or so i thought i > should ask the mailing list the following small doubts. > > I noticed that following directories are there in my > xen-3.0.3_0-src directories. > > 1. linux-2.6.-xen-sparse > 2. pristine-linux-2.6.16.29 > 3. linux-2.6.16.29-xen > 4. ref-linux-2.6.16.29 > 5. linux-2.6.16.29-xen0 > 6. linux-2.6.16.29-xenU > 7. xen > 8. unmodified_drivers > > only these directories look like holding the source. > As it looks from the directories i assumed that the xen dom0 > patched code must be residing in the linux-2.6.16.29-xen0 > directory and that of patched xen domU in linux-2.6.16.29-xen0. > Am i right? or i am missing something?Yes, those are correct. The pristine directory is a "direct copy of kernel.org sources" (or whatever sources where used to generate the patched version of Linux). This is used if you want to "make patches" to port to a different version of Linux. The sparse directory contains the xen-modified source-code, which is "merged" with pristine to create the patched source-code. Linux-2.6.19.29-xen is another version of ...-xenU and ...-xen0 which is a "universal variant". The xenU and xen0 versions are "stripped down" to make them as small as possible, but you have TWO of them. The -xen version is a unified version which contains drivers and code for both DomU and Dom0 usage, and thus you can have ONE kernel to install everywhere. [Don''t worry, the security of Dom0 and DomU is managed by the Xen hypervisor anyways - it''s just a case of "if you know it''s going to be DomU, don''t put the code that it can''t use in there" (and likewise for Dom0 not being able to use some code needed in DomU)]. The xen directory contains the hypervisor itself.> > What exactly does the other directories signify? > > Secondly , if i want to start studying the Xen code what > would be the correct path to follow. > By path i mean is which the directory i should start digging first?Depends on what you want to achieve... Understanding ALL of Xen is a LOT of effort. Understanding enough to be able to do what you need to do may be a lot less. What is the target of your "studying the code"?> > If a doc about code organisation of the Xen can be given that > will be great. > > Any other links or pointer''ll be appreciated. > > Thanks in Advance > > pradeep > > > > > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Mon, 2007-02-19 at 20:01 +0530, Pradeep Singh, TLS-Chennai wrote:> > hi all,hi.> I installed Xen on my Gentoo machine successfully from source. > Now i am going through the code. > instead of banging aimlessly for a week or so i thought i should ask > the mailing list the following small doubts. > > I noticed that following directories are there in my > xen-3.0.3_0-src directories. > > 1. linux-2.6.-xen-sparse''sparse tree'' patched into the> 2. pristine-linux-2.6.16.29plain, vanilla, well, pristine linux-2.6. renamed to this after untar.> 3. linux-2.6.16.29-xenthe hybrid kernel. see ./README> 4. ref-linux-2.6.16.29pristine, patched up to hold xen subarches.> 5. linux-2.6.16.29-xen0dom0 source + build> 6. linux-2.6.16.29-xenUdomU source + build> 7. xenthe hypervisor itself> 8. unmodified_driversgot me. i''ve been asking this myself lately and didn''t really bother yet.> only these directories look like holding the source. > As it looks from the directories i assumed that the xen dom0 patched > code must be residing in the linux-2.6.16.29-xen0 directory and that > of patched xen domU in linux-2.6.16.29-xen0. > Am i right? or i am missing something?unless you build a hybrid domO/U kernel (-xen), true. again, see the ./README. but these are not really source trees, i.e. rebuilt after distribution.> What exactly does the other directories signify?docs/ obvious. run ''make pdf'' in there, or whatever your preferred format is. watch out for missing tools. (latex, etc.) tools/ python/ supplementary pytyon code, xend, xm. simple language made hard to read. >:) libxc/ xenctrl. domain control from dom0 userland. supplementing xend et al. important stuff for studies. extra/mini-os a very small operating system, used for verifying/testing/demo purposes> Secondly , if i want to start studying the Xen code what would be the > correct path to follow. > By path i mean is which the directory i should start digging first?start with docs/. no, really :) reading the interface manual should get you a good introduction. follow the xen code, presumably by tracking some hypercall paths from arch/x86//entry.S. branch from there to whatever you see fit. for hypercalls, see docs//interface.pdf. before or after, see tools/console/daemon for a considerably simple example on how domains and xen are typically wired in between. learn about the basic data structures. see what a vcpu and a domain means. then follow common/event_channel.c from some point of signal emission down to reception by the domain handling. if you know linux, lookup the entries in the linux kernel (path layout should be stunningly similar). if you prefer a more comprehensive example, take a look around mini-os. these all assume paravirtual guests are your focus. if you need to learn about hardware VMs, the path might look different, but i suppose i''d recommend to see paravirtualization first in any case.> If a doc about code organisation of the Xen can be given that will be > great. > > Any other links or pointer''ll be appreciated. > > Thanks in Advance > > pradeep >regards, daniel -- Daniel Stodden LRR - Lehrstuhl für Rechnertechnik und Rechnerorganisation Institut für Informatik der TU München D-85748 Garching http://www.lrr.in.tum.de/~stodden mailto:stodden@cs.tum.edu PGP Fingerprint: F5A4 1575 4C56 E26A 0B33 3D80 457E 82AE B0D8 735B _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Pradeep Singh, TLS-Chennai
2007-Feb-20 03:40 UTC
RE: [Xen-devel] Structure of the Xen source code
RE: [Xen-devel] Structure of the Xen source code -----Original Message----- From: Pradeep Singh, TLS-Chennai Sent: Tue 20-Feb-07 8:57 AM To: Petersson, Mats Subject: RE: [Xen-devel] Structure of the Xen source code -----Original Message----- From: Petersson, Mats [mailto:Mats.Petersson@amd.com] Sent: Mon 19-Feb-07 8:19 PM To: Pradeep Singh, TLS-Chennai; xen-devel@lists.xensource.com Subject: RE: [Xen-devel] Structure of the Xen source code > -----Original Message----- > From: xen-devel-bounces@lists.xensource.com > [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of > Pradeep Singh, TLS-Chennai > Sent: 19 February 2007 14:32 > To: xen-devel@lists.xensource.com > Subject: [Xen-devel] Structure of the Xen source code > > > hi all, > > I installed Xen on my Gentoo machine successfully from source. > Now i am going through the code. > instead of banging aimlessly for a week or so i thought i > should ask the mailing list the following small doubts. > > I noticed that following directories are there in my > xen-3.0.3_0-src directories. > > 1. linux-2.6.-xen-sparse > 2. pristine-linux-2.6.16.29 > 3. linux-2.6.16.29-xen > 4. ref-linux-2.6.16.29 > 5. linux-2.6.16.29-xen0 > 6. linux-2.6.16.29-xenU > 7. xen > 8. unmodified_drivers > > only these directories look like holding the source. > As it looks from the directories i assumed that the xen dom0 > patched code must be residing in the linux-2.6.16.29-xen0 > directory and that of patched xen domU in linux-2.6.16.29-xen0. > Am i right? or i am missing something? Yes, those are correct. The pristine directory is a "direct copy of kernel.org sources" (or whatever sources where used to generate the patched version of Linux). This is used if you want to "make patches" to port to a different version of Linux. The sparse directory contains the xen-modified source-code, which is "merged" with pristine to create the patched source-code. Linux-2.6.19.29-xen is another version of ...-xenU and ...-xen0 which is a "universal variant". The xenU and xen0 versions are "stripped down" to make them as small as possible, but you have TWO of them. The -xen version is a unified version which contains drivers and code for both DomU and Dom0 usage, and thus you can have ONE kernel to install everywhere. [Don''t worry, the security of Dom0 and DomU is managed by the Xen hypervisor anyways - it''s just a case of "if you know it''s going to be DomU, don''t put the code that it can''t use in there" (and likewise for Dom0 not being able to use some code needed in DomU)]. The xen directory contains the hypervisor itself. > > What exactly does the other directories signify? > > Secondly , if i want to start studying the Xen code what > would be the correct path to follow. > By path i mean is which the directory i should start digging first? Depends on what you want to achieve... Understanding ALL of Xen is a LOT of effort. Understanding enough to be able to do what you need to do may be a lot less. What is the target of your "studying the code"? Target to understand how exactly Xen is booted and initialized. On second thought this is what i understood from my study. Xen binary sits with the patched xen dom0 kernel above hardware. Am i right? When we say Xen binary i.e the first line of the Xen entry in Grub(e.g xen.gz), this is different from the patched dom0 kernel, right? I look at this as xen.gz -> hypervisor linux.2.6.x.-xen.dom0 -> patched host kernel linux.2.6.x-xen.domU -> patched/unpatched guest kernel we want to boot. Please CMIIW. TIA Pradeep > > If a doc about code organisation of the Xen can be given that > will be great. > > Any other links or pointer''ll be appreciated. > > Thanks in Advance > > pradeep > > > > > > > DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> Depends on what you want to achieve... Understanding ALL of > Xen is a LOT > of effort. Understanding enough to be able to do what you > need to do may > be a lot less. What is the target of your "studying the code"? > > Target to understand how exactly Xen is booted and initialized.Boot consists of: Grub loads and decompresses Xen.gz + Linux-kernel [+ optional ramdisk + optional security features] It then jumps to the entry-point in xen.gz, which will do some initialization before it jumps to the entry point of the Linux kernel (Dom0 or "host").> On second thought this is what i understood from my study. > Xen binary sits with the patched xen dom0 kernel above hardware. > Am i right?Yes, that''s pretty much it.> > When we say Xen binary i.e the first line of the Xen entry in > Grub(e.g xen.gz), this is different from the patched dom0 > kernel, right?Yes, those are two different binaries, with different purposes. Xen.gz is the hypervisor, the linux kernel is a (modified) Linux operating system kernel. The hypervisor is used by all guests (in this case Dom0 is also considered a guest, it''s just a "special" guest).> > I look at this as > > xen.gz -> hypervisorYes.> linux.2.6.x.-xen.dom0 -> patched host kernelYes.> linux.2.6.x-xen.domU -> patched/unpatched guest kernel we > want to boot.If it''s an "unpatched kernel" then it''s not supplied in the source-code of Xen. Unpatced kernels come from the guest-OS install CD (or similar). As Daniel Stodden explained, there are also tools and other directorys with "parts of Xen", including a documentation directory. -- Mats> > Please CMIIW. > > TIA > Pradeep > > > > > If a doc about code organisation of the Xen can be given that > > will be great. > > > > Any other links or pointer''ll be appreciated. > > > > Thanks in Advance > > > > pradeep > > > > > > > > > > > > > > > > > > > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Pradeep Singh, TLS-Chennai
2007-Feb-20 10:22 UTC
RE: [Xen-devel] Structure of the Xen source code
RE: [Xen-devel] Structure of the Xen source code -----Original Message----- From: xen-devel-bounces@lists.xensource.com on behalf of Petersson, Mats Sent: Tue 20-Feb-07 3:38 PM To: Pradeep Singh, TLS-Chennai; xen-devel@lists.xensource.com Subject: RE: [Xen-devel] Structure of the Xen source code > Depends on what you want to achieve... Understanding ALL of > Xen is a LOT > of effort. Understanding enough to be able to do what you > need to do may > be a lot less. What is the target of your "studying the code"? > > Target to understand how exactly Xen is booted and initialized. Boot consists of: Grub loads and decompresses Xen.gz + Linux-kernel [+ optional ramdisk + optional security features] It then jumps to the entry-point in xen.gz, which will do some initialization before it jumps to the entry point of the Linux kernel (Dom0 or "host"). Got it :) > On second thought this is what i understood from my study. > Xen binary sits with the patched xen dom0 kernel above hardware. > Am i right? Yes, that''s pretty much it. > > When we say Xen binary i.e the first line of the Xen entry in > Grub(e.g xen.gz), this is different from the patched dom0 > kernel, right? Yes, those are two different binaries, with different purposes. Xen.gz is the hypervisor, the linux kernel is a (modified) Linux operating system kernel. The hypervisor is used by all guests (in this case Dom0 is also considered a guest, it''s just a "special" guest). > > I look at this as > > xen.gz -> hypervisor Yes. > linux.2.6.x.-xen.dom0 -> patched host kernel Yes. > linux.2.6.x-xen.domU -> patched/unpatched guest kernel we > want to boot. If it''s an "unpatched kernel" then it''s not supplied in the source-code of Xen. Unpatced kernels come from the guest-OS install CD (or similar). As Daniel Stodden explained, there are also tools and other directorys with "parts of Xen", including a documentation directory. Thanks a lot for the help. Pradeep DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel