Module Name:    src
Committed By:   jakllsch
Date:           Fri Mar 18 17:46:27 UTC 2011

Modified Files:
        src/sys/arch/i386/stand/pxeboot: start_pxe.S

Log Message:
Automatically adjust pxeboot(8) stack based on the end of .bss, like is already
done in biosboot.S for boot(8).
(The heap location will need to be adjusted if pxeboot expands much more.)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/i386/stand/pxeboot/start_pxe.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/i386/stand/pxeboot/start_pxe.S
diff -u src/sys/arch/i386/stand/pxeboot/start_pxe.S:1.5 src/sys/arch/i386/stand/pxeboot/start_pxe.S:1.6
--- src/sys/arch/i386/stand/pxeboot/start_pxe.S:1.5	Mon Dec 20 01:12:45 2010
+++ src/sys/arch/i386/stand/pxeboot/start_pxe.S	Fri Mar 18 17:46:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: start_pxe.S,v 1.5 2010/12/20 01:12:45 jakllsch Exp $	*/
+/*	$NetBSD: start_pxe.S,v 1.6 2011/03/18 17:46:26 jakllsch Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -34,7 +34,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
-	
+
 /*
  * PXE startup
  * parts from sys/arch/i386/stand/lib/crt/bootsect/start_bootsect.S
@@ -63,13 +63,15 @@
 	ljmp	$0x7c0, $2f
 2:
 	# set up %ds
-	xorl	%eax, %eax
 	mov	%cs, %ax
 	mov	%ax, %ds
 
-	# set up %ss and %esp
-	mov	%ax, %ss
-	movl	$0xfffc, %esp		/* stack at top of 64k segment */
+	# set up %ss and %sp
+	movl	$_end, %eax		/* top of bss */
+	shrl	$4, %eax		/* as a segment */
+	addw	$0x1001, %ax		/* and + 64k */
+	movw	%ax, %ss		/* for stack */
+	movw	$0xfffc, %sp		/* %sp at top of it */
 
 	call	gdt_fixup
 

Reply via email to