diff --git a/ChangeLog b/ChangeLog index a5a9145a8..8526ccff0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-05-03 Jochen Hoenicke + + * grub/asmstub.c (biosdisk): Work around a bug in linux's ez + remapping. Problem reported by Ben Byer . + 2001-03-28 Gordon Matzigkeit * stage2/boot.c (load_image): Don't cast entry_addr to an int, or diff --git a/grub/asmstub.c b/grub/asmstub.c index 7548856cc..84b1da589 100644 --- a/grub/asmstub.c +++ b/grub/asmstub.c @@ -872,6 +872,19 @@ biosdisk (int subfunc, int drive, struct geometry *geometry, switch (subfunc) { case BIOSDISK_READ: +#ifdef __linux__ + if (sector == 0 && nsec > 1) + { + /* Work around a bug in linux's ez remapping. Linux remaps all + sectors that are read together with the MBR in one read. It + should only remap the MBR, so we split the read in two + parts. -jochen */ + if (nread (fd, buf, SECTOR_SIZE) != SECTOR_SIZE) + return -1; + buf += SECTOR_SIZE; + nsec--; + } +#endif if (nread (fd, buf, nsec * SECTOR_SIZE) != nsec * SECTOR_SIZE) return -1; break;