+2009-06-16 Pavel Roskin <proski@gnu.org>
+
+ * boot/i386/pc/boot.S: Remove root_drive. Assert offset of
+ boot_drive_check by using GRUB_BOOT_MACHINE_DRIVE_CHECK. Don't
+ save %dx, we only need %dl and we never change it.
+ * boot/i386/pc/cdboot.S: Don't set the root drive.
+ * boot/i386/pc/pxeboot.S: Likewise.
+ * include/grub/i386/pc/boot.h: Remove
+ GRUB_BOOT_MACHINE_ROOT_DRIVE, adjust
+ GRUB_BOOT_MACHINE_DRIVE_CHECK.
+ * include/grub/i386/pc/kernel.h: Remove grub_root_drive.
+ * kern/i386/pc/init.c (make_install_device): Remove references
+ to grub_root_drive.
+ * kern/i386/pc/startup.S: Likewise.
+ * util/i386/pc/grub-setup.c (setup): Don't set root_drive.
+
2009-06-16 Vladimir Serbinenko <phcoder@gmail.com>
xnu_uuid command
boot_drive:
.byte 0xff /* the disk to load kernel from */
/* 0xff means use the boot drive */
-root_drive:
- .byte 0xff
after_BPB:
* possible boot drive. If GRUB is installed into a floppy,
* this does nothing (only jump).
*/
+ . = _start + GRUB_BOOT_MACHINE_DRIVE_CHECK
boot_drive_check:
jmp 1f /* grub-setup may overwrite this jump */
testb $0x80, %dl
/*
* Check if we have a forced disk reference here
*/
- /* assign root_drive at the same time */
#ifdef APPLE_CC
boot_drive_abs = ABS (boot_drive)
- movw boot_drive_abs, %ax
+ movb boot_drive_abs, %al
#else
- movw ABS(boot_drive), %ax
+ movb ABS(boot_drive), %al
#endif
- movb %ah, %dh
cmpb $0xff, %al
je 1f
movb %al, %dl
/* restore %dl */
popw %dx
- pushw %dx
/* head start */
movb %al, %dh
popw %ds
popa
- popw %dx
/* boot kernel */
#ifdef APPLE_CC
call read_cdrom
- /* Root drive will default to boot drive */
- movb $0xFF, %dh
-
ljmp $(DATA_ADDR >> 4), $0
/*
_start:
start:
- /* Root drive will default to boot drive */
- movb $0xFF, %dh
+ /* Use drive number 0x7F for PXE */
movb $0x7F, %dl
/* Jump to the real world */
/* The offset of BOOT_DRIVE. */
#define GRUB_BOOT_MACHINE_BOOT_DRIVE 0x4c
-/* The offset of ROOT_DRIVE. */
-#define GRUB_BOOT_MACHINE_ROOT_DRIVE 0x4d
-
/* The offset of KERNEL_ADDRESS. */
#define GRUB_BOOT_MACHINE_KERNEL_ADDRESS 0x40
#define GRUB_BOOT_MACHINE_KERNEL_SEGMENT 0x42
/* The offset of BOOT_DRIVE_CHECK. */
-#define GRUB_BOOT_MACHINE_DRIVE_CHECK 0x4f
+#define GRUB_BOOT_MACHINE_DRIVE_CHECK 0x4e
/* The offset of a magic number used by Windows NT. */
#define GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC 0x1b8
/* The boot BIOS drive number. */
extern grub_uint8_t EXPORT_VAR(grub_boot_drive);
-/* The root BIOS drive number. */
-extern grub_uint8_t grub_root_drive;
-
#endif /* ! ASM_FILE */
#endif /* ! KERNEL_MACHINE_HEADER */
if (grub_prefix[0] != '(')
{
- /* If the root drive is not set explicitly, assume that it is identical
- to the boot drive. */
- if (grub_root_drive == 0xFF)
- grub_root_drive = grub_boot_drive;
-
- grub_sprintf (dev, "(%cd%u", (grub_root_drive & 0x80) ? 'h' : 'f',
- grub_root_drive & 0x7f);
+ /* No hardcoded root partition - make it from the boot drive and the
+ partition number encoded at the install time. */
+ grub_sprintf (dev, "(%cd%u", (grub_boot_drive & 0x80) ? 'h' : 'f',
+ grub_boot_drive & 0x7f);
if (grub_install_dos_part >= 0)
grub_sprintf (dev + grub_strlen (dev), ",%u", grub_install_dos_part + 1);
sti /* we're safe again */
- /* save boot and root drive references */
+ /* save the boot drive */
ADDR32 movb %dl, EXT_C(grub_boot_drive)
- ADDR32 movb %dh, EXT_C(grub_root_drive)
/* reset disk system (%ah = 0) */
int $0x13
VARIABLE(grub_boot_drive)
.byte 0
-VARIABLE(grub_root_drive)
- .byte 0
-
.p2align 2 /* force 4-byte alignment */
/*
grub_uint16_t core_sectors;
grub_device_t root_dev, dest_dev;
const char *dest_partmap;
- grub_uint8_t *boot_drive, *root_drive;
+ grub_uint8_t *boot_drive;
grub_disk_addr_t *kernel_sector;
grub_uint16_t *boot_drive_check;
struct boot_blocklist *first_block, *block;
/* Set the addresses of variables in the boot image. */
boot_drive = (grub_uint8_t *) (boot_img + GRUB_BOOT_MACHINE_BOOT_DRIVE);
- root_drive = (grub_uint8_t *) (boot_img + GRUB_BOOT_MACHINE_ROOT_DRIVE);
kernel_sector = (grub_disk_addr_t *) (boot_img
+ GRUB_BOOT_MACHINE_KERNEL_SECTOR);
boot_drive_check = (grub_uint16_t *) (boot_img
/* FIXME: can this be skipped? */
*boot_drive = 0xFF;
- *root_drive = 0xFF;
*kernel_sector = grub_cpu_to_le64 (embed_region.start);
/* FIXME: can this be skipped? */
*boot_drive = 0xFF;
- *root_drive = 0xFF;
*install_dos_part = grub_cpu_to_le32 (dos_part);
*install_bsd_part = grub_cpu_to_le32 (bsd_part);