Module Name:    src
Committed By:   martin
Date:           Thu Apr  4 12:48:08 UTC 2013

Modified Files:
        src/sys/arch/vax/boot/xxboot: start.S

Log Message:
Rearrange primary bootstrap slightly to free up all space between the disk
label and the uVAX rom boot parameter block.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/vax/boot/xxboot/start.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/vax/boot/xxboot/start.S
diff -u src/sys/arch/vax/boot/xxboot/start.S:1.4 src/sys/arch/vax/boot/xxboot/start.S:1.5
--- src/sys/arch/vax/boot/xxboot/start.S:1.4	Sun Dec 11 12:19:34 2005
+++ src/sys/arch/vax/boot/xxboot/start.S	Thu Apr  4 12:48:07 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: start.S,v 1.4 2005/12/11 12:19:34 christos Exp $ */
+/*	$NetBSD: start.S,v 1.5 2013/04/04 12:48:07 martin Exp $ */
 /*
  * Copyright (c) 1995 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -38,6 +38,7 @@
 
 #define _LOCORE
 
+#define	__HAVE_OLD_DISKLABEL	/* not automatically added due to _LOCORE */
 #define OMIT_DKTYPENUMS
 #define OMIT_FSTYPENUMS
 #include "sys/disklabel.h"
@@ -55,8 +56,12 @@ _C_LABEL(start):
 .org	0x00			# uVAX booted from TK50 starts here
 	brb	from_0x00	# continue behind dispatch-block
 
+# At offset 0x02 we have a dual used area: VMB.EXE starts execution here,
+# and uVAX-ROM looks for a pointer to a parameter block. We arrange for
+# the parameter block offset to disassmble as a CASEL instructions which
+# falls through to 0x08.
 .org	0x02			# information used by uVAX-ROM
-	.byte	0xcf		# offset in words to identification area 
+	.byte	0xcf		# offset in words to identification area
 	.byte	1		# this byte must be 1
 	.word	0		# logical block number (word swapped) 
 	.word	0		# of the secondary image
@@ -74,20 +79,6 @@ from_0x00:			# uVAX from TK50 
 
 from_0x08:			# Any machine from VMB
 	movzbl	$4,_C_LABEL(from)		# Booted from full VMB
-	brw	start_vmb
-
-# the complete area reserved for label
-# must be empty (i.e. filled with zeroes).
-# disklabel(8) checks that before installing
-# the bootblocks over existing label.
-
-.org	LABELOFFSET
-	.globl	_C_LABEL(romlabel)
-_C_LABEL(romlabel):
-	.long	0
-
-.org	LABELOFFSET + d_end_
-start_vmb:
 	/*
 	 * Read in block 1-15.
 	 */
@@ -102,6 +93,20 @@ start_vmb:
 	calls	$6, (%r6)	# call the qio-routine
 	brw	start_uvax
 
+# the complete area reserved for label
+# must be empty (i.e. filled with zeroes).
+# disklabel(8) checks that before installing
+# the bootblocks over existing label.
+
+.org	LABELOFFSET
+	.globl	_C_LABEL(romlabel)
+_C_LABEL(romlabel):
+	.long	0
+
+.org	LABELOFFSET + d_end_
+# Make sure the parameter block is past the disklabel.
+# If not, the next .org would try to move backwards.
+
 /*
  * Parameter block for uVAX boot.
  */
@@ -110,7 +115,7 @@ start_vmb:
 #define SILOAD		0	/* load offset (usually 0) from the default */
 #define SIOFF		0x200	/* byte offset into secondary image */
 
-.org	0x19e
+.org	0x19e	# do not move, see comment earlier about CASEL
 	.byte	0x18		# must be 0x18 
 	.byte	0x00		# must be 0x00 (MBZ) 
 	.byte	0x00		# any value 

Reply via email to