fix the NetBSD and OpenBSD boot bug.

This commit is contained in:
okuji 1999-10-12 08:42:11 +00:00
parent 45ec04e62e
commit 41df320a22
7 changed files with 18 additions and 8 deletions

View file

@ -1,3 +1,11 @@
1999-10-12 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
From Pavel Roskin:
* acinclude.m4 (grub_PROG_OBJCOPY_ABSOLUTE): main -> cmain.
* stage2/boot.c (load_image): Only CUR_ADDR, not ENTRY_ADDR
should be 1M-aligned for NetBSD. Don't align symbol table on 4k
boundaries if the kernel doesn't require it.
1999-10-10 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
* stage2/asm.S [!STAGE1_5] (start): New label to force ld quiet.

1
NEWS
View file

@ -2,6 +2,7 @@ NEWS - list of user-visible changes between releases of GRUB
New in 0.5.94:
* Stage 1 supports both the LBA mode and the CHS mode.
* The NetBSD and OpenBSD boot bug is fixed.
New in 0.5.93:
* ELF format of FreeBSD kernel is supported.

1
TODO
View file

@ -26,7 +26,6 @@ Priorities:
* Add indirect block support to the BSD FFS filesystem code, so files
larger than 16MB can be read. !
? Add command for modifying partition types.
* Add OpenBSD support. The recent versions cannot be loaded. !!!
* Fix-up FreeBSD, NetBSD (and OpenBSD ?) command-line boot
parameters. !!
* Add a new installation command, such as `setup', which should be

View file

@ -45,7 +45,7 @@ AC_DEFUN(grub_PROG_OBJCOPY_ABSOLUTE,
AC_CACHE_VAL(grub_cv_prog_objcopy_absolute,
[cat > conftest.c <<\EOF
void
main (void)
cmain (void)
{
*((int *) 0x1000) = 2;
}

2
aclocal.m4 vendored
View file

@ -57,7 +57,7 @@ AC_DEFUN(grub_PROG_OBJCOPY_ABSOLUTE,
AC_CACHE_VAL(grub_cv_prog_objcopy_absolute,
[cat > conftest.c <<\EOF
void
main (void)
cmain (void)
{
*((int *) 0x1000) = 2;
}

2
configure vendored
View file

@ -1590,7 +1590,7 @@ if eval "test \"\${grub_cv_prog_objcopy_absolute+set}\" = set"; then
else
cat > conftest.c <<\EOF
void
main (void)
cmain (void)
{
*((int *) 0x1000) = 2;
}

View file

@ -155,23 +155,24 @@ load_image (char *kernel, char *arg)
* one... plus of course we need to know which booting
* method to use.
*/
entry_addr = (entry_func) ((int) entry_addr & 0xFFFFFF);
if (buffer[0] == 0xb && buffer[1] == 1)
{
type = KERNEL_TYPE_FREEBSD;
entry_addr = (entry_func) (((int) entry_addr) & 0xFFFFFF);
cur_addr = (int) entry_addr;
str2 = "FreeBSD";
}
else
{
type = KERNEL_TYPE_NETBSD;
entry_addr = (entry_func) (((int) entry_addr) & 0xF00000);
cur_addr = (int) entry_addr & 0xF00000;
if (N_GETMAGIC ((*(pu.aout))) != NMAGIC)
align_4k = 0;
str2 = "NetBSD";
}
}
cur_addr = (int) entry_addr;
/* first offset into file */
filepos = N_TXTOFF ((*(pu.aout)));
text_len = pu.aout->a_text;
@ -351,7 +352,8 @@ load_image (char *kernel, char *arg)
int symtab_err, orig_addr = cur_addr;
/* we should align to a 4K boundary here for good measure */
cur_addr = (cur_addr + 0xFFF) & 0xFFFFF000;
if (align_4k)
cur_addr = (cur_addr + 0xFFF) & 0xFFFFF000;
mbi.syms.a.addr = cur_addr;