sorry, previous email was wrong format. Signed-off-by: ron minnich <rminnich@lanl.gov> ---------- Forwarded message ---------- Date: Thu, 03 Mar 2005 08:10:20 -0700 From: root <root@q.ccstar.lanl.gov> To: rminnich@lanl.gov # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/03/03 05:57:42-07:00 rminnich@q.ccstar.lanl.gov # Plan 9 support for argument passing from /etc/xen/plan9 or similar. Mimics 9load arg passing. # # BitKeeper/etc/logging_ok # 2005/03/03 05:56:11-07:00 rminnich@q.ccstar.lanl.gov +1 -0 # Logging to logging@openlogging.org accepted # # tools/libxc/xc_plan9_build.c # 2005/03/03 05:56:00-07:00 rminnich@q.ccstar.lanl.gov +17 -4 # This is to allow passing of arguments to Plan 9. In /etc/xen/plan9, you can set # extras=''''''\nkeyword=value\nfoo=bar\n'''''' # e.g. # extras=''''''\nventi=#S/sdC0/arenas0\n'''''' # and that arguments will be passed in to plan 9. # diff -Nru a/tools/libxc/xc_plan9_build.c b/tools/libxc/xc_plan9_build.c --- a/tools/libxc/xc_plan9_build.c 2005-03-03 08:10:20 -07:00 +++ b/tools/libxc/xc_plan9_build.c 2005-03-03 08:10:20 -07:00 @@ -125,7 +125,8 @@ unsigned long tot_pages, unsigned long *virt_load_addr, unsigned long *ksize, unsigned long *symtab_addr, unsigned long *symtab_len, - unsigned long *first_data_page, unsigned long *pdb_page); + unsigned long *first_data_page, unsigned long *pdb_page, + const char *cmdline); #define P9ROUND (P9SIZE / 8) @@ -230,7 +231,7 @@ if (loadp9image(kernel_gfd, xc_handle, dom, cpage_array, tot_pages, virt_load_addr, &ksize, &symtab_addr, &symtab_len, - &first_data_page, &first_page_after_kernel)) + &first_data_page, &first_page_after_kernel, cmdline)) goto error_out; DPRINTF(("First data page is 0x%lx\n", first_data_page)); DPRINTF(("First page after kernel is 0x%lx\n", @@ -623,7 +624,7 @@ * Plan 9 memory layout (initial) * ---------------- * | info from xen| @0 - * ---------------- + * ---------------|<--- boot args (start at 0x1200 + 64) * | stack | * ----------------<--- page 2 * | empty | @@ -658,7 +659,8 @@ unsigned long tot_pages, unsigned long *virt_load_addr, unsigned long *ksize, unsigned long *symtab_addr, unsigned long *symtab_len, - unsigned long *first_data_page, unsigned long *pdb_page) + unsigned long *first_data_page, unsigned long *pdb_page, + const char *cmdline) { unsigned long datapage; Exec ehdr; @@ -669,6 +671,7 @@ PAGE *image = 0; unsigned long image_tot_pages = 0; unsigned long textround; + static PAGE args; ret = -1; @@ -736,6 +739,16 @@ image, image_tot_pages * 4096, page_array, 0x100); DPRINTF(("done copying kernel to guest memory\n")); + /* now do the bootargs */ + /* in plan 9, the x=y bootargs start at 0x1200 + 64 in real memory */ + /* we''ll copy to page 1, so we offset into the page struct at + * 0x200 + 64 + */ + memset(&args, 0, sizeof(args)); + memcpy(&args.data[0x200 + 64], cmdline, strlen(cmdline)); + printf("Copied :%s: to page for args\n", cmdline); + ret = memcpy_toguest(xc_handle, dom, &args, sizeof(args), page_array,1); + dumpit(xc_handle, dom, 0 /*0x100000>>12*/, 4, page_array) ; out: if (image) free(image); ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel