* util/grub-mkimage.c (generate_image): Decrease the higher limit

because of stack.
	* util/grub-setup.c (setup): Don't add redundancy past the higher load
	limit.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-12-15 19:39:41 +01:00
parent c476e6df16
commit 5ef5c51147
3 changed files with 14 additions and 3 deletions

View file

@ -1,3 +1,10 @@
2011-12-15 Vladimir Serbinenko <phcoder@gmail.com>
* util/grub-mkimage.c (generate_image): Decrease the higher limit
because of stack.
* util/grub-setup.c (setup): Don't add redundancy past the higher load
limit.
2011-12-15 Vladimir Serbinenko <phcoder@gmail.com> 2011-12-15 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/gfxmenu/gui_label.c (label_paint): Handle the case * grub-core/gfxmenu/gui_label.c (label_paint): Handle the case

View file

@ -958,10 +958,10 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
char *boot_path, *boot_img; char *boot_path, *boot_img;
size_t boot_size; size_t boot_size;
if (GRUB_KERNEL_I386_PC_LINK_ADDR + core_size > GRUB_MEMORY_I386_PC_UPPER) if (GRUB_KERNEL_I386_PC_LINK_ADDR + core_size > 0x78000)
grub_util_error (_("core image is too big (%p > %p)"), grub_util_error (_("core image is too big (0x%x > 0x%x)"),
GRUB_KERNEL_I386_PC_LINK_ADDR + core_size, GRUB_KERNEL_I386_PC_LINK_ADDR + core_size,
GRUB_MEMORY_I386_PC_UPPER); 0x78000);
num = ((core_size + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS); num = ((core_size + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS);
if (num > 0xffff) if (num > 0xffff)

View file

@ -412,6 +412,10 @@ setup (const char *dir,
if (nsec > 2 * core_sectors) if (nsec > 2 * core_sectors)
nsec = 2 * core_sectors; nsec = 2 * core_sectors;
if (nsec > ((0x78000 - GRUB_KERNEL_I386_PC_LINK_ADDR)
>> GRUB_DISK_SECTOR_BITS))
nsec = ((0x78000 - GRUB_KERNEL_I386_PC_LINK_ADDR)
>> GRUB_DISK_SECTOR_BITS);
/* Clean out the blocklists. */ /* Clean out the blocklists. */
block = first_block; block = first_block;