Subject: Re: booting NetBSD i386 with grub
To: Rudi Ludwig <rudihl@gmx.de>
From: Chavdar Ivanov <ci4ic4@gmail.com>
List: netbsd-help
Date: 05/29/2006 20:56:55
On 5/29/06, Rudi Ludwig <rudihl@gmx.de> wrote:
>
> Hello,
Hi,
>
> in a multi-boot setup I need to boot NetBSD i386
> with grub. With some google-search I found the
> grub docu but I couldn't figure the complete lines.
>

There has been a bit of a discussion about this the last couple of
days on netbsd-current list - check gmane if you want to have a look.

This is my menu.lst file (the first four lines do not work with the
version of grub from pkgsrc - they are from a Solaris setup, but don't
cause trouble here):

+++++++++++++++++++++++
splashimage /grub/os-boot.xpm
foreground  =3D 5381a1
background  =3D e0e0e0
color light-gray/blue black/light-gray
default 2
timeout 10

title W2K
rootnoverify (hd0,1)
makeactive
chainloader +1
boot

title NetBSD-chain
root (hd0,2,a)       # NetBSD on 3rd MBR partition of 1st IDE disk
chainloader +1

title NetBSD
root (hd0,2,a)
kernel /netbsd console=3Dpc root=3Dwd0a

title NetBSD-noMB
root (hd0,2,a)
kernel  --type=3Dnetbsd /m0 console=3Dpc root=3Dwd0a

title NetBSD-single
root (hd0,2,a)
kernel /netbsd -s console=3Dpc root=3Dwd0a

title NetBSD-conf
root (hd0,2,a)
kernel /netbsd -c console=3Dpc root=3Dwd0a

title NetBSD-old
root (hd0,2,a)
kernel /onetbsd -c console=3Dpc root=3Dwd0a

title Setup GRUB
root (hd0,0)
setup (hd0)
-------------------------------------------------
> What I got so far: grub finds the kernel, the kernel
> goes through the hw but then falls kind of helpless
> and asks for
>
> - root-device
> - dump-device
> - file system
> - init-path (/sbin/init)

You get this, if you have kernel --type=3Dnetbsd, as in my entry No.3 .
The parameters do not get passed if MULTIBOOT is disabled in the
kernel.

The easiest is to use the entry No.1 - chainload. The NetBSD kernel
does not have any knowledge about grub.

My default entry, as you can see, happens to be No.2 - this requires

options         MULTIBOOT       # Multiboot support (see multiboot(8))
options         MULTIBOOT_SYMTAB_SPACE=3D1048576

in the kernel, you get:

...
 NetBSD 3.99.20 (M0) #2: Sat May 27 00:54:24 BST 2006
        root@maggie:/usr/src/sys/arch/i386/compile/M0
multiboot: Information structure flags: 0x000007e7
multiboot: Boot loader: GNU GRUB 0.97
multiboot: Command line: /netbsd console=3Dpc root=3Dwd0a
multiboot: 638 KB lower memory, 523200 KB upper memory
total memory =3D 511 MB
avail memory =3D 495 MB
...

multiboot messages, but unfortunately there may be some side effects -
as happened to me a few days ago - if the kernel had 'pseudo-device
ksyms', then netstat would not work. (One certainly could ask more
questions as to what else doesn't work...)

>
> I can enter these all manually and NetBSD finally comes
> up correctly. Has anyone the complete lines for
> grub to automate this and make it simply work?

I guess, use chainloader.

>
>
> Rudi
>
>
>

Chavdar