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
julianb0 2a610f2d7a
vm
2019-07-17 22:25:50 +02:00

44 lines
674 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:
mov rcx, STRLEN_MAX
mov rdx, .bootmsg
prns.rep.nz rdx
ret
.bootmsg = "Starting DOS...\n\n"
;
; Initialize TRAP handlers
;
InitSyscalls:
mov ax0, 1
.prepare_next:
call RFS.ActivateFrame
mov ax1, $rip
mov ax2, trap0_handler
call RFS.StoreReg
mov ax1, ax0
add ax0, ax0, 255 # TRAP no. (ax0 - 1)
call IDT.AddHandler
ret
SwitchToCMD:
mov rax, Sys.Exit
trap 0
;
; Main function
;
main:
call PrintBootMsg
call InitSyscalls
call SwitchToCMD
ret