Subject: boot loader -- again

From: Dave Baukus <[email-masked]>
Date: Thu, 08 Apr 1999 11:03:43 -0500

I hate too whip this dead horse again, but ...

What boot loaders are available (source code) for arm linux ?

Its time to remove my buggy hacks from the kernel and come up w/ a
legitimate boot sequence for my ebsa285.

--
Dave Baukus
	Inet Technologies Inc.
	[email-masked]
unsubscribe: body of `unsubscribe linux-arm' to [email-masked]

---

From: <[email-masked]>
Date: Wed, 21 Apr 1999 10:01:10 -0500 (CDT)

Greetings,

My current strategy for booting, while a hack, seems to work.  We have a
custom SA-110 card based on the ebsa-285 which was previously running
vxWorks.  What I did was hack the vxWorks netboot loader to load a Linux
kernel over the ethernet (Intel 21143) and perform the prerequisite
things to entering the kernel.  This approach seems to work okay, but I
will be writing a more permanent method of booting later on.  For now
(and for a quick hack), this works fine.

I'm currently struggling getting the ethernet to work correctly (all
kinds of ICMP errors and such).  The interface works sporadically at
best, and stalls after it has loaded init and entered runlevel 3.

--
Kyle Mestery
StorageTek's Storage Networking Group
Protect your right to privacy: www.freecrypto.org

On Wed, 21 Apr 1999, Benjamin Herrenschmidt wrote:

> On Thu, Apr 8, 1999, Dave Baukus <[email-masked]> wrote:
> 
> Did you find something useful ? I have to write some kind of bootloader
> code for a prototype SA-110 based board (I also have an esba285 for
> experiments), and I'm desperately trying to find some sample code. What
> I'm mainly looking for is an example of a proper Makefile for generating
> a bootstrap code (without header of with a custom-made header). I'm quite
> new to the gcc/egcs toolchain (and to linux world in general) and it's a
> little bit difficult when you have to learn everything at the same time !
> 
> 
> -- 
>            E-Mail: <mailto:[email-masked]>
> BenH.      Web   : <http://calvaweb.calvacom.fr/bh40/>
> 
>

---

From: Benjamin Herrenschmidt <[email-masked]>
Date: Wed, 21 Apr 1999 16:12:42 +0100

---

From: Hwa-Jin Bae <[email-masked]>
Date: Wed, 21 Apr 1999 09:17:06 -0700 (PDT)

Hello,

I also have used VxWorks to load Linux over ethernet and it seemed to work
fine as well.  Once Linux started running OK, I have in turn made a
compressed version of Linux and burned it into ROM.  With a small amount
of code that copies from ROM to RAM and jump to Linux in RAM which
uncompresses itself you can have a minimal Linux based bootloader.
Another project is using NetBSD as bootloader for Linux.

You might also talk to Chaltech folks in UK (www.chaltech.com).  They
have "cyclone" firmware for CATS (ebsa285-like HW) they make.  The cyclone
is very nice (it is somewhat similar to NetBSD but stripped down quite
a bit) firmware and can be used to boot both NetBSD and Linux (as well
as VxWorks!).  However "cyclone" is not free, and one time license fee
must be paid.

Good luck!

-- 
Hwa-Jin Bae         
PSO Systems, Inc. 
http://www.pso.com
mailto:[email-masked]

---

From: Philip Blundell <[email-masked]>
Date: Wed, 21 Apr 1999 17:30:17 +0100

>little bit difficult when you have to learn everything at the same time !

Objcopy can convert from ELF or a.out to a flat binary file.  See the kernel 
build process for examples.  I can also send you an example of how to load the 
kernel on a CATS using firmware that just loads a binary image and jumps to 
its first instruction.

p.

---

From: Russell King - ARM Linux Admin <[email-masked]>
Date: Wed, 21 Apr 1999 21:38:56 +0100 (BST)

The EBSA285 bootloader source is now available on the FTP site.  Currently,
it may only be compiled using a.out, however, if someone wishes to forward
patches for the 'mkaif.c' for ELF, then I'll re-issue it.
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |        Russell King       [email-masked]      --- ---
  | | | |  http://www.arm.linux.org.uk/~rmk/armlinux.html    /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |
unsubscribe: body of `unsubscribe linux-arm' to [email-masked]

---

From: Benjamin Herrenschmidt <[email-masked]>
Date: Thu, 22 Apr 1999 14:19:21 +0100

>patches for the 'mkaif.c' for ELF, then I'll re-issue it.

