Magellan Linux

Annotation of /trunk/mkinitrd-magellan/isolinux/abort.inc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 532 - (hide annotations) (download)
Sat Sep 1 22:45:15 2007 UTC (16 years, 8 months ago) by niro
File size: 1913 byte(s)
-import if magellan mkinitrd; it is a fork of redhats mkinitrd-5.0.8 with all magellan patches and features; deprecates magellan-src/mkinitrd

1 niro 532 ; $Id: abort.inc,v 1.1 2007-09-01 22:44:04 niro Exp $
2     ; -----------------------------------------------------------------------
3     ;
4     ; Copyright 2005 H. Peter Anvin - All Rights Reserved
5     ;
6     ; This program is free software; you can redistribute it and/or modify
7     ; it under the terms of the GNU General Public License as published by
8     ; the Free Software Foundation, Inc., 53 Temple Place Ste 330,
9     ; Boston MA 02111-1307, USA; either version 2 of the License, or
10     ; (at your option) any later version; incorporated herein by reference.
11     ;
12     ; -----------------------------------------------------------------------
13    
14     ;
15     ; abort.inc
16     ;
17     ; Code to terminate a kernel load
18     ;
19    
20     section .text
21     ;
22     ; abort_check: let the user abort with <ESC> or <Ctrl-C>
23     ;
24     abort_check:
25     call pollchar
26     jz .ret1
27     pusha
28     call getchar
29     cmp al,27 ; <ESC>
30     je .kill
31     cmp al,3 ; <Ctrl-C>
32     je .kill
33     .ret2: popa
34     .ret1: ret
35    
36     .kill: mov si,aborted_msg
37    
38     ; ... fall through ...
39    
40     ;
41     ; abort_load: Called by various routines which wants to print a fatal
42     ; error message and return to the command prompt. Since this
43     ; may happen at just about any stage of the boot process, assume
44     ; our state is messed up, and just reset the segment registers
45     ; and the stack forcibly.
46     ;
47     ; SI = offset (in _text) of error message to print
48     ;
49     abort_load:
50     mov ax,cs ; Restore CS = DS = ES
51     mov ds,ax
52     mov es,ax
53     %if IS_SYSLINUX || IS_EXTLINUX
54     mov ss,ax ; Just in case...
55     mov sp,StackBuf-2*3 ; Reset stack
56     %elif IS_PXELINUX
57     lss esp,[BaseStack]
58     %elif IS_ISOLINUX
59     lss sp,[StackPtr]
60     %else
61     NEED TO KNOW HOW TO RESET STACK
62     %endif
63     sti
64     call cwritestr ; Expects SI -> error msg
65    
66     ; Return to the command prompt
67     jmp enter_command