On Mon, Jun 15, 2009 at 9:41 PM, uzer cheg<userc...@gmail.com> wrote:
> Dear all,
> I'd like to ask you for an advice regarding Xen Dom0 support in
> current Grub2 trunk.
> Has anybody tried to boot Xen Dom0 by Grub2 on latest versions (r 2322
> for instance)?
>
> I installed Debian Linux 5.0 (lenny) with Dom0.
> It works fine and loads in Xen Dom0 via legacy grub supplied by Debian.
> Than I got latest grub2 via svn and built it as usual. Also I made
> custom /grub2/core.img by grub-mkimage
> On start computer loads old legacy grub. Than it loads grub2 as
> # kernel /grub2/core.img
> Grub2 starts fine and I try to load Xen.
> menuentry "xen" {
>
>         multiboot /boot/xen-3.2-1-amd64.gz dom0_mem=640M
>         module /boot/vmlinuz-2.6.26-1-amd64 root=/dev/mapper/mainVG-rootLV ro
>         module /boot/initrd.img-2.6.26-1-amd64
>
> }
>
> It tries to boot and crash with message
> ...
> (XEN) Early fatal page fault at e008:ffff828c801da4a2 ... etc
> (XEN) Stack dump
>
> I tried to load xen by using command
> multiboot /boot/xen-3.2-1-amd64.gz dom0_mem=640M
>
xen 3.3 has a bug which results in this behaviour. Either use xen 3.4
or try attached dirty workaround for grub2
> Result was the same.
>
>
> Please remeber that the same Xen Dom0 boots Ok via grub legacy.
>
> Do I have to add any special commands to grub2.cfg ?
>
> Is it Xen's fault and do I have to upgrade it?
>
>
> Thank you in advance.
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>



-- 
Regards
Vladimir 'phcoder' Serbinenko
diff --git a/loader/i386/multiboot.c b/loader/i386/multiboot.c
index a59085c..9472f61 100644
--- a/loader/i386/multiboot.c
+++ b/loader/i386/multiboot.c
@@ -269,7 +269,8 @@ grub_multiboot (int argc, char *argv[])
   grub_multiboot_payload_size = cmdline_length
     /* boot_loader_name_length might need to grow for mbi,etc to be aligned (see below) */
     + boot_loader_name_length + 3
-    + sizeof (struct grub_multiboot_info) + mmap_length;
+    + sizeof (struct grub_multiboot_info) + mmap_length
+    + 100000;
 
   if (header->flags & MULTIBOOT_AOUT_KLUDGE)
     {
@@ -315,6 +316,7 @@ grub_multiboot (int argc, char *argv[])
   mbi_dest = mbi_addr (grub_multiboot_payload_dest);
   grub_memset (mbi, 0, sizeof (struct grub_multiboot_info));
   mbi->mmap_length = mmap_length;
+  mbi->mods_addr = mmap_addr (grub_multiboot_payload_dest) + mmap_length;
   
   grub_fill_multiboot_mmap (mmap_addr (grub_multiboot_payload_orig));
 
@@ -440,8 +442,8 @@ grub_module  (int argc, char *argv[])
     {
       struct grub_mod_list *modlist = (struct grub_mod_list *) mbi->mods_addr;
 
-      modlist = grub_realloc (modlist, (mbi->mods_count + 1)
-			               * sizeof (struct grub_mod_list));
+      // modlist = grub_realloc (modlist, (mbi->mods_count + 1)
+      //			               * sizeof (struct grub_mod_list));
       if (! modlist)
 	goto fail;
       mbi->mods_addr = (grub_uint32_t) modlist;
@@ -454,7 +456,8 @@ grub_module  (int argc, char *argv[])
     }
   else
     {
-      struct grub_mod_list *modlist = grub_malloc (sizeof (struct grub_mod_list));
+      struct grub_mod_list *modlist = (struct grub_mod_list *) mbi->mods_addr;
+      //      struct grub_mod_list *modlist = grub_malloc (sizeof (struct grub_mod_list));
       if (! modlist)
 	goto fail;
       modlist->mod_start = (grub_uint32_t) module;
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to