Follow-up Comment #7, bug #3404 (project grub):
There is a bug in stage2/char_io.c where addresses are treated as signed,
causing this issue as well as similar ones with memdisk on systems with a
large amount of memory. I'm attacing a patch below against grub 0.97:
diff -burN grub-0.97/stage2/char_io.c grub-0.97-patched/stage2/char_io.c
--- grub-0.97/stage2/char_io.c 2005-02-01 15:51:23.000000000 -0500
+++ grub-0.97-patched/stage2/char_io.c 2006-02-07 16:42:49.674855440 -0500
@@ -1175,7 +1175,7 @@
#endif /* ! STAGE1_5 */
int
-memcheck (int addr, int len)
+memcheck (unsigned int addr, int len)
{
#ifdef GRUB_UTIL
auto int start_addr (void);
@@ -1220,7 +1221,7 @@
void *
grub_memmove (void *to, const void *from, int len)
{
- if (memcheck ((int) to, len))
+ if (memcheck ((unsigned int) to, len))
{
/* This assembly code is stolen from
linux-2.2.2/include/asm-i386/string.h. This is not very fast
@@ -1258,7 +1259,7 @@
{
char *p = start;
- if (memcheck ((int) start, len))
+ if (memcheck ((unsigned int) start, len))
{
while (len -- > 0)
*p ++ = c;
diff -burN grub-0.97/stage2/shared.h grub-0.97-patched/stage2/shared.h
--- grub-0.97/stage2/shared.h 2004-06-19 12:40:09.000000000 -0400
+++ grub-0.97-patched/stage2/shared.h 2006-02-07 16:44:11.288448288 -0500
@@ -911,7 +911,7 @@
int nul_terminate (char *str);
int get_based_digit (int c, int base);
int safe_parse_maxint (char **str_ptr, int *myint_ptr);
-int memcheck (int start, int len);
+int memcheck (unsigned int start, int len);
void grub_putstr (const char *str);
#ifndef NO_DECOMPRESSION
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=3404>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
_______________________________________________
Bug-grub mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-grub