rdos/kernel/main.asm

59 lines
768 B
NASM
Raw Normal View History

cpu 8086
; Memory layout (starting from top)
2019-09-29 14:23:39 +02:00
%define self 0xF000
2019-10-12 20:33:26 +02:00
; A single sector for deblocking
%define diskbuf (self-0x200)
2019-09-29 14:23:39 +02:00
2019-10-12 20:33:26 +02:00
%define stack (diskbuf)
2019-09-29 14:23:39 +02:00
2019-10-12 20:33:26 +02:00
%define default_drive BYTE [0x4]
2019-09-29 23:25:29 +02:00
org self
jmp init
2019-09-06 00:24:39 +02:00
banner:
2019-10-08 21:53:41 +02:00
db "RDOS 2019-09", 0x0A, 0x0D, '$', 0
2019-09-19 22:02:16 +02:00
init:
mov sp, stack
2019-10-08 21:53:41 +02:00
mov default_drive, 0x01
2019-10-08 21:53:41 +02:00
mov dx, banner
call print_string
2019-09-29 14:23:39 +02:00
2019-10-12 20:33:26 +02:00
mov si, init_program
call exec
cli
.halt:
hlt
jmp .halt
2019-09-06 00:24:39 +02:00
2019-09-29 14:23:39 +02:00
init_program:
db "HELLO.COM", 0
cpm_syscall:
2019-10-08 21:53:41 +02:00
cmp cl, 0
je init
cmp cl, 1
je console_input
cmp cl, 2
je console_output
cmp cl, 9
je print_string
cmp cl, 10
je read_buffer
stc
ret
2019-10-08 21:53:41 +02:00
%include "char.asm"
2019-09-29 14:23:39 +02:00
%include "exec.asm"
%include "fcb.asm"
2019-10-08 19:54:39 +02:00
%include "fcbparse.asm"
2019-09-29 23:25:29 +02:00
%include "drive.asm"
2019-10-08 19:54:39 +02:00
%include "log2.asm"
2019-10-12 20:33:26 +02:00
%include "dump.asm"