Subject: Using GRUB to boot the kernel directly
To: None <port-i386@netbsd.org>
From: Doug Munford <doug@sporadic.net>
List: port-i386
Date: 12/07/2004 21:37:23
Hi,

I've been bitten by PR 26007 with NetBSD 2.0 on my EPIA 5000 (mini-itx)=20=

machine.
To get around this until it is fixed I had the idea to use GRUB from=20
pkgsrc and get that to boot the kernel directly. The unofficial 2.0=20
LiveCD by J=F6rg Braun gave me this idea as it uses GRUB and boots=20
perfectly on the problem hardware.
I've been using a sacrificial machine (official bootcode compatable) as=20=

a testbed for this. This machine has a full install from a CD I made=20
from the 2.0 ISO.
I have not recompiled the kernel or done anything other than set-up=20
basic networking.
The HD is configured in LBA mode in the BIOS, the whole disk is taken=20
as a NetBSD slice and wd0a is the (small) / partition. I should perhaps=20=

add that I configured this as FFS2.
I installed the GRUB package, copied the contents of=20
/usr/pkg/share/grub/i386- over to /grub then created a menu.lst file:

default=3D0
timeout=3D10
title NetBSD 2.0
root (hd0,0,a)
kernel /netbsd --type=3Dnetbsd

I then installed GRUB to the MBR:
#grub
grub> root (hd0,0,a)
grub> setup (hd0)

On rebooting GRUB brings up the menu with my configured item however on=20=

trying to execute that I get an error after it recognises the disk:

   Booting 'NetBSD 2.0'

root (hd0,0,a)
  Filesystem type is ufs2, partition type 0xa9
kernel /netbsd --type=3Dnetbsd
     [NetBSD-elf, <0x100000:0x817b34:0x0>

Error 13: Invalid or unsupported executable format

Any ideas why this wouldn't work? Is there anything I'm missing? Has=20
anyone else managed to use GRUB in this way rather than chainloading?

Cheers,
Doug.=