Manual installation on 3ware 9500 sata controller wont boot

Matthew Dillon dillon at apollo.backplane.com
Sat Jul 24 12:45:05 PDT 2004


:>
:> 	0:ad(0,a)/boot/loader
:>
:>    I am working on it now.
:
:Thats great
:
:This makes it boot, I'm getting a storm on the console
:complaining about can't find /usr/libexec/getty and
:some others.. the cd copy operation may have had a problem.
:
:-kim

    David Rhodus is testing a patch set now, which I have included below
    (but you may not be in a position to compile/test new boot code from
    a patch so this is only informational).  If you can test it, please
    do so.  If not, we'll just wait for DR.

    Until I get word back from DR, this should be considered extremely
    experimental.  It might not work (yow, that brings back memories of
    Babylon 5!).

					-Matt
					Matthew Dillon 
					<dillon at xxxxxxxxxxxxx>

Index: bootasm.h
===================================================================
RCS file: /cvs/src/sys/boot/i386/bootasm.h,v
retrieving revision 1.3
diff -u -r1.3 bootasm.h
--- bootasm.h	19 Jul 2004 23:30:29 -0000	1.3
+++ bootasm.h	24 Jul 2004 18:56:57 -0000
@@ -70,6 +70,12 @@
 #define MEM_BIOS_LADDR	0x7c00		/* Load address (static/BIOS) */
 
 /*
+ * This is the origin of boot2.bin relative to the BTX user address space
+ * (e.g. physical address would be MEM_BTX_USR+BOOT2_VORIGIN).
+ */
+#define BOOT2_VORIGIN	0x2000
+
+/*
  * NOTE: BOOT0_ORIGIN is extracted from this file and used in boot0/Makefile
  * 	 BOOT1_ORIGIN is extracted from this file and used in boot2/Makefile
  *
Index: bootasmdef.c
===================================================================
RCS file: /cvs/src/sys/boot/i386/bootasmdef.c,v
retrieving revision 1.1
diff -u -r1.1 bootasmdef.c
--- bootasmdef.c	19 Jul 2004 23:30:29 -0000	1.1
+++ bootasmdef.c	24 Jul 2004 18:52:38 -0000
@@ -44,7 +44,7 @@
 void
 usage(const char *arg0, int code)
 {
-    fprintf(stderr, "%s {BOOT0_ORIGIN,BOOT1_ORIGIN,MEM_BIOS_LADDR}\n", arg0);
+    fprintf(stderr, "%s {BOOT0_ORIGIN,BOOT1_ORIGIN,MEM_BIOS_LADDR,BOOT2_VORIGIN}\n", arg0);
     exit(code);
 }
 
@@ -72,6 +72,8 @@
 	printf(fmt, BOOT1_ORIGIN);
     } else if (strcmp(var, "MEM_BIOS_LADDR") == 0) {
 	printf(fmt, MEM_BIOS_LADDR);
+    } else if (strcmp(var, "BOOT2_VORIGIN") == 0) {
+	printf(fmt, BOOT2_VORIGIN);
     } else {
 	usage(av[0], 1);
     }
Index: boot2/Makefile
===================================================================
RCS file: /cvs/src/sys/boot/i386/boot2/Makefile,v
retrieving revision 1.9
diff -u -r1.9 Makefile
--- boot2/Makefile	19 Jul 2004 23:30:32 -0000	1.9
+++ boot2/Makefile	24 Jul 2004 18:52:08 -0000
@@ -40,7 +40,7 @@
 # the start of the BTX *USER* address space, not the start of physical 
 # memory.
 #
-ORG2=	0x2000
+ORG2=	`${.OBJDIR}/bootasmdef.nx BOOT2_VORIGIN`
 
 # Decide Level of UFS support.  UFS1_AND_UFS2 doesn't fit.
 
Index: boot2/boot1.S
===================================================================
RCS file: /cvs/src/sys/boot/i386/boot2/boot1.S,v
retrieving revision 1.7
diff -u -r1.7 boot1.S
--- boot2/boot1.S	19 Jul 2004 23:30:32 -0000	1.7
+++ boot2/boot1.S	24 Jul 2004 19:22:04 -0000
@@ -216,19 +216,33 @@
 main.5: 	pushw %dx			// Save args
 		movb $NSECT,%dh			// Sector count
 		callw nread			// Read disk
-		mov $MEM_BTX_ORG,%bx		// BTX
-		mov 0xa(%bx),%si		// Get BTX length and set
-		add %bx,%si			//  %si to start of boot2.bin
-		mov $MEM_BTX_USR+SIZ_PAG*2,%di	// Client page 2
-		mov $MEM_BTX_ORG+(NSECT-1)*SIZ_SEC,%cx // Size of client data
-		sub %si,%cx			//  count
-		rep				// Relocate
-		movsb				//  client
+		mov $MEM_BTX_ORG,%bx		// Base of BTX header
+		mov 0xa(%bx),%si		// Get BTX text length (btx.S)
+		add %bx,%si			// %si = start of boot2.bin
+						// %di = relocation target
+		mov $MEM_BTX_USR+BOOT2_VORIGIN,%di 
+		mov $MEM_BTX_ORG+(NSECT-1)*SIZ_SEC,%cx
+		sub %si,%cx			// %cx = Size of boot2 client
+		rep				// Relocate boot2
+		movsb
 		popw MEM_BTX_USR_ARG		// save (disk,slice) for boot2
-		sub %di,%cx			// count = 0x[1]0000 - DSTPTR
-		xorb %al,%al			// Zero assumed bss from
-		rep				//  the end of boot2.bin
-		stosb				//  up to 0x10000
+
+#if 0
+		// XXX DISABLED.  This makes incorrect assumptions about
+		// where BSS begins, potentially leaving garbage in the BSS
+		// space.  The BSS zeroing code has been moved to
+		// btx/lib/btxcsu.S (BTX client startup code) where we have
+		// more definitive knowledge about where BSS resides.
+		//
+		// %cx now contains 0.  Calculate 0x[1]0000 - %di to get a
+		// count of assumed BSS bytes from the end of boot2.bin up
+		// to 0x10000, then zero it out.
+		//
+		sub %di,%cx
+		xorb %al,%al
+		rep
+		stosb
+#endif
 		callw seta20			// Enable A20
 
 		// YYY
Index: btx/lib/btxcsu.S
===================================================================
RCS file: /cvs/src/sys/boot/i386/btx/lib/btxcsu.S,v
retrieving revision 1.5
diff -u -r1.5 btxcsu.S
--- btx/lib/btxcsu.S	19 Jul 2004 23:30:35 -0000	1.5
+++ btx/lib/btxcsu.S	24 Jul 2004 19:20:49 -0000
@@ -31,7 +31,11 @@
 		 * Client entry point.
 		 */
 _start: 	movl %eax,__base		# Set base address
-						# for Virt->Phys conversions
+		movl $_edata,%edi		# Clear BSS
+		movl $_end,%ecx
+		subl %edi,%ecx
+		rep
+		stosb
 		movl %esp,%eax			# Get base of arguments
 		addl $USR_ARGSPACE-USR_ARGOFFSET,%eax
 		movl %eax,__args





More information about the Bugs mailing list