[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Error 25: Disk read error
From: |
John Kelly |
Subject: |
Re: Error 25: Disk read error |
Date: |
Mon, 24 Oct 2005 22:05:02 -0400 |
On Mon, 24 Oct 2005 16:17:30 -0400, John Kelly <address@hidden>
wrote:
>Thus it seems the fix will be to reset cur_part_addr when starting a
>new menu entry.
I changed the two cur_part* variables from static to external, and
reset them in cmdline.c, where other global variables are reset when
starting a new menu entry.
That was easier than trying to understand the intricacies of disk_io.c
and how to patch it while keeping the static variables. Maybe someone
more familiar with the code could do that, but since my patch works, I
have no incentive to spend any more time studying it.
For anyone interested, here is the patch.
diff -Nru grub.orig/stage2/cmdline.c grub/stage2/cmdline.c
--- grub.orig/stage2/cmdline.c 2004-08-16 19:25:44.000000000 -0400
+++ grub/stage2/cmdline.c 2005-10-24 20:41:30.000000000 -0400
@@ -25,6 +25,9 @@
# include <etherboot.h>
#endif
+extern unsigned long cur_part_offset;
+extern unsigned long cur_part_addr;
+
grub_jmp_buf restart_cmdline_env;
/* Find the next word from CMDLINE and return the pointer. If
@@ -104,6 +107,8 @@
current_drive = GRUB_INVALID_DRIVE;
errnum = 0;
count_lines = -1;
+ cur_part_offset = 0;
+ cur_part_addr = 0;
/* Restore memory probe state. */
mbi.mem_upper = saved_mem_upper;
diff -Nru grub.orig/stage2/common.c grub/stage2/common.c
--- grub.orig/stage2/common.c 2004-03-27 12:02:54.000000000 -0500
+++ grub/stage2/common.c 2005-10-24 20:41:30.000000000 -0400
@@ -33,6 +33,8 @@
unsigned long saved_drive;
unsigned long saved_partition;
unsigned long cdrom_drive;
+unsigned long cur_part_offset;
+unsigned long cur_part_addr;
#ifndef STAGE1_5
unsigned long saved_mem_upper;
diff -Nru grub.orig/stage2/disk_io.c grub/stage2/disk_io.c
--- grub.orig/stage2/disk_io.c 2004-05-23 12:45:45.000000000 -0400
+++ grub/stage2/disk_io.c 2005-10-24 20:41:30.000000000 -0400
@@ -744,8 +744,8 @@
}
#ifndef STAGE1_5
-static unsigned long cur_part_offset;
-static unsigned long cur_part_addr;
+extern unsigned long cur_part_offset;
+extern unsigned long cur_part_addr;
#endif
/* Open a partition. */