Subject: update -- elf boot program working
To: None <port-powerpc@NetBSD.ORG>
From: Jason Thorpe <>
List: port-powerpc
Date: 02/10/1997 03:57:33

I've applied some of Andrew's diffs to my tree, and made a few extra
changes, and I have a full-blown ELF kernel:

text    data    bss     dec     hex     filename
787208  50704   108904  946816  e7280   netbsd
cp netbsd netbsd.gdb
/usr/local/toolchain/bin/powerpc-elf-netbsd-strip --strip-debug netbsd
basalt (thorpej) /sys/arch/powerpc/compile/GENERIC 133% ll netbsd
-rwxr-xr-x  1 thorpej  netbsd  1000945 Feb 10 03:15 netbsd*
basalt (thorpej) /sys/arch/powerpc/compile/GENERIC 134% file netbsd
netbsd: ELF 32-bit MSB executable, PowerPC, version 1
basalt (thorpej) /sys/arch/powerpc/compile/GENERIC 135% 

Cross-compiling has thusfar gone basically without a hitch, once I
convinced the compiler to DTRT.  (Matthias Pfaller's
hack is really cool... eliminated all of the HOSTED_CC hair.)

I've also rearranged the boot code somewhat, and added (yet untested)
support for loading ELF kernels.  It successfully loads the a.out kernel
on the fl9660 image and the kernel runs on my Firepower LX... I've got a
copy of mkisofs now, and will build a floppy with an ELF kernel on it
tomorrow (it's time to get some sleep, now...)  I have a (very early)
start at a standalone msdosfs for libsa, but I must admit my motivation
for finishing it is pretty small.  I was hoping that the NetBSD boot
program would grok UFS floppies made on my NeXT, but no luck.  9660 it
is, I guess.

Booting NetBSD...
Boot device: /pci/scsi@3/disk@0,0:,\netbsd\ofwboot  File and args:
>> NetBSD/powerpc OpenFirmware Boot, Revision 1.2
>> (thorpej@basalt, Mon Feb 10 03:03:21 PST 1997)
open /pci/scsi@3/disk@0,0/netbsd: No such file or directory
Boot: /pci/isa@0/floppy@i3f0/netbsd -s
Booting /pci/isa@0/floppy@i3f0/netbsd @ 0x100000
760512+30096+110632 [43668+40047] start=0x100000
Please insert root disk and press ENTER
[ . . . ]
WARNING: no swap space found

Part of the rearrangement was to rename the boot program to "ofwboot",
since it is an OpenFirmware-specific boot program, and eventually we'll
want to have different boot programs for different system types.  I also
fixed a bug in the OpenFirmware alloc().

I'm also going to add support for loading gzip'd kernels at some point,
since I'm probably going to _need_ it RSN :-)  This will require some
more changes to the OpenFirmware alloc() function, but will be otherwise

Barring objections from Wolfgang, I'd like to commit this stuff RSN, and
post updated toolchain diffs, by the end of the week.


Jason R. Thorpe                             
NASA Ames Research Center                               Home: 408.866.1912
NAS: M/S 258-6                                          Work: 415.604.0935
Moffett Field, CA 94035                                Pager: 415.428.6939