[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fix recognition of newer FreeBSD kernels
From: |
Mark Kettenis |
Subject: |
Fix recognition of newer FreeBSD kernels |
Date: |
Sat, 6 Jul 2002 18:09:40 +0200 (CEST) |
This patch makes GRUB recognize newer FreeBSD kernels as such. Tested
with FreeBSD 4.4 GENERIC kernel under bochs.
Mark
Index: ChangeLog
from Mark Kettenis <address@hidden>
* stage2/i386-elf.h (EI_OSABI, EI_ABIVERSION, ELFOSABI_FREEBSD):
New macros.
(EI_PAD): Set to 9.
* stage2/boot.c (load_image): Recognize newer FreeBSD kernels.
Index: stage2/i386-elf.h
===================================================================
RCS file: /cvsroot/grub/grub/stage2/i386-elf.h,v
retrieving revision 1.4
diff -u -p -r1.4 i386-elf.h
--- stage2/i386-elf.h 12 Nov 2001 06:57:29 -0000 1.4
+++ stage2/i386-elf.h 6 Jul 2002 15:58:22 -0000
@@ -51,7 +51,12 @@ typedef struct
#define EI_VERSION 6 /* version number. "e_version" must be the
same */
#define EV_CURRENT 1 /* current version number */
-#define EI_PAD 7 /* from here in is just padding */
+#define EI_OSABI 7 /* operating system/ABI indication */
+
+#define EI_ABIVERSION 8 /* ABI version */
+#define ELFOSABI_FREEBSD 9
+
+#define EI_PAD 9 /* from here in is just padding */
#define EI_BRAND 8 /* start of OS branding (This is
obviously illegal against the ELF
Index: stage2/boot.c
===================================================================
RCS file: /cvsroot/grub/grub/stage2/boot.c,v
retrieving revision 1.40
diff -u -p -r1.40 boot.c
--- stage2/boot.c 22 May 2002 17:08:37 -0000 1.40
+++ stage2/boot.c 6 Jul 2002 15:58:23 -0000
@@ -98,6 +98,7 @@ load_image (char *kernel, char *arg, ker
/* ELF loading supported if multiboot, FreeBSD and NetBSD. */
if ((type == KERNEL_TYPE_MULTIBOOT
|| grub_strcmp (pu.elf->e_ident + EI_BRAND, "FreeBSD") == 0
+ || pu.elf->e_ident[EI_OSABI] == ELFOSABI_FREEBSD
|| suggested_type == KERNEL_TYPE_NETBSD)
&& len > sizeof (Elf32_Ehdr)
&& BOOTABLE_I386_ELF ((*((Elf32_Ehdr *) buffer))))
- Fix recognition of newer FreeBSD kernels,
Mark Kettenis <=