Annotation of /tags/mkinitrd-6_3_0/isolinux/abort.inc
Parent Directory | Revision Log
Revision 1139 -
(hide annotations)
(download)
Thu Aug 19 10:14:02 2010 UTC (14 years, 1 month ago) by niro
File size: 2116 byte(s)
Thu Aug 19 10:14:02 2010 UTC (14 years, 1 month ago) by niro
File size: 2116 byte(s)
tagged 'mkinitrd-6_3_0'
1 | niro | 532 | ; ----------------------------------------------------------------------- |
2 | ; | ||
3 | niro | 1133 | ; Copyright 2005-2009 H. Peter Anvin - All Rights Reserved |
4 | ; Copyright 2009 Intel Corporation; author: H. Peter Anvin | ||
5 | ; | ||
6 | niro | 532 | ; 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 | niro | 1133 | |
22 | niro | 532 | ; |
23 | niro | 1133 | ; dot_pause: same as abort_check, except prints a dot, too |
24 | ; assumes CS == DS | ||
25 | ; | ||
26 | dot_pause: | ||
27 | push si | ||
28 | mov si,dot_msg | ||
29 | call writestr_qchk | ||
30 | pop si | ||
31 | ; fall through | ||
32 | |||
33 | ; | ||
34 | niro | 532 | ; abort_check: let the user abort with <ESC> or <Ctrl-C> |
35 | ; | ||
36 | abort_check: | ||
37 | niro | 1133 | call reset_idle ; Not idle despite pollchar |
38 | niro | 532 | call pollchar |
39 | jz .ret1 | ||
40 | pusha | ||
41 | call getchar | ||
42 | cmp al,27 ; <ESC> | ||
43 | je .kill | ||
44 | cmp al,3 ; <Ctrl-C> | ||
45 | je .kill | ||
46 | .ret2: popa | ||
47 | .ret1: ret | ||
48 | |||
49 | .kill: mov si,aborted_msg | ||
50 | niro | 1133 | mov bx,enter_command |
51 | jmp abort_load_chain | ||
52 | niro | 532 | |
53 | ; | ||
54 | ; abort_load: Called by various routines which wants to print a fatal | ||
55 | ; error message and return to the command prompt. Since this | ||
56 | ; may happen at just about any stage of the boot process, assume | ||
57 | ; our state is messed up, and just reset the segment registers | ||
58 | ; and the stack forcibly. | ||
59 | ; | ||
60 | ; SI = offset (in _text) of error message to print | ||
61 | niro | 1133 | ; BX = future entry point (abort_load_chain) |
62 | niro | 532 | ; |
63 | abort_load: | ||
64 | niro | 1133 | mov bx,error_or_command |
65 | abort_load_chain: | ||
66 | RESET_STACK_AND_SEGS AX | ||
67 | call writestr ; Expects SI -> error msg | ||
68 | niro | 532 | |
69 | ; Return to the command prompt | ||
70 | niro | 1133 | jmp bx |
71 | |||
72 | ; | ||
73 | ; error_or_command: Execute ONERROR if appropriate, otherwise enter_command | ||
74 | ; | ||
75 | error_or_command: | ||
76 | mov cx,[OnerrorLen] | ||
77 | and cx,cx | ||
78 | jnz on_error | ||
79 | niro | 532 | jmp enter_command |
80 | niro | 1133 | |
81 | section .data | ||
82 | aborted_msg db ' aborted.', CR, LF, 0 | ||
83 | |||
84 | section .text |