kvisc/ka/sys/intr/trap0.k

50 lines
760 B
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.
TRAP0_STACK := 0x300000
trap0_handler:
.init:
2019-07-10 12:28:20 +02:00
mov rcx, .text
2019-07-09 19:51:03 +02:00
mov rbp, TRAP0_STACK
jmp TrapHandlers.prolog
2019-07-10 12:28:20 +02:00
.text:
2019-07-09 19:51:03 +02:00
mov ax0, r12
2019-07-10 12:26:15 +02:00
mov ax1, $rax
call RFS.LoadReg
2019-07-09 19:51:03 +02:00
call RFS.LoadArgs
2019-07-10 12:26:15 +02:00
b.z rax, Sys.HLT, .handle_HLT
b.z rax, Sys.FindNext, .handle_FindNext
b.z rax, Sys.FindFirst, .handle_FindFirst
2019-07-09 19:51:03 +02:00
.fini:
jmp TrapHandlers.epilog
;
; Syscall implementations
;
2019-07-10 12:26:15 +02:00
.handle_FindFirst:
call DISK.FindFirst
jmp .fini
.handle_FindNext:
call DISK.FindNext
2019-07-09 19:51:03 +02:00
jmp .fini
.handle_HLT:
hlt
.HLT.loop:
xpause
scan rax
b.z rax, 0, .HLT.loop
prn rax
jmp .HLT.loop