Subject: Bootloader does not pass symbols to the kernel
To: None <port-sgimips@NetBSD.org>
From: Martin Husemann <martin@duskware.de>
List: port-sgimips
Date: 12/26/2006 12:57:41
--lEGEL1/lMxI0MVQ2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

I got tired of ddb w/o symbols on my O2 ;-)

The attached (simple) patch changes the bootloader to pass symbol information
to the kernel. I compiled it, and then used something like

  cd /usr/mdec
  ./sgivol -f -w boot ip3xboot sd0

to install it.

I have no clue if this could (negatively) affect the other booters - could
someone test, please?

It seems the other bootloader update commands are:

  sgivol -f -w aoutboot /usr/mdec/aoutboot
  sgivol -f -w boot /usr/mdec/ip2xboot

(sysinst runs both of them for IP2x). We should have a boot(8) and a sgivol(8)
man page ;-}

Martin

--lEGEL1/lMxI0MVQ2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch

Index: boot.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sgimips/stand/common/boot.c,v
retrieving revision 1.12
diff -c -u -r1.12 boot.c
--- boot.c	11 Dec 2005 12:18:58 -0000	1.12
+++ boot.c	26 Dec 2006 11:52:23 -0000
@@ -237,7 +237,6 @@
 	}
 
 finish:
-#if 0
 	strncpy(bi_bpath.bootpath, kernel, BTINFO_BOOTPATH_LEN);
 	bi_add(&bi_bpath, BTINFO_BOOTPATH);
 
@@ -245,7 +244,6 @@
 	bi_syms.ssym = marks[MARK_SYM];
 	bi_syms.esym = marks[MARK_END];
 	bi_add(&bi_syms, BTINFO_SYMTAB);
-#endif
 	entry = (void *) marks[MARK_ENTRY];
 
 	if (debug) {
@@ -253,7 +251,7 @@
 		printf("nsym 0x%lx ssym 0x%lx esym 0x%lx\n", marks[MARK_NSYM],
 		       marks[MARK_SYM], marks[MARK_END]);
 	}
-	(*entry) (argc, argv, 0 /* BOOTINFO_MAGIC */, NULL);
+	(*entry) (argc, argv, BOOTINFO_MAGIC, bootinfo);
 
 	printf("Kernel returned!  Halting...\n");
 	return (0);

--lEGEL1/lMxI0MVQ2--