change the location of the boot partition table.
This commit is contained in:
parent
c62dcb6fa0
commit
a936d03921
5 changed files with 39 additions and 11 deletions
18
ChangeLog
18
ChangeLog
|
@ -1,3 +1,21 @@
|
||||||
|
2000-02-21 OKUJI Yoshinori <okuji@gnu.org>
|
||||||
|
|
||||||
|
* stage2/disk_io.c (check_BSD_parts) [!STAGE1_5]: Use the term
|
||||||
|
"BSD sub-partition" instead of "BSD slice" for consistency.
|
||||||
|
|
||||||
|
* stage2/builtins.c (boot_func): Copy the partition table to
|
||||||
|
BOOT_PART_TABLE instead of (BOOTSEC_LOCATION +
|
||||||
|
BOOTSEC_PART_OFFSET). Don't use grub_memmove, but copy it
|
||||||
|
directly, since memcheck is too strict.
|
||||||
|
* stage2/disk_io.c (real_open_partition) [!STAGE1_5]: Set
|
||||||
|
CUR_PART_ADDR to (BOOT_PART_TABLE + (i << 4)).
|
||||||
|
* stage2/shared.h (BOOT_PART_TABLE): New macro.
|
||||||
|
(chain_stage1): Change the types of all the arguments to
|
||||||
|
unsigned long.
|
||||||
|
(chain_stage2): Likewise.
|
||||||
|
* grub/asmstub.c (chain_stage1): Adjusted to the prototype.
|
||||||
|
(chain_stage2): Likewise.
|
||||||
|
|
||||||
2000-02-21 OKUJI Yoshinori <okuji@gnu.org>
|
2000-02-21 OKUJI Yoshinori <okuji@gnu.org>
|
||||||
|
|
||||||
* stage2/disk_io.c (check_BSD_parts) [!STAGE1_5]: If the BSD
|
* stage2/disk_io.c (check_BSD_parts) [!STAGE1_5]: If the BSD
|
||||||
|
|
|
@ -580,14 +580,15 @@ stop (void)
|
||||||
|
|
||||||
/* calls for direct boot-loader chaining */
|
/* calls for direct boot-loader chaining */
|
||||||
void
|
void
|
||||||
chain_stage1 (int segment, int offset, int part_table_addr)
|
chain_stage1 (unsigned long segment, unsigned long offset,
|
||||||
|
unsigned long part_table_addr)
|
||||||
{
|
{
|
||||||
stop ();
|
stop ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
chain_stage2 (int segment, int offset)
|
chain_stage2 (unsigned long segment, unsigned long offset)
|
||||||
{
|
{
|
||||||
stop ();
|
stop ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -218,10 +218,12 @@ boot_func (char *arg, int flags)
|
||||||
gateA20 (0);
|
gateA20 (0);
|
||||||
boot_drive = saved_drive;
|
boot_drive = saved_drive;
|
||||||
|
|
||||||
/* Copy the boot partition information to the chain-loader, if
|
/* Copy the boot partition information to 0x7be-0x7fd, if
|
||||||
BOOT_DRIVE is a hard disk drive. */
|
BOOT_DRIVE is a hard disk drive. */
|
||||||
if (boot_drive & 0x80)
|
if (boot_drive & 0x80)
|
||||||
{
|
{
|
||||||
|
char *dst, *src;
|
||||||
|
|
||||||
/* Read the MBR here, because it might be modified
|
/* Read the MBR here, because it might be modified
|
||||||
after opening the partition. */
|
after opening the partition. */
|
||||||
if (! rawread (boot_drive, boot_part_offset,
|
if (! rawread (boot_drive, boot_part_offset,
|
||||||
|
@ -232,10 +234,13 @@ boot_func (char *arg, int flags)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Need only the partition table. */
|
/* Need only the partition table.
|
||||||
grub_memmove ((char *) BOOTSEC_LOCATION + BOOTSEC_PART_OFFSET,
|
XXX: We cannot use grub_memmove because BOOT_PART_TABLE
|
||||||
(char *) SCRATCHADDR + BOOTSEC_PART_OFFSET,
|
(0x07be) is less than 0x1000. */
|
||||||
BOOTSEC_PART_LENGTH);
|
dst = (char *) BOOT_PART_TABLE;
|
||||||
|
src = (char *) SCRATCHADDR + BOOTSEC_PART_OFFSET;
|
||||||
|
while (dst < (char *) BOOT_PART_TABLE + BOOTSEC_PART_LENGTH)
|
||||||
|
*dst++ = *src++;
|
||||||
}
|
}
|
||||||
|
|
||||||
chain_stage1 (0, BOOTSEC_LOCATION, boot_part_addr);
|
chain_stage1 (0, BOOTSEC_LOCATION, boot_part_addr);
|
||||||
|
|
|
@ -485,7 +485,7 @@ check_BSD_parts (int flags)
|
||||||
if (flags)
|
if (flags)
|
||||||
{
|
{
|
||||||
if (! do_completion)
|
if (! do_completion)
|
||||||
grub_printf (" No BSD slice found, partition type 0x%x\n",
|
grub_printf (" No BSD sub-partition found, partition type 0x%x\n",
|
||||||
current_slice);
|
current_slice);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -571,7 +571,7 @@ real_open_partition (int flags)
|
||||||
part_length = PC_SLICE_LENGTH (mbr_buf, i);
|
part_length = PC_SLICE_LENGTH (mbr_buf, i);
|
||||||
#ifndef STAGE1_5
|
#ifndef STAGE1_5
|
||||||
cur_part_offset = part_offset;
|
cur_part_offset = part_offset;
|
||||||
cur_part_addr = BOOTSEC_LOCATION + PC_SLICE_OFFSET + (i << 4);
|
cur_part_addr = BOOT_PART_TABLE + (i << 4);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -69,6 +69,8 @@ extern char *grub_scratch_mem;
|
||||||
#define BUFFERADDR RAW_ADDR (0x70000)
|
#define BUFFERADDR RAW_ADDR (0x70000)
|
||||||
#define BUFFERSEG RAW_SEG (0x7000)
|
#define BUFFERSEG RAW_SEG (0x7000)
|
||||||
|
|
||||||
|
#define BOOT_PART_TABLE RAW_ADDR (0x07be)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* BIOS disk defines
|
* BIOS disk defines
|
||||||
*/
|
*/
|
||||||
|
@ -557,9 +559,11 @@ extern unsigned short ascii_key_map[];
|
||||||
extern unsigned short io_map[];
|
extern unsigned short io_map[];
|
||||||
|
|
||||||
/* calls for direct boot-loader chaining */
|
/* calls for direct boot-loader chaining */
|
||||||
void chain_stage1 (int segment, int offset, int part_table_addr)
|
void chain_stage1 (unsigned long segment, unsigned long offset,
|
||||||
|
unsigned long part_table_addr)
|
||||||
|
__attribute__ ((noreturn));
|
||||||
|
void chain_stage2 (unsigned long segment, unsigned long offset)
|
||||||
__attribute__ ((noreturn));
|
__attribute__ ((noreturn));
|
||||||
void chain_stage2 (int segment, int offset) __attribute__ ((noreturn));
|
|
||||||
|
|
||||||
/* do some funky stuff, then boot linux */
|
/* do some funky stuff, then boot linux */
|
||||||
void linux_boot (void) __attribute__ ((noreturn));
|
void linux_boot (void) __attribute__ ((noreturn));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue