mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 14:59:34 +00:00
2002-02-08 Yoshinori K. Okuji <okuji@enbug.org>
* stage2/fsys_jfs.c (jfs_read) [STAGE1_5]: Set and reset DISK_READ_FUNC even in Stage 1.5. * stage2/fsys_xfs.c (xfs_read) [STAGE1_5]: Likewise. * stage2/stage1_5.c (saved_sector): Initialized with -1. (cmain): Check if SAVED_SECTOR was set appropriately after reading the second sector of Stage 2. If SAVED_SECTOR is not set (i.e. it is equal to -1), print an error and stop.
This commit is contained in:
1 parent
93718b5a41
commit
9f4689e21d
4 files changed
+27
-13
No files matched your search
+10
-3
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
* Copyright (C) 2001,2002 Free Software Foundation, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "shared.h"
|
||||
|
||||
static int saved_sector;
|
||||
static int saved_sector = -1;
|
||||
|
||||
static void
|
||||
disk_read_savesect_func (int sector, int offset, int length)
|
||||
@@ -30,7 +30,7 @@ disk_read_savesect_func (int sector, int offset, int length)
|
||||
void
|
||||
cmain (void)
|
||||
{
|
||||
printf ("\n\nGRUB loading, please wait...\n");
|
||||
grub_printf ("\n\nGRUB loading, please wait...\n");
|
||||
|
||||
/*
|
||||
* Here load the true second-stage boot-loader.
|
||||
@@ -43,6 +43,13 @@ cmain (void)
|
||||
disk_read_hook = disk_read_savesect_func;
|
||||
grub_read ((char *) 0x8000, SECTOR_SIZE * 2);
|
||||
disk_read_hook = NULL;
|
||||
|
||||
/* Sanity check: catch an internal error. */
|
||||
if (saved_sector == -1)
|
||||
{
|
||||
grub_printf ("internal error: the second sector of Stage 2 is unknown.");
|
||||
stop ();
|
||||
}
|
||||
|
||||
ret = grub_read ((char *) 0x8000 + SECTOR_SIZE * 2, -1);
|
||||
|
||||
|
||||
Reference in new issue
Block a user