Is there a "preferred" way between target arm-linuxaout and arm-aout for
the toolchain, or both will make it ? I was thinking about using
arm-linuxaout so I can also generate linux binaries using the same
toolchain, is there something wrong with this ?

---

From: Philip Blundell <[email-masked]>
Date: Thu, 22 Apr 1999 14:26:09 +0100

>toolchain, is there something wrong with this ?

New kernels can't be built as a.out, and building user space binaries that way 
isn't really that smart an idea either.  You are better off using ELF, and 
installing a second compiler for a.out if you need it.

p.

---

From: Chris Rutter <[email-masked]>
Date: Thu, 22 Apr 1999 15:44:46 +0100 (BST)

> toolchain, is there something wrong with this ?

The best I can think of is to build two separate toolchains, one with
the target name `arm-linuxaout' and one with `arm-linux', and then
reference them as such.  It would be possible, I suppose, to hack
binutils into supporting both..?

-- 
Chris <[email-masked]>                         ( http://www.fluff.org/chris )

---

From: Russell King <[email-masked]>
Date: Thu, 22 Apr 1999 15:51:42 +0100 (BST)

> toolchain, is there something wrong with this ?

I would not recommend using the a.out stuff for generating linux
binaries at the moment.  We're currently trying to phase it out.

I would suggest that someone does make the necessary changes to mkaif.c
to allow both a.out and ELF binaries to be converted.

--
Russell King ([email-masked])

---

From: Philip Blundell <[email-masked]>
Date: Thu, 22 Apr 1999 16:00:15 +0100

>binutils into supporting both..?

Yes, and in fact one release of HJ's binutils recently did exactly this.  But 
we took it out again because the next major release of binutils will have no 
support for arm-linuxaout at all and we didn't want people to get used to 
having it included in ELF toolchains.

If you are using the binutils 2.9.1.x-derived tools you can include support 
for this (or any other target) using something like `--target=arm-linux 
--enable-targets=arm-linuxaout'.  This doesn't buy you a great deal though 
because you still need a separate compiler and life is easier if the compiler 
and the rest of the tools have the same primary target.

p.

---

From: Russell King - ARM Linux Admin <[email-masked]>
Date: Thu, 22 Apr 1999 20:59:33 +0100 (BST)

> and the rest of the tools have the same primary target.

With that particular configuration, it should yeild something very useful IMHO -
especially as objcopy can be used to convert static binary files between the
various formats, and objdump works with either format.  ld and as will still
generate and use ELF, so there is no difference there.
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |        Russell King       [email-masked]      --- ---
  | | | |  http://www.arm.linux.org.uk/~rmk/armlinux.html    /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |
unsubscribe: body of `unsubscribe linux-arm' to [email-masked]

---

From: Benjamin Herrenschmidt <[email-masked]>
Date: Fri, 23 Apr 1999 16:06:05 +0100

I'm trying to get the bios to compile, and I'm encountering a few
problems. I'll post a patch once I've figured out all of them, but in the
meantime, I'll need some help:

 - Some pieces of the bios are including stdlib.h and net/if_arp.h, both
of them absent from the archive. I've built a striped down stdlib.h (just
defining NULL) and a striped down if_arp.h from glibc 2.1 one, and so
far, it seems to compile.

 - It won't link, I got bunch of errors like:

init/crt0.o(.text+0x204): undefined reference to `_start_main'
init/crt0.o(.text+0x204): relocation truncated to fit: R_ARM_PC24 _start_main

The toolchain is an arm-linux (elf) egcs 1.1.2 with
egcs-1.1.2-arm-diff-990325 applied, and a binutils-2.9.1.0.19a (with also
a diff I found on one of the ARM sites). This same toolchain seems to
compile the kernel correctly. I want ELF since I plan to adapt mkaif to
elf (and make it endian-neutral, I'm cross-compiling on a big endian
platform).

I did try to build an "aout" toochain from the same source, but whatever
I do, I end up with missing includes during gcc compile (unistd.h, and
one other I don't remember).

Note also that some of the CFLAGS used are causing warnings about
obsolecence, '-m6' is deprecated, and -Wa,-msa110 is not reccognised, but
I don't think this is a real problem for now. I replaced -m6 by -mapcs-32
in the makefile like the warning says, but this may be wrong, I don't know.

As you can see, I'm new to the gcc toolchain environement, I really don't
know how to fix the link issue, some explanation would be greatly
appreciated. I beleive I can figure out most of the other problems
myself, including elf loading.