kvisc/ka/sys/intr/common.k

61 lines
1.1 KiB
Plaintext

; The OS/K Team licenses this file to you under the MIT license.
; See the LICENSE file in the project root for more information.
ScreenOfDeath:
push nx0
mov nx0, ax0
prn 10
prn PRN_CLEAR
prn PRN_FLUSH
push ax1
call printf, .scr1
pop
bnz nx2, .not_con
push .scr2_con
jmp .do_print
.not_con:
; rframes #2-#3-#4 belong to kernel
blt 4, nx2, .not_krn
push .scr2_krn
jmp .do_print
.not_krn:
push .scr2_usr
.do_print:
push nx2, nx0
call printf, .scr2
add esp, 24
call dumprf, nx2
prn 10
call print, .scr3
.loop:
pause
pause
scan eax
jraxz .loop
beq eax, 0x0A, DefaultTrapHandler.handle_Exit
beq eax, 0x1B, DefaultTrapHandler.handle_Shutdown
jmp .loop
crash
.scr1 = "-------- Unhandled EXCEPTION, TRAP/SYSCALL or INTERRUPT (code %d)\n"
.scr2 = "Description: %s\nFrame: %d (%s)\n\n"
.scr3 = "Press:\n ENTER to procede to COMMAND.COM\n ESCAPE to shutdown machine\n\n"
.scr2_con = "dedicated command.com frame"
.scr2_usr = "userspace application frame"
.scr2_krn = "exception/interrupt handler"