svn commit: r189500 - head/sys/boot/i386/boot2

Marcel Moolenaar marcel at FreeBSD.org
Sat Mar 7 14:06:00 PST 2009


Author: marcel
Date: Sat Mar  7 22:05:58 2009
New Revision: 189500
URL: http://svn.freebsd.org/changeset/base/189500

Log:
  Revert the part of change 107879 that employs the unused bytes after
  the disklabel in the 2nd sector for boot code. Even with both UFS1
  and UFS2 supported, there's enough bytes left that we don't have to
  nibble from the disklabel.
  Thus, the entire 2nd sector is now reserved for the disklabel, which
  makes the bootcode compatible again with disklabels that have more
  than 8 partitions -- such as those created and supported by gpart.
  
  i386: 135 bytes available
  amd64: 151 bytes available
  
  Ok'd by: jhb

Modified:
  head/sys/boot/i386/boot2/Makefile
  head/sys/boot/i386/boot2/boot1.S

Modified: head/sys/boot/i386/boot2/Makefile
==============================================================================
--- head/sys/boot/i386/boot2/Makefile	Sat Mar  7 21:36:57 2009	(r189499)
+++ head/sys/boot/i386/boot2/Makefile	Sat Mar  7 22:05:58 2009	(r189500)
@@ -70,7 +70,7 @@ boot2.ld: boot2.ldr boot2.bin ${BTXKERN}
 	    -o ${.TARGET} -P 1 boot2.bin
 
 boot2.ldr:
-	dd if=/dev/zero of=${.TARGET} bs=276 count=1
+	dd if=/dev/zero of=${.TARGET} bs=512 count=1
 
 boot2.bin: boot2.out
 	objcopy -S -O binary boot2.out ${.TARGET}

Modified: head/sys/boot/i386/boot2/boot1.S
==============================================================================
--- head/sys/boot/i386/boot2/boot1.S	Sat Mar  7 21:36:57 2009	(r189499)
+++ head/sys/boot/i386/boot2/boot1.S	Sat Mar  7 22:05:58 2009	(r189500)
@@ -19,7 +19,7 @@
 		.set MEM_REL,0x700		# Relocation address
 		.set MEM_ARG,0x900		# Arguments
 		.set MEM_ORG,0x7c00		# Origin
-		.set MEM_BUF,0x8cec		# Load area
+		.set MEM_BUF,0x8c00		# Load area
 		.set MEM_BTX,0x9000		# BTX start
 		.set MEM_JMP,0x9010		# BTX entry point
 		.set MEM_USR,0xa000		# Client start
@@ -172,9 +172,9 @@ main.4: 	xor %dx,%dx			# Partition:drive
  * Ok, we have a slice and drive in %dx now, so use that to locate and load
  * boot2.  %si references the start of the slice we are looking for, so go
  * ahead and load up the first 16 sectors (boot1 + boot2) from that.  When
- * we read it in, we conveniently use 0x8cec as our transfer buffer.  Thus,
- * boot1 ends up at 0x8cec, and boot2 starts at 0x8cec + 0x200 = 0x8eec.
- * The first part of boot2 is the disklabel, which is 0x114 bytes long.
+ * we read it in, we conveniently use 0x8c00 as our transfer buffer.  Thus,
+ * boot1 ends up at 0x8c00, and boot2 starts at 0x8c00 + 0x200 = 0x8e00.
+ * The first part of boot2 is the disklabel, which is 0x200 bytes long.
  * The second part is BTX, which is thus loaded into 0x9000, which is where
  * it also runs from.  The boot2.bin binary starts right after the end of
  * BTX, so we have to figure out where the start of it is and then move the


More information about the svn-src-all mailing list