+2004-05-23 Yoshinori K. Okuji <okuji@enbug.org>
+
+ * stage2/char_io.c (grub_isspace): Use a switch sentense instead
+ of an if sentense, because that reduces the size.
+
+ * lib/device.c (read_device_map): Change the max number of DRIVE
+ to 127 from 8. This was too strict.
+
+ * stage2/asm.S (stop_floppy): Call pusha and popa outside the
+ block of real mode code. Reported by Guillem Jover
+ <guillem@debian.org>.
+
2004-05-20 Damian Ivereigh <damian@cisco.com>
* netboot/main.c: Fixed bootp only code so that options
sysconfdir = @sysconfdir@
target_alias = @target_alias@
sbin_PROGRAMS = grub
-@SERIAL_SPEED_SIMULATION_FALSE@SERIAL_FLAGS = -DSUPPORT_SERIAL=1
@SERIAL_SPEED_SIMULATION_TRUE@SERIAL_FLAGS = -DSUPPORT_SERIAL=1 -DSIMULATE_SLOWNESS_OF_SERIAL=1
+@SERIAL_SPEED_SIMULATION_FALSE@SERIAL_FLAGS = -DSUPPORT_SERIAL=1
-AM_CPPFLAGS = -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 \
- -DFSYS_UFS2=1 \
- -DFSYS_FFS=1 -DFSYS_MINIX=1 -DSUPPORT_HERCULES=1 \
+AM_CPPFLAGS = -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 \
+ -DFSYS_ISO9660=1 -DFSYS_JFS=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 \
+ -DFSYS_UFS2=1 -DFSYS_VSTAFS=1 -DFSYS_XFS=1 \
+ -DUSE_MD5_PASSWORDS=1 -DSUPPORT_HERCULES=1 \
$(SERIAL_FLAGS) -I$(top_srcdir)/stage2 \
-I$(top_srcdir)/stage1 -I$(top_srcdir)/lib
show_error (line_number, "Bad device number");
return 0;
}
- else if (drive > 8)
+ else if (drive > 127)
{
show_warning (line_number,
"Ignoring %cd%d due to a BIOS limitation",
}
#ifdef __linux__
-/* Linux-only function, because Linux has a bug that the disk cache for
+/* Linux-only functions, because Linux has a bug that the disk cache for
a whole disk is not consistent with the one for a partition of the
disk. */
+int
+is_disk_device (char **map, int drive)
+{
+ struct stat st;
+
+ assert (map[drive] != 0);
+ assert (stat (map[drive], &st) == 0);
+ /* For now, disk devices under Linux are all block devices. */
+ return S_ISBLK (st.st_mode);
+}
+
int
write_to_partition (char **map, int drive, int partition,
int sector, int size, const char *buf)
/* device.h - Define macros and declare prototypes for device.c */
/*
* GRUB -- GRand Unified Bootloader
- * Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+ * Copyright (C) 1999,2000,2004 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
extern void restore_device_map (char **map);
#ifdef __linux__
+extern int is_disk_device (char **map, int drive);
extern int write_to_partition (char **map, int drive, int partition,
int offset, int size, const char *buf);
#endif /* __linux__ */
/*
* GRUB -- GRand Unified Bootloader
- * Copyright (C) 1999,2000,2001,2002 Free Software Foundation, Inc.
+ * Copyright (C) 1999,2000,2001,2002,2004 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
* jumped to with a known state.
*/
ENTRY(stop_floppy)
+ pusha
call EXT_C(prot_to_real)
.code16
- pusha
xorb %dl, %dl
int $0x13
- popa
DATA32 call EXT_C(real_to_prot)
.code32
+ popa
ret
/*
int
grub_isspace (int c)
{
- if (c == ' ' || c == '\t' || c == '\r' || c == '\n')
- return 1;
+ switch (c)
+ {
+ case ' ':
+ case '\t':
+ case '\r':
+ case '\n':
+ return 1;
+ default:
+ break;
+ }
return 0;
}
devwrite (int sector, int sector_count, char *buf)
{
#if defined(GRUB_UTIL) && defined(__linux__)
- if (current_partition != 0xFFFFFF)
+ if (current_partition != 0xFFFFFF
+ && is_disk_device (device_map, current_drive))
{
/* If the grub shell is running under Linux and the user wants to
embed a Stage 1.5 into a partition instead of a MBR, use system