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
|
|
|
|
call RFS.ActivateFrame
|
|
|
|
|
|
|
|
mov ax1, $rip
|
2019-08-06 23:21:37 +02:00
|
|
|
mov ax2, DefaultTrapHandler
|
2019-07-09 19:51:03 +02:00
|
|
|
call RFS.StoreReg
|
2019-08-06 23:21:37 +02:00
|
|
|
|
|
|
|
mov ax0, 256
|
|
|
|
mov ax1, 1
|
2019-07-09 19:51:03 +02:00
|
|
|
call IDT.AddHandler
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
2019-08-06 23:21:37 +02:00
|
|
|
InitExcepts:
|
|
|
|
mov ax0, 2
|
|
|
|
call RFS.ActivateFrame
|
|
|
|
|
|
|
|
mov ax1, $rip
|
|
|
|
mov ax2, DefaultExceptionHandler
|
|
|
|
call RFS.StoreReg
|
|
|
|
|
|
|
|
mov ax0, zero
|
|
|
|
mov ax1, 2
|
|
|
|
call IDT.AddHandler
|
|
|
|
|
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-08-06 23:21:37 +02:00
|
|
|
call InitExcepts
|
2019-07-15 20:58:17 +02:00
|
|
|
call SwitchToCMD
|
2019-06-18 12:58:26 +02:00
|
|
|
ret
|
|
|
|
|