All of lore.kernel.org
 help / color / mirror / Atom feed
* grub-mkimage
@ 2006-11-13 18:51 Andrey Shuvikov
  2006-11-25  3:21 ` grub-mkimage Yoshinori K. Okuji
  0 siblings, 1 reply; 4+ messages in thread
From: Andrey Shuvikov @ 2006-11-13 18:51 UTC (permalink / raw)
  To: grub-devel

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: grub-mkimage
  2006-11-13 18:51 grub-mkimage Andrey Shuvikov
@ 2006-11-25  3:21 ` Yoshinori K. Okuji
  0 siblings, 0 replies; 4+ messages in thread
From: Yoshinori K. Okuji @ 2006-11-25  3:21 UTC (permalink / raw)
  To: The development of GRUB 2

On Monday 13 November 2006 19:51, Andrey Shuvikov wrote:
> 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.

Thank you for your patch. I've checked it in right now.

Okuji



^ permalink raw reply	[flat|nested] 4+ messages in thread

* grub-mkimage
@ 2009-03-21 16:26 Rev. Mr. Gary Meerschaert
  2009-03-23 16:40 ` grub-mkimage Pavel Roskin
  0 siblings, 1 reply; 4+ messages in thread
From: Rev. Mr. Gary Meerschaert @ 2009-03-21 16:26 UTC (permalink / raw)
  To: grub-devel

I am getting an error from grub-mkimage. The error is:

grub-mkimage: error: diskboot.img is not one sector size

Does anyone know how I can get this fixed? I am a newbee with grub 
internals, and I don't have a clue as to ho to size the progam.

Thanks,

Gary Meerschaert



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: grub-mkimage
  2009-03-21 16:26 grub-mkimage Rev. Mr. Gary Meerschaert
@ 2009-03-23 16:40 ` Pavel Roskin
  0 siblings, 0 replies; 4+ messages in thread
From: Pavel Roskin @ 2009-03-23 16:40 UTC (permalink / raw)
  To: The development of GRUB 2

On Sat, 2009-03-21 at 12:26 -0400, Rev. Mr. Gary Meerschaert wrote:
> I am getting an error from grub-mkimage. The error is:
> 
> grub-mkimage: error: diskboot.img is not one sector size
> 
> Does anyone know how I can get this fixed? I am a newbee with grub 
> internals, and I don't have a clue as to ho to size the progam.

First of all, please specify the version of GRUB.  I suggest that you
use the current code from Subversion.  I cannot reproduce your problem
with the current code.

Then check if the problem is in grub-mkimage or in diskboot.img.  If
diskboot.img is 512 bytes long, then grub-mkimage is wrong.  If
diskboot.img is not 512 bytes long, then the problem is in diskboot.img.

In any case, please describe your environment, such as the compiler
version, the arguments to the configure script and whatever else may be
needed for others to reproduce your problem.

-- 
Regards,
Pavel Roskin



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-03-23 16:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-21 16:26 grub-mkimage Rev. Mr. Gary Meerschaert
2009-03-23 16:40 ` grub-mkimage Pavel Roskin
  -- strict thread matches above, loose matches on Subject: below --
2006-11-13 18:51 grub-mkimage Andrey Shuvikov
2006-11-25  3:21 ` grub-mkimage Yoshinori K. Okuji

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.