grub-devel
[Top][All Lists]
Advanced

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

grub-mkimage


From: Andrey Shuvikov
Subject: grub-mkimage
Date: Mon, 13 Nov 2006 10:51:12 -0800 (PST)

Hello,

I was looking into how grub2 works and noticed that in
the load list in grub2/boot/i386/pc/diskboot.S sector
number is 8-byte integer, while 
grub2/util/i386/pc/grub-mkimage.c sets the number of
sectors to load at 4-byte offset. Because of this it
actually patches upper part of the sector rather than
number of sectors.

This is the changes I've made:

======================================================
--- grub-mkimage.old  Mon May 08 14:29:10 2006
+++ grub-mkimage.c  Mon Nov 13 13:41:01 2006
@@ -143,7 +143,7 @@ generate_image (const char *dir,
FILE *o
   
   /* i386 is a little endian architecture.  */
   *((grub_uint16_t *) (boot_img +
GRUB_DISK_SECTOR_SIZE
-          - GRUB_BOOT_MACHINE_LIST_SIZE + 4))
+          - GRUB_BOOT_MACHINE_LIST_SIZE + 8))
     = grub_cpu_to_le16 (num);
 
   grub_util_write_image (boot_img, boot_size, out);
======================================================

Sincerely,
Andrey Shuvikov


 
____________________________________________________________________________________
Yahoo! Music Unlimited
Access over 1 million songs.
http://music.yahoo.com/unlimited




reply via email to

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