Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/stand/pxeboot Automatically adjust pxeboot(8) ...



details:   https://anonhg.NetBSD.org/src/rev/be2d4ee68664
branches:  trunk
changeset: 763406:be2d4ee68664
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Fri Mar 18 17:46:26 2011 +0000

description:
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.)

diffstat:

 sys/arch/i386/stand/pxeboot/start_pxe.S |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (38 lines):

diff -r 64a4e2fd4b79 -r be2d4ee68664 sys/arch/i386/stand/pxeboot/start_pxe.S
--- a/sys/arch/i386/stand/pxeboot/start_pxe.S   Fri Mar 18 17:19:06 2011 +0000
+++ b/sys/arch/i386/stand/pxeboot/start_pxe.S   Fri Mar 18 17:46:26 2011 +0000
@@ -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
 



Home | Main Index | Thread Index | Old Index