From 4a0db9e4fe62b042e28495f7a0f29646093dfa06 Mon Sep 17 00:00:00 2001 From: hpa Date: Sat, 5 Apr 2003 00:38:00 +0000 Subject: [PATCH] Actually come up with stack-switch code which has a prayer of working --- comboot.inc | 2 +- pxelinux.asm | 25 ++++++++++++++++++++----- syslinux.doc | 5 +++-- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/comboot.inc b/comboot.inc index 4646369..c7efe82 100644 --- a/comboot.inc +++ b/comboot.inc @@ -1,7 +1,7 @@ ;; $Id$ ;; ----------------------------------------------------------------------- ;; -;; Copyright 1994-2002 H. Peter Anvin - All Rights Reserved +;; Copyright 1994-2003 H. Peter Anvin - All Rights Reserved ;; ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by diff --git a/pxelinux.asm b/pxelinux.asm index 793134e..2c25b01 100644 --- a/pxelinux.asm +++ b/pxelinux.asm @@ -1662,21 +1662,36 @@ unload_pxe: ; We need to switch to our local stack here... pusha pushf + push gs mov si,sp + mov ax,ss + mov gs,ax + sub ax,[BaseStack+4] ; Are we using the base stack + ; (as opposed to the COMBOOT stack)? + je .is_base_stack + + lgs si,[SavedSSSP] ; COMBOOT stack +.is_base_stack: + mov cx,[InitStack] mov di,StackBuf mov [BaseStack],di mov [BaseStack+4],es sub cx,si sub di,cx - mov dx,cx ; New SP - ss rep movsb + mov [SavedSSSP],cx ; New SP + mov [SavedSSSP+2],es + gs rep movsb - cli - mov ss,cx ; CX == 0 here - mov sp,dx + and ax,ax ; Remeber which stack + jne .combootstack + + ; Update the base stack pointer since it's in use + lss sp,[SavedSSSP] +.combootstack: + pop gs popf popa %endif diff --git a/syslinux.doc b/syslinux.doc index d6e579b..f685958 100644 --- a/syslinux.doc +++ b/syslinux.doc @@ -623,5 +623,6 @@ archive, go to: http://www.zytor.com/mailman/listinfo/syslinux -The mailing list changed in early 2002. The old mailing list at -kernel.org is no longer in use. +Please DO NOT send HTML messages or attachments to the mailing list +(including multipart/alternative or similar.) All such messages will +be bounced. -- 2.7.4