fix serious bugs in embed_func and find_func.

This commit is contained in:
okuji 1999-11-06 12:09:46 +00:00
parent f273c77790
commit ee4e0d44b3
3 changed files with 19 additions and 7 deletions

View file

@ -1,3 +1,14 @@
1999-11-06 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
* grub/asmstub.c (grub_putchar) [HAVE_LIBCURSES]: Do not call
wrefresh. This was just an accident. Sorry.
Reported by Alan McLean <amcl@flash.net>:
* stage2/builtins.c (embed_func): The sector argument for the
function biosdisk is changed from SECTOR + I * SECTOR_SIZE to
SECTOR + I.
(find_func): Clear ERRNUM before each of the attempts.
1999-11-05 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
* docs/multiboot.texi (Boot information format): Add the members

View file

@ -741,10 +741,7 @@ grub_putchar (int c)
{
#ifdef HAVE_LIBCURSES
if (use_curses)
{
addch (c);
wrefresh (stdscr);
}
addch (c);
else
#endif
putchar (c);

View file

@ -645,7 +645,7 @@ embed_func (char *arg, int flags)
grub_memmove ((char *) SCRATCHADDR, stage1_5_buffer + i * SECTOR_SIZE,
SECTOR_SIZE);
if (biosdisk (BIOSDISK_WRITE, current_drive, &buf_geom,
sector + i * SECTOR_SIZE, 1, SCRATCHSEG))
sector + i, 1, SCRATCHSEG))
{
errnum = ERR_WRITE;
return 1;
@ -707,6 +707,7 @@ find_func (char *arg, int flags)
/* Floppies. */
for (drive = 0; drive < 8; drive++)
{
errnum = ERR_NONE;
current_drive = drive;
current_partition = 0xFFFFFF;
@ -731,6 +732,7 @@ find_func (char *arg, int flags)
/* FIXME: is what maximum number right? */
for (slice = 0; slice < 12; slice++)
{
errnum = ERR_NONE;
current_partition = (slice << 16) | 0xFFFF;
if (! open_device () && IS_PC_SLICE_TYPE_BSD (current_slice))
{
@ -738,6 +740,7 @@ find_func (char *arg, int flags)
for (part = 0; part < 8; part++)
{
errnum = ERR_NONE;
current_partition = (slice << 16) | (part << 8) | 0xFF;
if (! open_device ())
continue;
@ -754,6 +757,7 @@ find_func (char *arg, int flags)
}
else
{
errnum = ERR_NONE;
saved_drive = current_drive;
saved_partition = current_partition;
if (grub_open (filename))
@ -765,7 +769,7 @@ find_func (char *arg, int flags)
}
}
errnum = 0;
errnum = ERR_NONE;
saved_drive = tmp_drive;
saved_partition = tmp_partition;
return 0;