Subject: netbooting

From: "David S. Miller" <[email-masked]>
Date: Wed, 5 Jun 1996 00:12:16 -0700

How much pain is involved in netbooting a kernel from an INDY?  Can I
just setup a /tftpboot area with the appropriate files and setup a
place to place the kernels for the bootloader to find and it'll work?
If so, can someone tell me what the necessary magic is that needs to
be done?

This would speed up my development tremendously ;)

Later,
David S. Miller
[email-masked]

---

From: [email-masked] (William J. Earl)
Date: Wed, 5 Jun 1996 11:35:26 -0700

> If so, can someone tell me what the necessary magic is that needs to

      It is easy.  On your host system, either put the kernel you want
to boot in /usr/local/boot/., or, in /etc/inetd.conf on your host
system, add a "-f" to the end of the line and "killall -HUP inetd" (to get
inetd to re-read /etc/inetd.conf).  Then, on the target system, first
set the "netaddr" PROM environment variable.  It should be set to the 
IP address (dotted notation) of the target system.  Check it with the
"printenv" PROM command.  Set it with

	setenv -p netaddr 1.2.3.4

(replacing "1.2.3.4" with the IP address of the target system).  Then,
do

	boot -f bootp()hostsystem:xyx

where "hostsystem" is the name of the host system and "xyz" is the
name of the kernel you want to boot.  If you add "-f" to the bootp
line, you can use a full path name on the target system in place of
"xyz".  Any additional words on the command line are passed to the booted
program as a UNIX-style argument list, and the environment variable list
is passed as well.  That is, on entry, the program will see argc in $a0,
argv in $a1, and environ in $a2.

     On an Indy, the booted kernel (or other program) must be
in MIPS ECOFF format.  On Moosehead, the kernel must be in ELF format.
The "-coff" option to the IRIX ld will cause it to create an ECOFF binary
instead of an ELF binary in the final link, even if all the input binaries
are in ELF format.  If you want to boot an ELF kernel on Indy, you have
to boot an indirect loader.  You can use the IRIX sash.  Put sash in the
volume header on the Indy, or in a bootp-able place on the host system.
Then do

	boot -f bootp()hostsystem:sash

or

	boot -f sash

and then, in either case

	boot -f bootp()hostsystem:xyx

where the last command is to the sash prompt, not the PROM prompt.  sash
knows how to load both ELF and ECOFF.

     On an Indy, the PROM would like you to link the kernel at or above
0x88002000, with the highest address in the linked binary being below
0x88400000 (4 MB).

---

From: "David S. Miller" <[email-masked]>
Date: Wed, 5 Jun 1996 16:38:09 -0700

Date: Wed, 5 Jun 1996 11:35:26 -0700
   From: [email-masked] (William J. Earl)

   in MIPS ECOFF format.

Know whats strange, I can netboot big endian elf kernels from the ARCS
command line monitor with zero problems on my target INDY. ;-)

Later,
David S. Miller
[email-masked]

---

From: Mike McDonald <[email-masked]>
Date: Wed, 05 Jun 1996 16:56:39 -0700

>Date: Wed, 5 Jun 1996 16:38:09 -0700
>From: "David S. Miller" <dm@neteng>
>To: [email-masked]
>Subject: Re: netbooting
>

  My understanding was that sash had to be COFF due to the proms but
that the newer versions of sash understood both COFF and ELF kernels.
Something like that anyway.

  Mike McDonald
  [email-masked]

---

From: [email-masked] (William J. Earl)
Date: Wed, 5 Jun 1996 17:26:22 -0700

> Something like that anyway.

     Yes, that is correct.  If David is leaving off the "-f", it is possible
that the PROM is booting sash first, and letting sash boot the kernel.
On the other hand, David's Indy does have the latest Indy PROM, so it is
possible that the PROM developer dropped in ELF support.  We can't assume
it is available on an Indy, so we let sash do the work.

     I checked on the PROM source, and the recent PROMs, such as what David
has, do indeed boot ELF binaries directly.  That is, both ELF and ECOFF are
turned on in the recent Indy PROMs.