Invoke ONERROR if we hit abort_load (and ONERROR is set.)
authorH. Peter Anvin <hpa@zytor.com>
Fri, 26 Jan 2007 01:03:53 +0000 (17:03 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Fri, 26 Jan 2007 01:03:53 +0000 (17:03 -0800)
NEWS
abort.inc
ui.inc

diff --git a/NEWS b/NEWS
index 325eb48..3320566 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,7 @@ Changes in 3.35:
          To install ldlinux.sys in a subdirectory, pass the -d
          directory option to the SYSLINUX installer.
        * New API call: read disk.
+       * Invoke ONERROR on initrd load failure.
 
 Changes in 3.31:
        * The simple menu system (menu.c32 and vesamenu.c32) now
index 80d70ad..e6bf0d5 100644 (file)
--- a/abort.inc
+++ b/abort.inc
@@ -1,6 +1,6 @@
 ; -----------------------------------------------------------------------
 ;
-;   Copyright 2005-2006 H. Peter Anvin - All Rights Reserved
+;   Copyright 2005-2007 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
@@ -33,8 +33,8 @@ abort_check:
 .ret1:         ret
 
 .kill:         mov si,aborted_msg
-
-               ; ... fall through ...
+               mov bx,enter_command
+               jmp abort_load_chain
 
 ;
 ; abort_load: Called by various routines which wants to print a fatal
@@ -44,10 +44,22 @@ abort_check:
 ;             and the stack forcibly.
 ;
 ;             SI    = offset (in _text) of error message to print
+;            BX    = future entry point (abort_load_chain)
 ;
 abort_load:
+               mov bx,error_or_command
+abort_load_chain:
                RESET_STACK_AND_SEGS AX
                 call cwritestr                  ; Expects SI -> error msg
 
                ; Return to the command prompt
-               jmp enter_command
+               jmp bx
+
+;
+; error_or_command: Execute ONERROR if appropriate, otherwise enter_command
+;
+error_or_command:
+               mov cx,[OnerrorLen]
+               and cx,cx
+               jnz on_error
+               jmp enter_command
\ No newline at end of file
diff --git a/ui.inc b/ui.inc
index 6ea3a4a..7c68fc5 100644 (file)
--- a/ui.inc
+++ b/ui.inc
@@ -1,6 +1,6 @@
 ;; -----------------------------------------------------------------------
 ;;
-;;   Copyright 1994-2005 H. Peter Anvin - All Rights Reserved
+;;   Copyright 1994-2007 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
@@ -368,7 +368,7 @@ bad_kernel:
                 jmp abort_load                  ; Ask user for clue
 
 ;
-; on_error: bad kernel, but we have onerror set
+; on_error: bad kernel, but we have onerror set; CX = OnerrorLen
 ;
 on_error:
                mov si,Onerror