bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pxegrub to boot a dos image ?


From: Jean-Jacques Michel
Subject: Re: pxegrub to boot a dos image ?
Date: Wed, 13 Mar 2002 10:41:22 +0100

Jean-Jacques Michel wrote:
> 
> Here is a patch to ./stage2/boot.c that I use to make it
> work (tested on 0.5.96.1 & 0.9x) :

Ooops, I forgot there were 2 parts if the diff :
- one for the text_len=0
- one for setup size being too large

Sorry,

-- 
Jean-Jacques Michel mailto:address@hidden 
Hardware Engineer - Linbox http://www.linbox.com
TechnopĂ´le Metz 2000 - 152 rue de Grigy - 57070 Metz - France
Tel : +33 (0)3 87 75 55 21 - Fax : +33 (0)3 87 75 19 26
--- /tmp/boot.c Wed Mar 13 09:40:15 2002
+++ boot.c      Wed Mar 13 10:36:45 2002
@@ -299,7 +299,12 @@
              }
          }
                
-         memmove ((char *) LINUX_SETUP, buffer, data_len + SECTOR_SIZE);
+          if (data_len <= MULTIBOOT_SEARCH)
+          { memmove ((char *) LINUX_SETUP, buffer, data_len + SECTOR_SIZE); }
+          else
+          { memmove ((char *) LINUX_SETUP, buffer, MULTIBOOT_SEARCH);
+            len=grub_read( (char*) LINUX_SETUP + MULTIBOOT_SEARCH, data_len + 
SECTOR_SIZE - MULTIBOOT_SEARCH);
+            /*printf("Grabbing remaining data : %d bytes\n",len);*/ }
 
          if (lh->header != LINUX_MAGIC_SIGNATURE ||
              lh->version < 0x0200)
@@ -340,6 +345,14 @@
 
            *dest = 0;
          }
+
+          if (text_len == 0)
+          {
+             grub_close ();
+             linux_text_len = text_len;
+             cur_addr = LINUX_STAGING_AREA + text_len;
+             return big_linux ? KERNEL_TYPE_BIG_LINUX : KERNEL_TYPE_LINUX;
+          }
 
          /* offset into file */
          grub_seek (data_len + SECTOR_SIZE);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]