djm@kirby.fc.hp.com 08b3de8dee diff -r 545ba1b126ca tools/libxc/xc_linux_build.c
--- a/tools/libxc/xc_linux_build.c      Tue Dec 20 20:11:17 2005
+++ b/tools/libxc/xc_linux_build.c      Wed Dec 21 11:50:08 2005
@@ -296,9 +296,13 @@
     unsigned long *page_array = NULL;
     struct load_funcs load_funcs;
     struct domain_setup_info dsi;
+    unsigned long vinitrd_start;
+    unsigned long vinitrd_end;
+    unsigned long v_end;
     unsigned long start_page, pgnr;
     start_info_t *start_info;
     int rc;
+    unsigned long i;
 
     rc = probeimageformat(image, image_size, &load_funcs);
     if ( rc != 0 )
@@ -310,11 +314,13 @@
     if ( rc != 0 )
         goto error_out;
 
-    dsi.v_start = round_pgdown(dsi.v_start);
-    dsi.v_end   = round_pgup(dsi.v_end);
+    dsi.v_start      = round_pgdown(dsi.v_start);
+    vinitrd_start    = round_pgup(dsi.v_end);
+    vinitrd_end      = vinitrd_start + initrd_len;
+    v_end            = round_pgup(vinitrd_end);
 
     start_page = dsi.v_start >> PAGE_SHIFT;
-    pgnr = (dsi.v_end - dsi.v_start) >> PAGE_SHIFT;
+    pgnr = (v_end - dsi.v_start) >> PAGE_SHIFT;
     if ( (page_array = malloc(pgnr * sizeof(unsigned long))) == NULL )
     {
         PERROR("Could not allocate memory");
@@ -326,9 +332,38 @@
         PERROR("Could not get the page frame list");
         goto error_out;
     }
+
+#define _p(a) ((void *) (a))
+
+    printf("VIRTUAL MEMORY ARRANGEMENT:\n"
+           " Loaded kernel: %p->%p\n"
+           " Init. ramdisk: %p->%p\n"
+           " TOTAL:         %p->%p\n",
+           _p(dsi.v_kernstart), _p(dsi.v_kernend), 
+           _p(vinitrd_start),   _p(vinitrd_end),
+           _p(dsi.v_start),     _p(v_end));
+    printf(" ENTRY ADDRESS: %p\n", _p(dsi.v_kernentry));
 
     (load_funcs.loadimage)(image, image_size, xc_handle, dom, page_array,
                            &dsi);
+
+    /* Load the initial ramdisk image. */
+    if ( initrd_len != 0 )
+    {
+        for ( i = (vinitrd_start - dsi.v_start);
+              i < (vinitrd_end - dsi.v_start); i += PAGE_SIZE )
+        {
+            char page[PAGE_SIZE];
+            if ( gzread(initrd_gfd, page, PAGE_SIZE) == -1 )
+            {
+                PERROR("Error reading initrd image, could not");
+                goto error_out;
+            }
+            xc_copy_to_domain_page(xc_handle, dom,
+                                   page_array[i>>PAGE_SHIFT], page);
+        }
+    }
+
 
     *pvke = dsi.v_kernentry;
 
@@ -358,6 +393,13 @@
     start_info->store_evtchn = store_evtchn;
     start_info->console_mfn   = nr_pages - 1;
     start_info->console_evtchn = console_evtchn;
+    if ( initrd_len != 0 )
+    {
+        ctxt->initrd.start    = vinitrd_start;
+        ctxt->initrd.size     = initrd_len;
+    }
+    strncpy((char *)ctxt->cmdline, cmdline, IA64_COMMAND_LINE_SIZE);
+    ctxt->cmdline[IA64_COMMAND_LINE_SIZE-1] = '\0';
     munmap(start_info, PAGE_SIZE);
 
     free(page_array);
diff -r 545ba1b126ca xen/arch/ia64/xen/dom_fw.c
--- a/xen/arch/ia64/xen/dom_fw.c        Tue Dec 20 20:11:17 2005
+++ b/xen/arch/ia64/xen/dom_fw.c        Wed Dec 21 11:50:08 2005
@@ -861,9 +861,14 @@
        bp->console_info.orig_x = 0;
        bp->console_info.orig_y = 24;
        bp->fpswa = 0;
-        bp->initrd_start = (dom0_start+dom0_size) -
-                (PAGE_ALIGN(ia64_boot_param->initrd_size) + 4*1024*1024);
-        bp->initrd_size = ia64_boot_param->initrd_size;
+        if (d == dom0){
+                bp->initrd_start = (dom0_start+dom0_size) -
+                        (PAGE_ALIGN(ia64_boot_param->initrd_size) + 4*1024*1024);
+                bp->initrd_size = ia64_boot_param->initrd_size;
+        }else{
+                bp->initrd_start = d->arch.initrd_start;
+                bp->initrd_size  = d->arch.initrd_len;
+       }
                 printf(" initrd start %0xlx", bp->initrd_start);
                 printf(" initrd size %0xlx", bp->initrd_size);
 
diff -r 545ba1b126ca xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c        Tue Dec 20 20:11:17 2005
+++ b/xen/arch/ia64/xen/domain.c        Wed Dec 21 11:50:08 2005
@@ -297,6 +297,9 @@
 
        *regs = c->regs;
        d->arch.sys_pgnr = c->sys_pgnr;
+        d->arch.initrd_start = c->initrd.start;
+        d->arch.initrd_len   = c->initrd.size;
+        d->arch.cmdline      = c->cmdline;
        new_thread(v, regs->cr_iip, 0, 0);
 
        v->vcpu_info->arch.evtchn_vector = c->vcpu.evtchn_vector;
@@ -365,7 +368,7 @@
                    regs->r28 = dom_fw_setup(d,saved_command_line,256L);
                else {
                    regs->ar_rsc |= (2 << 2); /* force PL2/3 */
-                   regs->r28 = dom_fw_setup(d,"nomca nosmp xencons=tty0 console=tty0 root=/dev/hda1",256L);  //FIXME
+                   regs->r28 = dom_fw_setup(d,d->arch.cmdline,256L);
                }
                VCPU(v, banknum) = 1;
                VCPU(v, metaphysical_mode) = 1;
diff -r 545ba1b126ca xen/include/asm-ia64/domain.h
--- a/xen/include/asm-ia64/domain.h     Tue Dec 20 20:11:17 2005
+++ b/xen/include/asm-ia64/domain.h     Wed Dec 21 11:50:08 2005
@@ -38,6 +38,9 @@
     u64 image_len;
     u64 entry;
 #endif
+    unsigned long initrd_start;
+    unsigned long initrd_len;
+    char *cmdline;
 };
 #define xen_vastart arch.xen_vastart
 #define xen_vaend arch.xen_vaend
diff -r 545ba1b126ca xen/include/public/arch-ia64.h
--- a/xen/include/public/arch-ia64.h    Tue Dec 20 20:11:17 2005
+++ b/xen/include/public/arch-ia64.h    Wed Dec 21 11:50:08 2005
@@ -276,6 +276,12 @@
     unsigned long start_info_pfn;
 } arch_shared_info_t;
 
+typedef struct {
+    unsigned long start;
+    unsigned long size; 
+} arch_initrd_info_t;
+
+#define IA64_COMMAND_LINE_SIZE 512
 typedef struct vcpu_guest_context {
 #define VGCF_FPU_VALID (1<<0)
 #define VGCF_VMX_GUEST (1<<1)
@@ -289,6 +295,8 @@
     cpu_user_regs_t regs;
     arch_vcpu_info_t vcpu;
     arch_shared_info_t shared;
+    arch_initrd_info_t initrd;
+    char cmdline[IA64_COMMAND_LINE_SIZE];
 } vcpu_guest_context_t;
 
 #endif /* !__ASSEMBLY__ */
2005-12-21 09:07:09 -06:00
2005-12-04 01:34:25 +01:00

################################
 __  __            _____  ___  
 \ \/ /___ _ __   |___ / / _ \ 
  \  // _ \ '_ \    |_ \| | | |
  /  \  __/ | | |  ___) | |_| |
 /_/\_\___|_| |_| |____(_)___/ 

################################

http://www.xensource.com/xen/about.html

What is Xen?
============

Xen is a Virtual Machine Monitor (VMM) originally developed by the
Systems Research Group of the University of Cambridge Computer
Laboratory, as part of the UK-EPSRC funded XenoServers project.  Xen
is freely-distributable Open Source software, released under the GNU
GPL. Since its initial public release, Xen has grown a large
development community, spearheaded by XenSource Inc, a company created
by the original Xen development team to build enterprise products
around Xen.

The 3.0 release offers excellent performance, hardware support and
enterprise-grade features such as x86_32-PAE, x86_64, SMP guests and
live relocation of VMs. This install tree contains source for a Linux
2.6 guest; ports to Linux 2.4, NetBSD, FreeBSD and Solaris will follow
later (and are already available for previous Xen releases).

This file contains some quick-start instructions to install Xen on
your system. For full documentation, see the Xen User Manual. If this
is a pre-built release then you can find the manual at:
 dist/install/usr/share/doc/xen/pdf/user.pdf
If you have a source release, then 'make -C docs' will build the
manual at docs/pdf/user.pdf.

Quick-Start Guide - Pre-Built Binary Release
============================================

