2019-05-30 12:44:56 +02:00
|
|
|
; The OS/K Team licenses this file to you under the MIT license.
|
2019-05-30 12:27:13 +02:00
|
|
|
; See the LICENSE file in the project root for more information.
|
|
|
|
|
2019-06-21 22:19:55 +02:00
|
|
|
PrintBootMsg:
|
2019-07-24 16:52:26 +02:00
|
|
|
call print, .bootmsg
|
2019-06-21 22:19:55 +02:00
|
|
|
ret
|
|
|
|
|
|
|
|
.bootmsg = "Starting DOS...\n\n"
|
|
|
|
|
2019-07-09 19:51:03 +02:00
|
|
|
;
|
|
|
|
; 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
|
2019-08-03 17:41:44 +02:00
|
|
|
inc ax0, 255 # TRAP no. (ax0 - 1)
|
2019-07-09 19:51:03 +02:00
|
|
|
call IDT.AddHandler
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
2019-07-15 20:58:17 +02:00
|
|
|
SwitchToCMD:
|
|
|
|
mov rax, Sys.Exit
|
|
|
|
trap 0
|
|
|
|
|
2019-05-30 12:27:13 +02:00
|
|
|
;
|
|
|
|
; Main function
|
|
|
|
;
|
|
|
|
main:
|
2019-06-21 22:19:55 +02:00
|
|
|
call PrintBootMsg
|
2019-07-09 19:51:03 +02:00
|
|
|
call InitSyscalls
|
2019-07-15 20:58:17 +02:00
|
|
|
call SwitchToCMD
|
2019-06-18 12:58:26 +02:00
|
|
|
ret
|
|
|
|
|