ia64/xen-unstable

changeset 3974:13ab6708f6b7

bitkeeper revision 1.1159.258.19 (42273652yPWGOWH6C8w45TOchk7Jog)


This patch enables argument passing to plan 9 domains, so that users can
now have parameters for things like Venti etc.

Signed-off-by: ron minnich <rminnich@lanl.gov>
Signed-off-by: ian.pratt@cl.cam.ac.uk
author rminnich@lanl.gov[iap10]
date Thu Mar 03 16:07:46 2005 +0000 (2005-03-03)
parents 9340287b7f30
children df7ae5341e20 346f2b5e1711
files BitKeeper/etc/logging_ok tools/libxc/xc_plan9_build.c
line diff
     1.1 --- a/BitKeeper/etc/logging_ok	Thu Mar 03 11:43:19 2005 +0000
     1.2 +++ b/BitKeeper/etc/logging_ok	Thu Mar 03 16:07:46 2005 +0000
     1.3 @@ -46,6 +46,7 @@ mwilli2@equilibrium.research.intel-resea
     1.4  mwilli2@pug.(none)
     1.5  rac61@labyrinth.cl.cam.ac.uk
     1.6  rgr22@boulderdash.cl.cam.ac.uk
     1.7 +rminnich@lanl.gov
     1.8  rn@wyvis.camb.intel-research.net
     1.9  rn@wyvis.research.intel-research.net
    1.10  rneugeba@wyvis.research
     2.1 --- a/tools/libxc/xc_plan9_build.c	Thu Mar 03 11:43:19 2005 +0000
     2.2 +++ b/tools/libxc/xc_plan9_build.c	Thu Mar 03 16:07:46 2005 +0000
     2.3 @@ -125,7 +125,8 @@ static int
     2.4  	     unsigned long tot_pages, unsigned long *virt_load_addr,
     2.5  	     unsigned long *ksize, unsigned long *symtab_addr,
     2.6  	     unsigned long *symtab_len,
     2.7 -	     unsigned long *first_data_page, unsigned long *pdb_page);
     2.8 +	     unsigned long *first_data_page, unsigned long *pdb_page, 
     2.9 +	     const char *cmdline);
    2.10  
    2.11  #define P9ROUND (P9SIZE / 8)
    2.12  
    2.13 @@ -230,7 +231,7 @@ setup_guestos(int xc_handle,
    2.14  
    2.15  	if (loadp9image(kernel_gfd, xc_handle, dom, cpage_array, tot_pages,
    2.16  			virt_load_addr, &ksize, &symtab_addr, &symtab_len,
    2.17 -			&first_data_page, &first_page_after_kernel))
    2.18 +			&first_data_page, &first_page_after_kernel, cmdline))
    2.19  		goto error_out;
    2.20  	DPRINTF(("First data page is 0x%lx\n", first_data_page));
    2.21  	DPRINTF(("First page after kernel is 0x%lx\n",
    2.22 @@ -623,7 +624,7 @@ xc_plan9_build(int xc_handle,
    2.23   * Plan 9 memory layout (initial)
    2.24   * ----------------
    2.25   * | info from xen| @0
    2.26 - * ----------------
    2.27 + * ---------------|<--- boot args (start at 0x1200 + 64)
    2.28   * | stack        |
    2.29   * ----------------<--- page 2
    2.30   * | empty        |
    2.31 @@ -658,7 +659,8 @@ loadp9image(gzFile kernel_gfd, int xc_ha
    2.32  	    unsigned long tot_pages, unsigned long *virt_load_addr,
    2.33  	    unsigned long *ksize, unsigned long *symtab_addr,
    2.34  	    unsigned long *symtab_len,
    2.35 -	    unsigned long *first_data_page, unsigned long *pdb_page)
    2.36 +	    unsigned long *first_data_page, unsigned long *pdb_page, 
    2.37 +	    const char *cmdline)
    2.38  {
    2.39  	unsigned long datapage;
    2.40  	Exec ehdr;
    2.41 @@ -669,6 +671,7 @@ loadp9image(gzFile kernel_gfd, int xc_ha
    2.42  	PAGE *image = 0;
    2.43  	unsigned long image_tot_pages = 0;
    2.44  	unsigned long textround;
    2.45 +	static PAGE args;
    2.46  
    2.47  	ret = -1;
    2.48  
    2.49 @@ -736,6 +739,16 @@ loadp9image(gzFile kernel_gfd, int xc_ha
    2.50  			     image, image_tot_pages * 4096, page_array, 0x100);
    2.51  	DPRINTF(("done copying kernel to guest memory\n"));
    2.52  
    2.53 +	/* now do the bootargs */
    2.54 +	/* in plan 9, the x=y bootargs start at 0x1200 + 64 in real memory */
    2.55 +	/* we'll copy to page 1, so we offset into the page struct at 
    2.56 +	 * 0x200 + 64 
    2.57 +	 */
    2.58 +	memset(&args, 0, sizeof(args));
    2.59 +	memcpy(&args.data[0x200 + 64], cmdline, strlen(cmdline));
    2.60 +	printf("Copied :%s: to page for args\n", cmdline);
    2.61 +	ret = memcpy_toguest(xc_handle, dom, &args, sizeof(args), page_array,1);
    2.62 +	dumpit(xc_handle, dom, 0 /*0x100000>>12*/, 4, page_array) ;
    2.63        out:
    2.64  	if (image)
    2.65  		free(image);