[NB. Unless noted otherwise, all the following steps should be
performed with root privileges.]

1. Install the binary distribution onto your filesystem:

    # sh ./install.sh

   Among other things, this will install Xen and Xen-ready Linux
   kernel files in /boot, kernel modules and Python packages in /lib,
   and various control tools in standard 'bin' directories.

2. Configure your bootloader to boot Xen and an initial Linux virtual
   machine. Note that Xen currently only works with GRUB and pxelinux
   derived boot loaders: less common alternatives such as LILO are
   *not* supported. You can most likely find your GRUB menu file at
   /boot/grub/menu.lst: edit this file to include an entry like the
   following:

    title Xen 3.0 / XenLinux 2.6
       kernel /boot/xen-3.0.gz console=vga
       module /boot/vmlinuz-2.6-xen root=<root-dev> ro console=tty0
       module /boot/initrd-2.6-xen.img

   NB: Not all kernel configs need an initial ram disk (initrd), but
   if you do specify one you'll need to use the 'module' grub directive
   rather than 'initrd'.

   The linux command line takes all the usual options, such as
   root=<root-dev> to specify your usual root partition (e.g.,
   /dev/hda1).  

   The Xen command line takes a number of optional arguments described
   in the manual. The most common is 'dom0_mem=xxxM' which sets the
   amount of memory to allocate for use by your initial virtual
   machine (known as domain 0). Note that Xen itself reserves about
   32MB memory for internal use, which is not available for allocation
   to virtual machines.  

3. Reboot your system and select the "Xen 3.0 / XenLinux 2.6" menu
   option. After booting Xen, Linux will start and your initialisation
   scripts should execute in the usual way.

Quick-Start Guide - Source Release
==================================

First, there are a number of prerequisites for building a Xen source
release. Make sure you have all the following installed, either by
visiting the project webpage or installing a pre-built package
provided by your Linux distributor:
    * GCC (preferably v3.2.x or v3.3.x; older versions are unsupported) 
    * GNU Make
    * GNU Binutils
    * Development install of zlib (e.g., zlib-dev)
    * Development install of Python v2.3 or later (e.g., python-dev)
    * bridge-utils package (/sbin/brctl)
    * iproute package (/sbin/ip)
    * hotplug or udev

[NB. Unless noted otherwise, all the following steps should be
performed with root privileges.]

1. Download and untar the source tarball file. This will be a
   file named xen-unstable-src.tgz, or xen-$version-src.tgz.
   You can also pull the current version from the SCMS
   that is being used (Bitkeeper, scheduled to change shortly).

    # tar xzf xen-unstable-src.tgz

   Assuming you are using the unstable tree, this will
   untar into xen-unstable. The rest of the instructions
   use the unstable tree as an example, substitute the
   version for unstable.

2. cd to xen-unstable (or whatever you sensibly rename it to).
   The Linux, netbsd and freebsd kernel source trees are in
   the $os-$version-xen-sparse directories.

On Linux:

3. For the very first build, or if you want to destroy existing
   .configs and build trees, perform the following steps:

    # make KERNELS=linux-2.6-xen world
    # make install

   It will create and install into the dist/ directory which is the
   default install location. It will build the xen binary (xen.gz),
   and a linux kernel and modules that can be used in both dom0 and an
   unprivileged guest kernel (vmlinuz-2.6.x-xen), the tools and the
   documentation.

   If you don't specify KERNELS= on the make command line it will
   default to building two kernels, vmlinuz-2.6.x-xen0 and
   vmlinuz-2.6.x-xenU. These are smaller builds with just selected
   modules, intended primarilly for developers that don't like to wait
   for a -xen kernel to build. The -xenU kernel is particularly small
   as it does not contain any physical device drivers, and hence is
   only useful for guest domains.

   If you want to build an x86_32 PAE capable xen and kernel to work
   on machines with >= 4GB of memory, use XEN_TARGET_X86_PAE=y on the
   make command line.

4. To rebuild an existing tree without modifying the config:
    # make dist

   This will build and install xen, kernels, tools, and
   docs into the local dist/ directory.

5. To rebuild a kernel with a modified config:

    # make linux-2.6-xen-config CONFIGMODE=menuconfig     (or xconfig)
    # make linux-2.6-xen-build
    # make linux-2.6-xen-install

   Depending on your config, you may need to use 'mkinitrd' to create
   an initial ram disk, just like a native system e.g. 
    # depmod 2.6.12.6-xen
    # mkinitrd -v -f --with=aacraid --with=sd_mod --with=scsi_mod initrd-2.6.12.6-xen.img 2.6.12.6-xen
Languages
C 91.8%
Python 1.7%
Assembly 1.7%
Makefile 1.1%
Shell 1%
Other 2.4%