WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] This patch adjusts the plan9 loader to start "physical"

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] This patch adjusts the plan9 loader to start "physical" ram at
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 31 Aug 2005 08:46:10 +0000
Delivery-date: Wed, 31 Aug 2005 08:44:38 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 7032428bc8207ecbc409d33d9248a60e0dcbf5d7
# Parent  331c256d8e5c31fba77d3046817aae49a126d5c2
This patch adjusts the plan9 loader to start "physical" ram at
0x80000000 virtual rather than the virtual address of the kernel
image (which is higher).

Tim Newsham

diff -r 331c256d8e5c -r 7032428bc820 tools/libxc/xc_load_aout9.c
--- a/tools/libxc/xc_load_aout9.c       Wed Aug 31 08:43:57 2005
+++ b/tools/libxc/xc_load_aout9.c       Wed Aug 31 08:45:10 2005
@@ -15,6 +15,8 @@
 
 #define round_pgup(_p)    (((_p)+(PAGE_SIZE-1))&PAGE_MASK)
 #define round_pgdown(_p)  ((_p)&PAGE_MASK)
+#define KZERO             0x80000000
+#define KOFFSET(_p)       ((_p)&~KZERO)
 
 static int parseaout9image(char *, unsigned long, struct domain_setup_info *);
 static int loadaout9image(char *, unsigned long, int, u32, unsigned long *, 
struct domain_setup_info *);
@@ -63,7 +65,7 @@
     txtsz = round_pgup(ehdr.text);
     end = start + txtsz + ehdr.data + ehdr.bss;
 
-    dsi->v_start       = start;
+    dsi->v_start       = KZERO;
     dsi->v_kernstart   = start;
     dsi->v_kernend     = end;
     dsi->v_kernentry   = ehdr.entry;
@@ -83,19 +85,19 @@
     struct domain_setup_info *dsi)
 {
     struct Exec ehdr;
-    unsigned long txtsz;
+    unsigned long start, txtsz;
 
     if (!get_header(image, image_size, &ehdr)) {
         ERROR("Kernel image does not have a a.out9 header.");
         return -EINVAL;
     }
 
+    start = round_pgdown(ehdr.entry);
     txtsz = round_pgup(ehdr.text);
     copyout(xch, dom, parray, 
-            0, image, sizeof ehdr + ehdr.text);
+            start, image, sizeof ehdr + ehdr.text);
     copyout(xch, dom, parray, 
-            txtsz, image + sizeof ehdr + ehdr.text, ehdr.data);
-    /* XXX zeroing of BSS needed? */
+            start+txtsz, image + sizeof ehdr + ehdr.text, ehdr.data);
 
     /* XXX load symbols */
 
@@ -110,13 +112,14 @@
 copyout(
     int xch, u32 dom,
     unsigned long *parray,
-    unsigned long off,
+    unsigned long addr,
     void *buf,
     int sz)
 {
-    unsigned long pgoff, chunksz;
+    unsigned long pgoff, chunksz, off;
     void *pg;
 
+    off = KOFFSET(addr);
     while (sz > 0) {
         pgoff = off & (PAGE_SIZE-1);
         chunksz = sz;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] This patch adjusts the plan9 loader to start "physical" ram at, Xen patchbot -unstable <=