From c610524eb0960e039e66d51b3398a704b9a0d043 Mon Sep 17 00:00:00 2001 From: okuji Date: Fri, 16 Mar 2001 09:10:44 +0000 Subject: [PATCH] avoid Linux 2.2.x memory range check bug. --- ChangeLog | 6 ++++++ THANKS | 1 + docs/grub.8 | 2 +- stage2/boot.c | 6 ++++-- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 964142ae6..062f47938 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-03-16 OKUJI Yoshinori + + From Bodo Rueskamp : + * stage2/boot.c (load_initrd): Avoid the last 64kb for + Linux 2.2.x bug. + 2001-03-03 OKUJI Yoshinori * docs/multiboot.texi (History): Written. diff --git a/THANKS b/THANKS index 9cc45d6be..199104fcb 100644 --- a/THANKS +++ b/THANKS @@ -10,6 +10,7 @@ Alessandro Rubini Alexander K. Hudek Andrew Clausen Bernhard Treutwein +Bodo Rueskamp . Bradford Hovinen Brian Brunswick Bryan Ford diff --git a/docs/grub.8 b/docs/grub.8 index 886298820..e9151e57b 100644 --- a/docs/grub.8 +++ b/docs/grub.8 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23. -.TH GRUB "8" "February 2001" "grub (GNU GRUB 0.5.97)" FSF +.TH GRUB "8" "March 2001" "grub (GNU GRUB 0.5.97)" FSF .SH NAME grub \- the grub shell .SH SYNOPSIS diff --git a/stage2/boot.c b/stage2/boot.c index cb3e72681..519766e45 100644 --- a/stage2/boot.c +++ b/stage2/boot.c @@ -632,8 +632,10 @@ load_initrd (char *initrd) moveto = (LINUX_INITRD_MAX_ADDRESS - len) & 0xfffff000; /* XXX: Linux 2.3.xx has a bug in the memory range check, so avoid - the last page. */ - moveto -= 0x1000; + the last page. + XXX: Linux 2.2.xx has a bug in the memory range check, which is + worse than that of Linux 2.3.xx, so avoid the last 64kb. *sigh* */ + moveto -= 0x10000; memmove ((void *) RAW_ADDR (moveto), (void *) cur_addr, len); printf (" [Linux-initrd @ 0x%x, 0x%x bytes]\n", moveto, len);