fix a bug in stage1_lba, and move all the constants in stage1 to stage1.h

This commit is contained in:
okuji committed 1999-07-13 15:46:28 +00:00
1 parent cb7e6d5e4e
commit 95dfefd185
14 files changed
+238 -75

No files matched your search

+3
View File
@@ -8,6 +8,9 @@ noinst_HEADERS = apic.h defs.h dir.h disk_inode.h disk_inode_ffs.h \
mb_header.h mb_info.h pc_slice.h shared.h smp-imps.h
EXTRA_DIST = smp-imps.c $(noinst_SCRIPTS)
# For <stage1.h>.
INCLUDES = -I$(top_srcdir)/stage1
# The library for /sbin/grub.
noinst_LIBRARIES = libgrub.a
libgrub_a_SOURCES = boot.c common.c char_io.c cmdline.c disk_io.c \
+3
View File
@@ -87,6 +87,9 @@ noinst_HEADERS = apic.h defs.h dir.h disk_inode.h disk_inode_ffs.h \
EXTRA_DIST = smp-imps.c $(noinst_SCRIPTS)
# For <stage1.h>.
INCLUDES = -I$(top_srcdir)/stage1
# The library for /sbin/grub.
noinst_LIBRARIES = libgrub.a
libgrub_a_SOURCES = boot.c common.c char_io.c cmdline.c disk_io.c \
+1 -1
View File
@@ -232,7 +232,7 @@ load_image (void)
/* Remove the "vga=...". */
vga_end = skip_to (0, vga);
grub_memmove (vga, vga_end, grub_strlen (vga_end));
grub_memmove (vga, vga_end, grub_strlen (vga_end) + 1);
}
}
+38 -1
View File
@@ -405,6 +405,41 @@ returnit:
}
else if (grub_open (file))
{
/* If STAGE1_FILE is the LBA version, do a sanity check. */
if (buffer[STAGE1_ID_OFFSET] == STAGE1_ID_LBA)
{
/* The geometry of the drive in which FILE is located. */
struct geometry load_geom;
/* Check if CURRENT_DRIVE is a floppy disk. */
if (! (current_drive & 0x80))
{
errnum = ERR_DEV_VALUES;
goto install_failure;
}
/* Get the geometry of CURRENT_DRIVE. */
if (get_diskinfo (current_drive, &load_geom))
{
errnum = ERR_NO_DISK;
goto install_failure;
}
#ifdef GRUB_UTIL
/* XXX Can we determine if LBA is supported in
/sbin/grub as well? */
grub_printf ("Warning: make sure that the access mode for"
"(hd%d) is LBA.\n", current_drive - 0x80);
#else
/* Check if LBA is supported. */
if (! (load_geom.flags & BIOSDISK_FLAG_LBA_EXTENSION))
{
errnum = ERR_DEV_VALUES;
goto install_failure;
}
#endif
}
if (!new_drive)
new_drive = current_drive;
@@ -488,7 +523,9 @@ returnit:
no_decompression = 0;
#endif
}
install_failure:
/* Error running the install script, so drop to command line. */
if (script)
{
+1 -8
View File
@@ -122,14 +122,7 @@ extern char *grub_scratch_mem;
* (in LSB order)
*/
#define COMPAT_VERSION_MAJOR 2
#define COMPAT_VERSION_MINOR 1
#define COMPAT_VERSION ((COMPAT_VERSION_MINOR<<8)|COMPAT_VERSION_MAJOR)
#define STAGE1_VER_MAJ_OFFS 0x1bc
#define STAGE1_INSTALLSEG 0x1ba
#define STAGE1_INSTALLADDR 0x1b8
#define STAGE1_FIRSTLIST 0x1b5
#include <stage1.h>
#define STAGE2_VER_MAJ_OFFS 0x6
#define STAGE2_INSTALLPART 0x8