Skip to contentSkip to conversation

Cross compile setup

hppa-linux Bjorn Helgaas 2 participants 2 messages Feb 7, 1999

lore
Share & tools
lore
#0 lore raw

Jason Eckhardt wrote

Quoted 7 lines

Also, a question to others:
I have started to tinker with writing an IPL for the native port (i.e. bootstrap code). I've been compiling/assembling within HPUX, but I can't seem to ascertain how to get "ld" to generate a "straight" binary file rather than a SOM object. The bootstrap code obviously has to be a plain binary to work. Note that the version of gcc I picked up from www.software.hp.com utilizes the HP linker, not GNU ld.

If you haven't already seen them, careful examination of the following HP-UX man pages will get you a long way toward understanding the typical boot process:

	boot(1m)
	pdc(1m)
	isl(1m)
	hpux(1m)

Since PDC resides in a ROM, I assume you're talking about building something analogous to ISL, which resides in a LIF filesystem (see lif(4)) on the boot media and is loaded by PDC. I think the ISL image is plain SOM, but you have to be careful to use the correct type when copying it into the LIF filesystem.

I don't know how much of the boot process you want to replace, but if you're willing to use the HP-UX ISL and HPUX, at least to get started, you can fairly easily get things set up to boot your kernel over the net. 710's and 715's use a proprietary protocol called RMP (see rbootd(1m)), while 712's and newer boxes use BOOTP (see bootpd(1m)).

Booting over the net, combined with using the serial port as the console, makes things go a lot faster.

-------------
Bjorn Helgaas [email protected] telnet 1-497-3069 (972)497-3069

----------------------------------------------------------------------
To unsubscribe: send e-mail to [email protected] with `unsubscribe' as the subject.

#1 lore raw
Quoted 5 lines · Bjorn Helgaas

I don't know how much of the boot process you want to replace, but if you're willing to use the HP-UX ISL and HPUX, at least to get started, you can fairly easily get things set up to boot your kernel over the net. 710's and 715's use a proprietary protocol called RMP (see rbootd(1m)), while 712's and newer boxes use BOOTP (see bootpd(1m)).

RMP may be proprietary, but it's hardly a secret. It's essentially the same boot protocol that the HP 300's used, which was apparently reverse-engineered by the NetBSD camp and subsequently ported to Linux for the HP300 port. It's also used on some 735's (it apparently depends more on PDC revision than model number).

These patches to the rbootd at
http://www.tazenda.demon.co.uk/phil/linux-hp/files/rbootd-linux.tar.gz
allowed me to boot the HPUX kernel from the network on an 735/99 using Linux/x86 as the server (well at least to the point where it looked for a root filesystem).

pcap.c +6 -3
diff -ur rbootd_orig/pcap.c rbootd/pcap.c
@@ -29,8 +29,11 @@
 #include "defs.h"
 
 #include <sys/socket.h>
-#include <linux/if.h>
-#include <linux/if_ether.h>
+#include <ioctls.h>
+#include <net/if.h>
+#define ETH_ALEN        6               /* Octets in one ethernet addr   */
+#define ETH_P_ALL       0x0003          /* Every packet (be careful!!!) */
+
 
 static pcap_t *pdesc = NULL;  /* packet capture descriptor */
 static char errbuf[PCAP_ERRBUF_SIZE]; /* buffer we use to get error msgs */
@@ -131,7 +134,7 @@
    caplen = h->caplen; /* max. captured bytes */
 
    /* First we ensure we got a complete packet of the right size! */
-   if (caplen <= datlen)
+   if (caplen < datlen)
       syslog(LOG_ERR, "bpf: truncated packet dropped (%d of %d bytes)",
              caplen, datlen);
    else if (datlen > sizeof(struct rmp_packet))
rmpproto.c +6 -0
diff -ur rbootd_orig/rmpproto.c rbootd/rmpproto.c
@@ -353,6 +353,12 @@
 		if (STREQN(filename, filelist[i]))
 			goto match;
 
+	if (strlen(filename)==0) 
+	  { 
+	    strcpy(filename, filelist[0]); 
+	    goto match;
+	  }
+	
 	/*
 	 *  Invalid boot file name, set error and send reply packet.
 	 */

--
Paul C. Janzen
[email protected]

----------------------------------------------------------------------
To unsubscribe: send e-mail to [email protected] with `unsubscribe' as the subject.