From e4d47d8d64af0f28897412a912972a4674e8db3a Mon Sep 17 00:00:00 2001 From: Robert Millan Date: Thu, 24 Dec 2009 14:09:06 +0000 Subject: [PATCH] 2009-12-24 Robert Millan For consistency with [multiboot]/docs/boot.S. * include/multiboot.h (MULTIBOOT_MAGIC): Rename from this ... (MULTIBOOT_HEADER_MAGIC): ... to this. Update all users. (MULTIBOOT_MAGIC2): Rename from this ... (MULTIBOOT_BOOTLOADER_MAGIC): ... to this. Update all users. --- ChangeLog | 9 +++++++++ boot/i386/pc/lnxboot.S | 2 +- include/multiboot.h | 4 ++-- kern/i386/coreboot/startup.S | 2 +- loader/i386/multiboot.c | 4 ++-- loader/multiboot_loader.c | 2 +- 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index ace5185de..125b8af52 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-12-24 Robert Millan + + For consistency with [multiboot]/docs/boot.S. + + * include/multiboot.h (MULTIBOOT_MAGIC): Rename from this ... + (MULTIBOOT_HEADER_MAGIC): ... to this. Update all users. + (MULTIBOOT_MAGIC2): Rename from this ... + (MULTIBOOT_BOOTLOADER_MAGIC): ... to this. Update all users. + 2009-12-24 Robert Millan * include/multiboot.h: Remove `'. diff --git a/boot/i386/pc/lnxboot.S b/boot/i386/pc/lnxboot.S index c51741d42..43d170c6e 100644 --- a/boot/i386/pc/lnxboot.S +++ b/boot/i386/pc/lnxboot.S @@ -185,7 +185,7 @@ real_code_2: call LOCAL(move_memory) /* Check for multiboot signature. */ - cmpl $MULTIBOOT_MAGIC, %ss:(DATA_ADDR + GRUB_KERNEL_MACHINE_DATA_END) + cmpl $MULTIBOOT_HEADER_MAGIC, %ss:(DATA_ADDR + GRUB_KERNEL_MACHINE_DATA_END) jz 1f movl (ramdisk_image - start), %esi diff --git a/include/multiboot.h b/include/multiboot.h index 92e00010c..3d93070bb 100644 --- a/include/multiboot.h +++ b/include/multiboot.h @@ -27,10 +27,10 @@ #define MULTIBOOT_SEARCH 8192 /* The magic field should contain this. */ -#define MULTIBOOT_MAGIC 0x1BADB002 +#define MULTIBOOT_HEADER_MAGIC 0x1BADB002 /* This should be in %eax. */ -#define MULTIBOOT_MAGIC2 0x2BADB002 +#define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002 /* The bits in the required part of flags field we don't support. */ #define MULTIBOOT_UNSUPPORTED 0x0000fffc diff --git a/kern/i386/coreboot/startup.S b/kern/i386/coreboot/startup.S index 3f2dd5f50..e94950aae 100644 --- a/kern/i386/coreboot/startup.S +++ b/kern/i386/coreboot/startup.S @@ -66,7 +66,7 @@ multiboot_header: .long -0x1BADB002 - MULTIBOOT_MEMORY_INFO codestart: - cmpl $MULTIBOOT_MAGIC2, %eax + cmpl $MULTIBOOT_BOOTLOADER_MAGIC, %eax jne 0f movl %ebx, EXT_C(startup_multiboot_info) 0: diff --git a/loader/i386/multiboot.c b/loader/i386/multiboot.c index be824e2f4..a78ab60b7 100644 --- a/loader/i386/multiboot.c +++ b/loader/i386/multiboot.c @@ -65,7 +65,7 @@ grub_multiboot_boot (void) { struct grub_relocator32_state state = { - .eax = MULTIBOOT_MAGIC2, + .eax = MULTIBOOT_BOOTLOADER_MAGIC, .ebx = PTR_TO_UINT32 (mbi_dest), .ecx = 0, .edx = 0, @@ -250,7 +250,7 @@ grub_multiboot (int argc, char *argv[]) ((char *) header <= buffer + len - 12) || (header = 0); header = (struct multiboot_header *) ((char *) header + 4)) { - if (header->magic == MULTIBOOT_MAGIC + if (header->magic == MULTIBOOT_HEADER_MAGIC && !(header->magic + header->flags + header->checksum)) break; } diff --git a/loader/multiboot_loader.c b/loader/multiboot_loader.c index 9078d0622..11f2524cc 100644 --- a/loader/multiboot_loader.c +++ b/loader/multiboot_loader.c @@ -58,7 +58,7 @@ find_multi_boot1_header (grub_file_t file) ((char *) header <= buffer + len - 12) || (header = 0); header = (struct multiboot_header *) ((char *) header + 4)) { - if (header->magic == MULTIBOOT_MAGIC + if (header->magic == MULTIBOOT_HEADER_MAGIC && !(header->magic + header->flags + header->checksum)) { found_status = 1;