Subject: Re: How to build gzboot?
To: Allen Briggs <briggs@netbsd.org>
From: Marcin M. Jessa <lists@yazzy.org>
List: port-arm
Date: 09/28/2006 17:06:11
On Monday 04 September 2006 22:20, you wrote:
> On Sun, Sep 03, 2006 at 05:04:48AM -0500, Tom Hansen wrote:
> > How does one go about coaxing build.sh to build the gzboot versions of
> > the kernel in
> >
> >   /usr/src/sys/arch/evbarm/stand/gzboot
> >
> > I've successfully build the kernels for TS7200, but build.sh ignored the
> > above directory.
> >
> > Does one have to build the entire distribution?
> >
> > Or do you have to set the many environment variables required and run
> > Makefile.gzboot manually?  (If so, details would be appreciated!)
>
> I usually have a copy of gzboot built from a distribution build (or a
> manual nbmake-evbarm-el or whatever) and just do something like:
>
> $ pwd
> .../evbarm/compile/MYKERN
> $ nbmake-evbarm-el && cat /path/to/gzboot netbsd.bin.gz > /tftpboot/image
>
> ...and that does what I need.


Is gzboot required to boot kernels on ARM/XScale platforms?
I have a kernel image which I am trying to boot on an XScale XDP425 board and 
Redboot gives me only some garbage ASCII output (see below).
Following http://comments.gmane.org/gmane.os.netbsd.ports.arm/804
did not result in anything positive either.
Unfortunatelly I was unable to find any man page or info on the netbsd.org 
website about gzboot and I am a bit confused about it's purpose and usage 
method.
There is basically very little info about this process and I'd like to 
understand and document it.

Cheers,
Marcin.

Aditional info:
I altered src/sys/arch/evbarm/conf/mk.ixdp425
so it shows: 
KERNEL_BASE_PHYS=0x01600000
and 
src/sys/arch/evbarm/ixdp425/ixdp425_start.S
so it shows:
.word   0x01600000 - 0x4000

Then I created two partitions on the FLASH.
The one for kernel is about 1.6M so the gziped kernel will fit:
fis init
fis create -b 0x01600000 -f 0x50080000 -l 0x00186A00 -e 0x01600000 -r 
0x01600000 -n kernel
fis create -f 0x50220000 -l 0x005C0000 -n ramdisk

Redboot shows there is 64M RAM and 8M FLASH memory on it:

RedBoot(tm) bootstrap and debug environment [ROM]
Red Hat certified release, version 2.02 - built 11:45:54, Jul  5 2006

Platform: IXDP425 Gateworks Avila Board (IXP42X 266MHz) BE
Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.

RAM: 0x00000000-0x04000000, [0x00029bf8-0x03fc1000] available
FLASH: 0x50000000 - 0x50800000, 64 blocks of 0x00020000 bytes each.
RedBoot> fis list
Name                  FLASH addr  Mem addr       Length          Entry point
RedBoot             0x50000000  0x50000000  0x00080000  0x00000000
kernel                 0x50080000  0x01600000  0x001A0000  0x01600000
ramdisk              0x50220000  0x50220000  0x005C0000  0xFFFFFFFF
FIS directory      0x507E0000  0x507E0000  0x0001F000  0x00000000
RedBoot config  0x507FF000  0x507FF000   0x00001000  0x00000000

Loading the kernel gives only garbage:
RedBoot> load -v -r -b 0x01600000 netbsd.gz
Using default protocol (TFTP)
\
Raw file loaded 0x01600000-0x0176ec37, assumed entry at 0x01600000
RedBoot> go -n 0x01600000
$T050f:01600000;0d:03fc0fec;#de