* New API call to do "localboot".
* New API call to query features.
* Fix for bug in EBIOS code discovered by Arwin Vosselman.
+ * NOESCAPE security fix.
Changes in 3.09:
* gcc4 compilation fix.
--- /dev/null
+; $Id$
+; -----------------------------------------------------------------------
+;
+; Copyright 2005 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
+; the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+; Boston MA 02111-1307, USA; either version 2 of the License, or
+; (at your option) any later version; incorporated herein by reference.
+;
+; -----------------------------------------------------------------------
+
+;
+; abort.inc
+;
+; Code to terminate a kernel load
+;
+
+;
+; abort_check: let the user abort with <ESC> or <Ctrl-C>
+;
+abort_load equ abort_check.do_abort
+
+abort_check:
+ call pollchar
+ jz .ret1
+ pusha
+ call getchar
+ cmp al,27 ; <ESC>
+ je .kill
+ cmp al,3 ; <Ctrl-C>
+ jne .ret2
+.kill: mov si,aborted_msg
+
+ ; ... fall through ...
+
+;
+; abort_load: Called by various routines which wants to print a fatal
+; error message and return to the command prompt. Since this
+; may happen at just about any stage of the boot process, assume
+; our state is messed up, and just reset the segment registers
+; and the stack forcibly.
+;
+; SI = offset (in _text) of error message to print
+;
+.do_abort:
+ mov ax,cs ; Restore CS = DS = ES
+ mov ds,ax
+ mov es,ax
+%if IS_SYSLINUX || IS_EXTLINUX
+ mov ss,ax ; Just in case...
+ mov sp,StackBuf-2*3 ; Reset stack
+%elif IS_PXELINUX
+ lss esp,[BaseStack]
+%elif IS_ISOLINUX
+ lss sp,[cs:Stack]
+%else
+ NEED TO KNOW HOW TO RESET STACK
+%endif
+ sti
+ call cwritestr ; Expects SI -> error msg
+
+ ; If onerror is set, jump to onerror, otherwise return
+ ; to the command prompt
+ mov cx,[OnerrorLen]
+ and cx,cx
+ jnz on_error
+ jmp enter_command ; Return to command prompt
+
+;
+; End of abort_check
+;
+.ret2: popa
+.ret1: ret
ret
;
-; abort_check: let the user abort with <ESC> or <Ctrl-C>
+; Abort loading code
;
-abort_check:
- call pollchar
- jz ac_ret1
- pusha
- call getchar
- cmp al,27 ; <ESC>
- je ac_kill
- cmp al,3 ; <Ctrl-C>
- jne ac_ret2
-ac_kill: mov si,aborted_msg
-
-;
-; abort_load: Called by various routines which wants to print a fatal
-; error message and return to the command prompt. Since this
-; may happen at just about any stage of the boot process, assume
-; our state is messed up, and just reset the segment registers
-; and the stack forcibly.
-;
-; SI = offset (in _text) of error message to print
-;
-abort_load:
- mov ax,cs ; Restore CS = DS = ES
- mov ds,ax
- mov es,ax
- cli
- mov sp,StackBuf-2*3 ; Reset stack
- mov ss,ax ; Just in case...
- sti
- call cwritestr ; Expects SI -> error msg
-al_ok: jmp enter_command ; Return to command prompt
-;
-; End of abort_check
-;
-ac_ret2: popa
-ac_ret1: ret
+%include "abort.inc"
;
; allocate_file: Allocate a file structure
jmp kaboom ; If we returned, oh boy...
;
-; abort_check: let the user abort with <ESC> or <Ctrl-C>
+; Abort loading code
;
-abort_check:
- call pollchar
- jz ac_ret1
- pusha
- call getchar
- cmp al,27 ; <ESC>
- je ac_kill
- cmp al,3 ; <Ctrl-C>
- jne ac_ret2
-ac_kill: mov si,aborted_msg
-
-;
-; abort_load: Called by various routines which wants to print a fatal
-; error message and return to the command prompt. Since this
-; may happen at just about any stage of the boot process, assume
-; our state is messed up, and just reset the segment registers
-; and the stack forcibly.
-;
-; SI = offset (in _text) of error message to print
-;
-abort_load:
- mov ax,cs ; Restore CS = DS = ES
- mov ds,ax
- mov es,ax
- cli
- lss sp,[cs:Stack] ; Reset the stack
- sti
- call cwritestr ; Expects SI -> error msg
-al_ok: jmp enter_command ; Return to command prompt
-;
-; End of abort_check
-;
-ac_ret2: popa
-ac_ret1: ret
-
+%include "abort.inc"
;
; searchdir:
%include "bootsect.inc"
;
-; abort_check: let the user abort with <ESC> or <Ctrl-C>
+; Abort loading code
;
-abort_check:
- call pollchar
- jz ac_ret1
- pusha
- call getchar
- cmp al,27 ; <ESC>
- je ac_kill
- cmp al,3 ; <Ctrl-C>
- jne ac_ret2
-ac_kill: mov si,aborted_msg
-
-;
-; abort_load: Called by various routines which wants to print a fatal
-; error message and return to the command prompt. Since this
-; may happen at just about any stage of the boot process, assume
-; our state is messed up, and just reset the segment registers
-; and the stack forcibly.
-;
-; SI = offset (in _text) of error message to print
-;
-abort_load:
- mov ax,cs ; Restore CS = DS = ES
- mov ds,ax
- mov es,ax
- cli
- mov sp,StackBuf-2*3 ; Reset stack
- mov ss,ax ; Just in case...
- sti
- call cwritestr ; Expects SI -> error msg
-al_ok: jmp enter_command ; Return to command prompt
-;
-; End of abort_check
-;
-ac_ret2: popa
-ac_ret1: ret
+%include "abort.inc"
;
; allocate_file: Allocate a file structure
retf ; Return to PXE
;
-; abort_check: let the user abort with <ESC> or <Ctrl-C>
+; Abort loading code
;
-abort_check:
- call pollchar
- jz ac_ret1
- pusha
- call getchar
- cmp al,27 ; <ESC>
- je ac_kill
- cmp al,3 ; <Ctrl-C>
- jne ac_ret2
-ac_kill: mov si,aborted_msg
-
-;
-; abort_load: Called by various routines which wants to print a fatal
-; error message and return to the command prompt. Since this
-; may happen at just about any stage of the boot process, assume
-; our state is messed up, and just reset the segment registers
-; and the stack forcibly.
-;
-; SI = offset (in _text) of error message to print
-;
-abort_load:
- mov ax,cs ; Restore CS = DS = ES
- mov ds,ax
- mov es,ax
- lss esp,[BaseStack]
- sti
- call cwritestr ; Expects SI -> error msg
-al_ok: jmp enter_command ; Return to command prompt
-;
-; End of abort_check
-;
-ac_ret2: popa
-ac_ret1: ret
-
+%include "abort.inc"
;
; kaboom: write a message and bail out. Wait for quite a while,
A suite of bootloaders for Linux
- Copyright (C) 1994-2004 H. Peter Anvin
+ Copyright (C) 1994-2005 H. Peter Anvin
This program is provided under the terms of the GNU General Public
License, version 2 or, at your option, any later version. There is no