1
0
mirror of https://gitlab.os-k.eu/os-k-team/kvisc.git synced 2023-08-25 14:05:46 +02:00
kvisc/ka/sys/main.k
2019-08-14 09:52:39 +02:00

49 lines
752 B
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.
PrintBootMsg:
call print, .bootmsg
ret
.bootmsg = "Starting DOS...\n\n"
;
; Initialize TRAP handlers
;
InitSyscalls:
call RFS.ActivateFrame, 1
mov ax1, $rip
mov ax2, DefaultTrapHandler
call RFS.StoreReg
mov ax0, 256
mov ax1, 1
call IDT.AddHandler
ret
InitExcepts:
call RFS.ActivateFrame, 2
mov ax1, $rip
mov ax2, DefaultExceptionHandler
call RFS.StoreReg
call IDT.AddHandler, zero, 2
SwitchToCMD:
mov rax, Sys.Exit
trap 0
;
; Main function
;
main:
call PrintBootMsg
call InitSyscalls
call InitExcepts
call SwitchToCMD
ret