diff --git a/ChangeLog b/ChangeLog index b455fd9bc..ab43332d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +1999-08-12 OKUJI Yoshinori + + * stage1/stage1_lba.S: Use STAGE1_DRP_ADDR for the address of + drive parameters instead of DRIVE_PARAMETER. + (drive_parameter): Deleted. + * stage1/stage1.h (STAGE1_DRP_ADDR): New macro. + (STAGE1_DRP_SIZE): Likewise. + +1999-08-11 OKUJI Yoshinori + + * stage2/bios.c (get_diskinfo): In LBA mode, set TOTAL_SECTORS + to the low 32bits of DRP.TOTAL_SECTORS instead of the multiple + of CHS. + * stage2/cmdline.c (enter_cmdline) [GRUB_UTIL]: In the command + "geometry", print the device file name instead of CHS/LBA + information. + * stage2/shared.h (device_map): Declared. + * grub/asmstub.c (device_map): Defined as a global variable + instead of a local variable. + 1999-08-10 OKUJI Yoshinori Support the NetBSD and OpenBSD partition slices. diff --git a/grub/asmstub.c b/grub/asmstub.c index fd38b9ae4..9e6fece56 100644 --- a/grub/asmstub.c +++ b/grub/asmstub.c @@ -71,7 +71,9 @@ char *grub_scratch_mem = 0; #define NUM_DISKS 256 static struct geometry *disks = 0; -static char **device_map = 0; + +/* The map between BIOS drives and UNIX device file names. */ +char **device_map = 0; /* The main entry point into this mess. */ int diff --git a/stage1/stage1.h b/stage1/stage1.h index de684b5a9..7a7909342 100644 --- a/stage1/stage1.h +++ b/stage1/stage1.h @@ -64,6 +64,12 @@ cannot straddle a 64K boundary. */ #define STAGE1_BUFFERSEG 0x7000 +/* The address of drive parameters. */ +#define STAGE1_DRP_ADDR 0x7f00 + +/* The size of drive parameters. */ +#define STAGE1_DRP_SIZE 0x42 + /* The flag for BIOS drive number to designate a hard disk vs. a floppy. */ #define STAGE1_BIOS_HD_FLAG 0x80 diff --git a/stage1/stage1_lba.S b/stage1/stage1_lba.S index e98a21fc8..516c7349f 100644 --- a/stage1/stage1_lba.S +++ b/stage1/stage1_lba.S @@ -62,7 +62,6 @@ . = _start + 4 /* scratch space */ -drive_parameter: disk_address_packet: /* Actually, must set these values at the runtime. */ .byte 0x10 @@ -118,8 +117,8 @@ after_BPB: /* get the geometry (limited to 2TB!) */ movb $0x48, %ah - movw $ABS(drive_parameter), %si - movw $0x1a, (%si) + movw $STAGE1_DRP_ADDR, %si + movw $STAGE1_DRP_SIZE, (%si) int $0x13 jc lba_probe_error @@ -127,6 +126,9 @@ after_BPB: /* save the total number of sectors */ movl 0x10(%si), %ecx + /* set %si to disk address packet */ + movw $ABS(disk_address_packet), %si + /* this sets up for the first run through "bootloop" */ movw $ABS(firstlist - STAGE1_LISTSIZE), %di diff --git a/stage2/bios.c b/stage2/bios.c index 5f86d2d7b..b02a99103 100644 --- a/stage2/bios.c +++ b/stage2/bios.c @@ -159,10 +159,11 @@ get_diskinfo (int drive, struct geometry *geometry) if (! err) { geometry->flags = BIOSDISK_FLAG_LBA_EXTENSION; - - /* Check if CHS information is valid. */ - if (drp.flags & 0x02) - total_sectors = drp.cylinders * drp.heads * drp.sectors; + + /* FIXME: when the 2TB limit becomes critical, we must + change the type of TOTAL_SECTORS to unsigned long + long. */ + total_sectors = drp.total_sectors & ~0L; } } diff --git a/stage2/cmdline.c b/stage2/cmdline.c index 5e0517cf1..9b426d6eb 100644 --- a/stage2/cmdline.c +++ b/stage2/cmdline.c @@ -675,11 +675,15 @@ returnit: else { char *msg; - + +#ifdef GRUB_UTIL + msg = device_map[current_drive]; +#else if (geom.flags & BIOSDISK_FLAG_LBA_EXTENSION) msg = "LBA"; else msg = "CHS"; +#endif grub_printf ("drive 0x%x: C/H/S = %d/%d/%d, " "The number of sectors = %d, %s\n", diff --git a/stage2/shared.h b/stage2/shared.h index 2f36414e0..8ec61b35e 100644 --- a/stage2/shared.h +++ b/stage2/shared.h @@ -312,6 +312,8 @@ extern int use_curses; extern int verbose; /* The flag for read-only. */ extern int read_only; +/* The map between BIOS drives and UNIX device file names. */ +extern char **device_map; #endif #ifndef STAGE1_5