Re: Success: kernel compile

Jochen Kunz <[email protected]>
Newsgroups gmane.os.netbsd.ports.hp700
Message-ID <20031010203550.GY350776@MrPomeroy2>
On 2003.10.10 19:16 Chuck Silvers wrote:

> to make a netbootable LIF image, cd to arch/hp700/stand/mkboot and do
> 
> 	make && ./mkboot BOOT ../compile/GENERIC/netbsd netbsd.lif
> 
> I've been working with a 735 (which uses rbootd), I imagine the same
> image will work with a newer model that uses BOOTP/DHCP.
I do my tests with a B132L that does dhcp/tftp and it worked, in theory.
The image was to big for the bootrom. I am going to cut down the kernel
like you already sugested. 

Meanwhile I fixed boot only to notice that it doesn't support loading an
ELF image via dhcp/NFS. Seams I got spoilt by ofwboot.elf. ;-)

Anyway, below are patches to make boot compile again. (Feel free to
remove my comment about the pointer arithmetic. ;-) ) 

Main Menu: Enter command > boot lan
Interact with IPL (Y, N, Q)?> y

Booting... 
Network Station Address 080009-0affe0
System IP Address 192.168.2.9
Server IP Address 192.168.2.2

Boot IO Dependent Code (IODC) revision 2


SOFT Booted.


>> NetBSD/hp700 LIF Boot, Revision 1.1
>> (jkunz@SirTobie, Fri Oct 10 21:42:11 CEST 2003)
>> Enter "reset" to reset system.
Boot: [[[lf0a:]netbsd][-a][-c][-d][-s][-v][-q]] :- 
open lf0a:netbsd: Input/output error




--- arch/hp700/stand/boot/boot.c.orig	Fri Oct 10 17:41:31 2003
+++ arch/hp700/stand/boot/boot.c	Fri Oct 10 17:42:27 2003
@@ -72,6 +72,7 @@
 #include <lib/libsa/loadfile.h>
 
 #include <machine/pdc.h>
+#include <machine/vmparam.h>
 
 #include <arch/hp700/stand/common/dev_hppa.h>
 
--- arch/hp700/stand/common/dk.c.orig	Fri Oct 10 20:53:32 2003
+++ arch/hp700/stand/common/dk.c	Fri Oct 10 20:53:50 2003
@@ -40,7 +40,7 @@
 dk_disklabel(struct hppa_dev *dp, struct disklabel *label)
 {
 	char buf[DEV_BSIZE];
-	int ret;
+	size_t ret;
 
 	if (iodcstrategy(dp, F_READ, LABELSECTOR, DEV_BSIZE, buf,
&ret))
 		if (ret != DEV_BSIZE)
--- arch/hp700/stand/common/libsa.h.orig	Fri Oct 10 20:45:44 2003
+++ arch/hp700/stand/common/libsa.h	Fri Oct 10 20:47:55 2003
@@ -76,7 +76,7 @@
 void devboot(dev_t, char *);
 void fcacheall(void);
 
-int     lif_open(char *, struct open_file *);
+int     lif_open(const char *, struct open_file *);
 int     lif_close(struct open_file *);
 int     lif_read(struct open_file *, void *, size_t, size_t *);
 int     lif_write(struct open_file *, void *, size_t, size_t *);
--- arch/hp700/stand/common/lif.c.orig	Fri Oct 10 20:45:29 2003
+++ arch/hp700/stand/common/lif.c	Fri Oct 10 22:16:45 2003
@@ -53,13 +53,14 @@
 };
 
 int
-lif_open(char *path, struct open_file *f)
+lif_open(const char *path, struct open_file *f)
 {
 	struct file *fp;
 	struct lifdir *dp;
 	char *p, *q;
 	struct lif_load load;
-	int err, buf_size, l;
+	int err;
+	size_t buf_size;
 
 #ifdef LIFDEBUG
 	if (debug)
@@ -86,7 +87,9 @@
 			sizeof(struct lifdir);
 
 		/* no dirs on the lif */
-		for (p = path + (l = strlen(path)); p >= path; p--)
+		/* Ewww, this pointer arithmetic is more then ugly. 
+		 * I should rewrite this. jkunz */
+		for (p = (char*) ((size_t) path + strlen(path)); p >=
path; p--)
 			if (*p == '/') {
 				p++;
 				break;
@@ -110,7 +113,7 @@
 				       dp->dir_name[6], dp->dir_name[7],

 				       dp->dir_name[8], dp->dir_name[9]);
 #endif
-			for (p = path, q = dp->dir_name;
+			for (p = (char*) path, q = dp->dir_name;
 			     *q && *q != ' '; q++, p++)
 				if (tolower(*q) != tolower(*p))
 					break;

-- 


tschÌß,
       Jochen

Homepage: http://www.unixag-kl.fh-kl.de/~jkunz/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.