kvisc/ka/sys/intr/common.k

61 lines
1.1 KiB
Plaintext
Raw Normal View History

2019-07-09 19:51:03 +02:00
; The OS/K Team licenses this file to you under the MIT license.
; See the LICENSE file in the project root for more information.
2019-08-06 22:47:39 +02:00
ScreenOfDeath:
push r12
mov r12, ax0
prn 10
prn PRN_CLEAR
prn PRN_FLUSH
2019-08-06 23:21:37 +02:00
push ax1
call printf, .scr1
2019-08-14 20:23:05 +02:00
pop
2019-08-06 22:47:39 +02:00
2019-08-14 09:52:39 +02:00
bnz r14, .not_con
2019-08-06 22:47:39 +02:00
push .scr2_con
jmp .do_print
.not_con:
2019-08-21 16:57:32 +02:00
; rframes #2-#3-#4 belong to kernel
blt 4, r14, .not_krn
2019-08-06 22:47:39 +02:00
push .scr2_krn
jmp .do_print
.not_krn:
push .scr2_usr
.do_print:
2019-08-08 18:39:12 +02:00
push r14, r12
2019-08-06 22:47:39 +02:00
call printf, .scr2
inc rsp, 24
call dumprf, r14
prn 10
call print, .scr3
.loop:
pause
pause
scan rax
2019-08-14 09:52:39 +02:00
jraxz .loop
2019-08-06 22:47:39 +02:00
2019-08-14 09:52:39 +02:00
beq rax, 0x0A, DefaultTrapHandler.handle_Exit
beq rax, 0x1B, DefaultTrapHandler.handle_Shutdown
2019-08-06 22:47:39 +02:00
jmp .loop
crash
2019-08-06 23:21:37 +02:00
.scr1 = "-------- Unhandled EXCEPTION, TRAP/SYSCALL or INTERRUPT (code %d)\n"
.scr2 = "Description: %s\nFrame: %d (%s)\n\n"
2019-08-06 22:47:39 +02:00
.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"