Subject: Re: Need help with boot code
To: None <perry@piermont.com>
From: Trevin Beattie <trevin@xmission.com>
List: current-users
Date: 06/04/1997 12:03:01
At 11:11 AM 6/3/97 -0400, you wrote:
>
>1.28.4.2?????
>
>Do you mean 1.28? Thats the old boot code.
>
>See what the new code does for you.
>
Sorry to disappoint you, but the ONLY difference between 1.28.4.2 and 1.29
is the allowance of unit numbers higher than 1, which I have already
incorporated.  Here's the proof (note that /usr/src/NetBSD-current/ is
actually version 1.2.1 at the moment):

% diff --recursive /usr/src/NetBSD-current/sys/arch/i386/boot
/usr/distrib/NetBSD-current/src/sys/arch/i386/boot
Only in /usr/distrib/NetBSD-current/src/sys/arch/i386/boot: CVS
diff
--recursive /usr/src/NetBSD-current/sys/arch/i386/boot/Makefile
/usr/distrib/NetBSD-current/src/sys/arch/i386/boot/Makefile
1c1
< #
$NetBSD: Makefile,v 1.21.4.1 1996/12/10 05:26:13 mycroft Exp $
---
> #
$NetBSD: Makefile,v 1.24 1997/05/07 17:16:05 mycroft Exp $
28a29
> .PHONY:
machine-links
76,79d76
< 
< clean::
< 	rm -f a.out [Ee]rrs mklog core
*.core
< 	rm -f ${PROG} ${OBJS} ${LOBJS} ${CLEANFILES}
diff --recursive
/usr/src/NetBSD-current/sys/arch/i386/boot/bios.S
/usr/distrib/NetBSD-current/src/sys/arch/i386/boot/bios.S
1c1
< /*	$NetBSD:
bios.S,v 1.13.4.1 1996/12/10 05:26:14 mycroft Exp $	*/
---
> /*	$NetBSD:
bios.S,v 1.15 1996/06/18 07:17:47 mycroft Exp $	*/
diff --recursive
/usr/src/NetBSD-current/sys/arch/i386/boot/boot.c
/usr/distrib/NetBSD-current/src/sys/arch/i386/boot/boot.c
1c1
< /*	$NetBSD:
boot.c,v 1.29.4.1 1996/12/10 05:26:15 mycroft Exp $	*/
---
> /*	$NetBSD:
boot.c,v 1.32 1996/08/30 01:34:01 thorpej Exp $	*/
80c80
<
boot(drive)
---
> netbsd_boot(drive)
diff --recursive
/usr/src/NetBSD-current/sys/arch/i386/boot/boot.h
/usr/distrib/NetBSD-current/src/sys/arch/i386/boot/boot.h
1c1
< /*	$NetBSD:
boot.h,v 1.6 1995/01/18 17:28:11 mycroft Exp $	*/
---
> /*	$NetBSD:
boot.h,v 1.7 1996/08/30 01:34:11 thorpej Exp $	*/
41a42,43
> 
> void
netbsd_boot __P((int));
diff --recursive
/usr/src/NetBSD-current/sys/arch/i386/boot/disk.c
/usr/distrib/NetBSD-current/src/sys/arch/i386/boot/disk.c
1c1
< /*	$NetBSD:
disk.c,v 1.13.6.1 1996/12/10 05:26:16 mycroft Exp $	*/
---
> /*	$NetBSD:
disk.c,v 1.14 1996/06/18 06:10:33 mycroft Exp $	*/
diff --recursive
/usr/src/NetBSD-current/sys/arch/i386/boot/io.c
/usr/distrib/NetBSD-current/src/sys/arch/i386/boot/io.c
1c1
< /*	$NetBSD:
io.c,v 1.18.4.1 1996/12/10 05:26:17 mycroft Exp $	*/
---
> /*	$NetBSD:
io.c,v 1.19 1996/06/18 07:47:04 mycroft Exp $	*/
diff --recursive
/usr/src/NetBSD-current/sys/arch/i386/boot/start.S
/usr/distrib/NetBSD-current/src/sys/arch/i386/boot/start.S
1c1
< /*
$NetBSD: start.S,v 1.12.6.1 1996/12/10 05:26:18 mycroft Exp $	*/
---
> /*
$NetBSD: start.S,v 1.14 1996/08/30 01:34:15 thorpej Exp $	*/
352c352
<
call	_C_LABEL(boot)
---
> 	call	_C_LABEL(netbsd_boot)
diff --recursive
/usr/src/NetBSD-current/sys/arch/i386/boot/sys.c
/usr/distrib/NetBSD-current/src/sys/arch/i386/boot/sys.c
1c1
< /*	$NetBSD:
sys.c,v 1.13.6.1 1996/12/10 05:26:19 mycroft Exp $	*/
---
> /*	$NetBSD:
sys.c,v 1.15 1997/03/29 21:40:19 christos Exp $	*/
192,193c192,196
< 		if
(*cp >= '0' && *cp <= '9')
< 			if ((unit = *cp++ - '0') > 1) {
---
> 		if
(*cp >= '0' && *cp <= '9') {
> 			unit = *cp++ - '0';
> #if 0
> 			/*
Modern bios'es can boot from disks higher than d */
> 			if (unit > 1)
{
196a200,201
> #endif
> 		}
diff --recursive
/usr/src/NetBSD-current/sys/arch/i386/boot/version.c
/usr/distrib/NetBSD-current/src/sys/arch/i386/boot/version.c
1c1
< /*
$NetBSD: version.c,v 1.28.4.2 1996/12/10 05:27:00 mycroft Exp $	*/
---
> /*
$NetBSD: version.c,v 1.29 1996/06/18 07:51:26 mycroft Exp $	*/
6c6
<  *
1.28 -> 1.28.4.2
---
>  *	1.28 -> 1.29
60c60
< char *version =
"1.28.4.2";
---
> char *version = "1.29";


The changes I made are:

diff --recursive /usr/src/NetBSD-current/sys/arch/i386/boot/start.S
./start.S
61c61
< LOADSZ		=	15	# size of unix boot
---
> LOADSZ		=	17	#
size of unix boot
368d367
< seven:	.asciz		"7\r\n"
diff --recursive /usr/src/NetBSD-current/sys/arch/i386/boot/sys.c
./sys.c
1c1
< /*	$NetBSD: sys.c,v 1.13.6.1 1996/12/10 05:26:19 mycroft Exp
$	*/
---
> /*	$NetBSD: sys.c,v 1.15 1997/03/29 21:40:19 christos Exp $
*/
192,193c192,195
< 		if (*cp >= '0' && *cp <= '9')
< 			if ((unit = *cp++
- '0') > 1) {
---
> 		if (*cp >= '0' && *cp <= '9') {
> 			unit = *cp++ -
'0';
> 			/* Modern bios'es can boot from disks higher than d */
> 			if
((unit > 7) || ((maj == 2) && (unit > 1))) {
196a199
> 		}

(which actually keeps a limit of 2 floppy devices.)
And the symptoms aren't at all consistent.  I've been adding printf() code
to help me debug the beast, but in the present incarnation the computer
reboots as soon as it runs the boot code (no messages).  In a previous
incarnation, it prompted for the kernel file but rebooted immediately after
loading the text segment.  How am I supposed to debug the d----d thing if
any debugging code I add changes the symptoms?

-- Trevin