From 6d4bf545d3a3891f6c34a69396a68f6484d60288 Mon Sep 17 00:00:00 2001 From: okuji Date: Mon, 29 Apr 2002 18:52:16 +0000 Subject: [PATCH] 2002-04-30 Yoshinori K. Okuji * stage2/boot.c (load_image): For Linux, don't check if the length of protected mode code is greater than or equal to the expected length minus 16. Instead, just check if no error occurred. That was problematic, because memdisk has no protected mode code. Also, I don't see what the magic number 16 was for. --- ChangeLog | 8 ++++++++ stage2/boot.c | 9 +++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 582f40f8d..1eeeb7ddb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2002-04-30 Yoshinori K. Okuji + + * stage2/boot.c (load_image): For Linux, don't check if the + length of protected mode code is greater than or equal to the + expected length minus 16. Instead, just check if no error + occurred. That was problematic, because memdisk has no protected + mode code. Also, I don't see what the magic number 16 was for. + 2002-04-29 Yoshinori K. Okuji * stage2/builtins.c [SUPPORT_SERIAL] (terminal_func): Added a diff --git a/stage2/boot.c b/stage2/boot.c index cc23a052e..ab8f8bc36 100644 --- a/stage2/boot.c +++ b/stage2/boot.c @@ -399,8 +399,9 @@ load_image (char *kernel, char *arg, kernel_t suggested_type, grub_seek (data_len + SECTOR_SIZE); cur_addr = LINUX_STAGING_AREA + text_len; - if (grub_read ((char *) LINUX_STAGING_AREA, text_len) - >= (text_len - 16)) + grub_read ((char *) LINUX_STAGING_AREA, text_len); + + if (errnum == ERR_NONE) { grub_close (); @@ -418,8 +419,8 @@ load_image (char *kernel, char *arg, kernel_t suggested_type, return big_linux ? KERNEL_TYPE_BIG_LINUX : KERNEL_TYPE_LINUX; } - else if (! errnum) - errnum = ERR_EXEC_FORMAT; + + grub_close (); } else errnum = ERR_WONT_FIT;