2009-09-24 Robert Millan <rmh.grub@aybabtu.com>
* util/i386/pc/grub-mkimage.c (generate_image): Enclose BIOS-specific size check within GRUB_MACHINE_PCBIOS section.
This commit is contained in:
parent
74c958b180
commit
c6dcedf6b2
2 changed files with 27 additions and 23 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2009-09-24 Robert Millan <rmh.grub@aybabtu.com>
|
||||||
|
|
||||||
|
* util/i386/pc/grub-mkimage.c (generate_image): Enclose BIOS-specific
|
||||||
|
size check within GRUB_MACHINE_PCBIOS section.
|
||||||
|
|
||||||
2009-09-24 Robert Millan <rmh.grub@aybabtu.com>
|
2009-09-24 Robert Millan <rmh.grub@aybabtu.com>
|
||||||
|
|
||||||
* include/grub/i386/at_keyboard.h (KEYBOARD_ISREADY): Negate
|
* include/grub/i386/at_keyboard.h (KEYBOARD_ISREADY): Negate
|
||||||
|
|
|
@ -97,7 +97,6 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
|
||||||
size_t kernel_size, boot_size, total_module_size, core_size;
|
size_t kernel_size, boot_size, total_module_size, core_size;
|
||||||
size_t memdisk_size = 0, config_size = 0;
|
size_t memdisk_size = 0, config_size = 0;
|
||||||
char *kernel_path, *boot_path;
|
char *kernel_path, *boot_path;
|
||||||
unsigned num;
|
|
||||||
size_t offset;
|
size_t offset;
|
||||||
struct grub_util_path_list *path_list, *p, *next;
|
struct grub_util_path_list *path_list, *p, *next;
|
||||||
struct grub_module_info *modinfo;
|
struct grub_module_info *modinfo;
|
||||||
|
@ -196,30 +195,30 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
|
||||||
|
|
||||||
grub_util_info ("the core size is 0x%x", core_size);
|
grub_util_info ("the core size is 0x%x", core_size);
|
||||||
|
|
||||||
num = ((core_size + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS);
|
|
||||||
if (num > 0xffff)
|
|
||||||
grub_util_error ("the core image is too big");
|
|
||||||
|
|
||||||
#if defined(GRUB_MACHINE_PCBIOS)
|
#if defined(GRUB_MACHINE_PCBIOS)
|
||||||
|
{
|
||||||
|
unsigned num;
|
||||||
|
num = ((core_size + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS);
|
||||||
|
if (num > 0xffff)
|
||||||
|
grub_util_error ("the core image is too big");
|
||||||
|
|
||||||
boot_path = grub_util_get_path (dir, "diskboot.img");
|
boot_path = grub_util_get_path (dir, "diskboot.img");
|
||||||
boot_size = grub_util_get_image_size (boot_path);
|
boot_size = grub_util_get_image_size (boot_path);
|
||||||
if (boot_size != GRUB_DISK_SECTOR_SIZE)
|
if (boot_size != GRUB_DISK_SECTOR_SIZE)
|
||||||
grub_util_error ("diskboot.img is not one sector size");
|
grub_util_error ("diskboot.img is not one sector size");
|
||||||
|
|
||||||
boot_img = grub_util_read_image (boot_path);
|
boot_img = grub_util_read_image (boot_path);
|
||||||
|
|
||||||
/* i386 is a little endian architecture. */
|
/* i386 is a little endian architecture. */
|
||||||
*((grub_uint16_t *) (boot_img + GRUB_DISK_SECTOR_SIZE
|
*((grub_uint16_t *) (boot_img + GRUB_DISK_SECTOR_SIZE
|
||||||
- GRUB_BOOT_MACHINE_LIST_SIZE + 8))
|
- GRUB_BOOT_MACHINE_LIST_SIZE + 8))
|
||||||
= grub_cpu_to_le16 (num);
|
= grub_cpu_to_le16 (num);
|
||||||
|
|
||||||
grub_util_write_image (boot_img, boot_size, out);
|
|
||||||
free (boot_img);
|
|
||||||
free (boot_path);
|
|
||||||
|
|
||||||
|
grub_util_write_image (boot_img, boot_size, out);
|
||||||
|
free (boot_img);
|
||||||
|
free (boot_path);
|
||||||
|
}
|
||||||
#elif defined(GRUB_MACHINE_QEMU)
|
#elif defined(GRUB_MACHINE_QEMU)
|
||||||
|
|
||||||
{
|
{
|
||||||
char *rom_img;
|
char *rom_img;
|
||||||
size_t rom_size;
|
size_t rom_size;
|
||||||
|
|
Loading…
Reference in a new issue