Rev 656 | Rev 684 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 656 | Rev 658 | ||
---|---|---|---|
Line 9... | Line 9... | ||
9 | ;; Distributed under GPL. See file COPYING for details. ;; |
9 | ;; Distributed under GPL. See file COPYING for details. ;; |
10 | ;; Copyright 2003 Ville Turjanmaa ;; |
10 | ;; Copyright 2003 Ville Turjanmaa ;; |
11 | ;; ;; |
11 | ;; ;; |
12 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
12 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 13... | Line 13... | ||
13 | 13 | ||
Line 14... | Line 14... | ||
14 | $Revision: 656 $ |
14 | $Revision: 658 $ |
15 | 15 | ||
16 | 16 | ||
Line 114... | Line 114... | ||
114 | mov eax, [eax+APPDATA.debugger_slot] |
114 | mov eax, [eax+APPDATA.debugger_slot] |
115 | test eax, eax |
115 | test eax, eax |
116 | jnz .debug |
116 | jnz .debug |
117 | sti |
117 | sti |
118 | ; not debuggee => say error and terminate |
118 | ; not debuggee => say error and terminate |
119 | add esp, 0x20 ;28h |
- | |
120 | movzx eax, bl |
119 | movzx eax, bl |
121 | mov [error_interrupt], eax |
120 | mov [error_interrupt], eax |
122 | call show_error_parameters |
121 | call show_error_parameters |
123 | - | ||
- | 122 | add esp, 0x20 |
|
124 | mov edx, [TASK_BASE] |
123 | mov edx, [TASK_BASE] |
125 | mov [edx + TASKDATA.state], byte 4 |
124 | mov [edx + TASKDATA.state], byte 4 |
Line 126... | Line 125... | ||
126 | 125 | ||
Line 145... | Line 144... | ||
145 | mov byte [edx+TASKDATA.state], 1 ; suspended |
144 | mov byte [edx+TASKDATA.state], 1 ; suspended |
146 | call change_task |
145 | call change_task |
147 | restore_ring3_context |
146 | restore_ring3_context |
148 | iretd |
147 | iretd |
Line 149... | Line -... | ||
149 | - | ||
150 | writehex: |
- | |
151 | pusha |
- | |
152 | - | ||
153 | mov edi, [write_error_to] |
- | |
154 | mov esi, 8 |
- | |
155 | @@: |
- | |
156 | mov ecx, eax |
- | |
157 | and ecx, 0xf |
- | |
158 | - | ||
159 | mov cl,[ecx+hexletters] |
- | |
160 | mov [edi],cl |
- | |
161 | dec edi |
- | |
162 | - | ||
163 | shr eax,4 |
- | |
164 | dec esi |
- | |
165 | jnz @b |
- | |
166 | - | ||
167 | popa |
- | |
168 | ret |
- | |
169 | 148 | ||
170 | iglobal |
149 | iglobal |
171 | hexletters db '0123456789ABCDEF' |
- | |
172 | 150 | hexletters db '0123456789ABCDEF' |
|
173 | error_interrupt dd -1 |
- | |
174 | - | ||
175 | process_error db 'K : Process - forced terminate INT: 00000000',13,10,0 |
- | |
176 | process_pid db 'K : Process - forced terminate PID: 00000000',13,10,0 |
- | |
177 | process_eip db 'K : Process - forced terminate EIP: 00000000',13,10,0 |
- | |
178 | system_error db 'K : Kernel error',13,10,0 |
- | |
179 | endg |
- | |
180 | - | ||
181 | uglobal |
- | |
182 | write_error_to dd 0x0 |
151 | error_interrupt dd -1 |
Line 183... | Line -... | ||
183 | endg |
- | |
184 | - | ||
185 | ;show_error_parameters: |
- | |
186 | ; |
- | |
187 | ; mov [write_error_to],process_pid+43 |
- | |
188 | ; mov eax,[CURRENT_TASK] |
152 | endg |
189 | ; shl eax, 5 |
- | |
190 | ; mov eax,[CURRENT_TASK+TASKDATA.pid+eax] |
- | |
191 | ; call writehex |
- | |
192 | ; |
- | |
193 | ; mov [write_error_to],process_error+43 |
- | |
194 | ; mov eax,[error_interrupt] |
- | |
195 | ; call writehex |
- | |
196 | ; |
- | |
197 | ; cmp dword [esp+4+4], os_code ; CS |
- | |
198 | ; jnz @f |
- | |
199 | ; ;mov esi,system_error |
- | |
200 | ; ;call sys_msg_board_str |
- | |
201 | ; DEBUGF 1,"%s",system_error |
- | |
202 | ; @@: |
- | |
203 | ; mov eax, [esp+4] ; EIP |
- | |
204 | ; |
- | |
205 | ; mov [write_error_to],process_eip+43 |
- | |
206 | ; call writehex |
- | |
207 | ; |
- | |
208 | ; ;mov esi,process_error |
- | |
209 | ; ;call sys_msg_board_str |
- | |
210 | ; DEBUGF 1,"%s",process_error |
- | |
211 | ; |
- | |
212 | ; ;mov esi,process_pid |
- | |
213 | ; ;call sys_msg_board_str |
- | |
214 | ; DEBUGF 1,"%s",process_pid |
- | |
215 | ; |
- | |
216 | ; ;mov esi,process_eip |
- | |
217 | ; ;call sys_msg_board_str |
- | |
218 | ; DEBUGF 1,"%s",process_eip |
- | |
219 | ; |
153 | |
220 | ; ret |
- | |
221 | show_error_parameters: |
154 | ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= |
222 | diff16 '[esp]',0,$ |
155 | show_error_parameters: |
223 | mov eax,[CURRENT_TASK] |
156 | mov eax,[CURRENT_TASK] |
224 | shl eax, 5 |
157 | shl eax, 5 |
225 | DEBUGF 1, "K : Process - forced terminate PID: %x\n", [CURRENT_TASK + TASKDATA.pid + eax] |
158 | DEBUGF 1, "K : Process - forced terminate PID: %x\n", [CURRENT_TASK + TASKDATA.pid + eax] |
Line 234... | Line 167... | ||
234 | cmp eax, app_code |
167 | cmp eax, app_code |
235 | je @f |
168 | je @f |
236 | mov edi, msg_sel_ker |
169 | mov edi, msg_sel_ker |
237 | mov ebx, [esp - 16 + 0x20] |
170 | mov ebx, [esp - 16 + 0x20] |
238 | @@: |
171 | @@: |
239 | ; DEBUGF 1, "ESP : %x\nK : Flags : %x CS : %x (%s)\n", ebx, [esp + 12 + 0x20], eax, edi |
172 | DEBUGF 1, "ESP : %x\nK : Flags : %x CS : %x (%s)\n", ebx, [esp + 12 + 0x20], eax, edi |
240 | DEBUGF 1, "ESP : %x\nK : Flags : %x CS : %x\n", ebx, [esp + 12 + 0x20], eax |
- | |
241 | ret |
173 | ret |
242 | - | ||
- | 174 | ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= |
|
Line 243... | Line 175... | ||
243 | 175 | ||
244 | - | ||
245 | ; irq1 -> hid/keyboard.inc |
- | |
246 | 176 | ||
247 | 177 | ; irq1 -> hid/keyboard.inc |
|
248 | macro irqh [num] |
178 | macro irqh [num] |
249 | { |
179 | { |
250 | forward |
180 | forward |