64 lines
875 B
NASM
64 lines
875 B
NASM
cpu 8086
|
|
org 0x7C00
|
|
|
|
%include "inc/bpb.asm"
|
|
%include "inc/mbr.asm"
|
|
%include "inc/fcb.asm"
|
|
%include "inc/dpt.asm"
|
|
|
|
; kernel stack size in words
|
|
%define stacksize 512
|
|
|
|
init: cli
|
|
xor ax, ax
|
|
mov ds, ax
|
|
mov es, ax
|
|
mov ss, ax
|
|
mov sp, ( stack+stacksize )
|
|
|
|
call printf
|
|
%defstr VERSIONSTR VERSION
|
|
db "RDOS ", VERSIONSTR, 0x0A, 0x0D, 0
|
|
|
|
push dx
|
|
call dinit
|
|
pop dx
|
|
|
|
cmp dl, 0x80
|
|
jc .k
|
|
sub dl, (0x80-2)
|
|
.k: mov [defdrv], dl
|
|
|
|
call logdrv
|
|
|
|
xor ax, ax
|
|
xor dx, dx
|
|
call maprd
|
|
|
|
inc word [dskbuf+0x82]
|
|
push word [dskbuf+0x82]
|
|
|
|
call dirty
|
|
call flush
|
|
|
|
call printf
|
|
db "Current run: ",2,0x0A,0x0D,0
|
|
|
|
hlt: hlt
|
|
jmp hlt
|
|
|
|
%include "kernel/far.asm"
|
|
%include "kernel/fcb.asm"
|
|
%include "kernel/drive.asm"
|
|
%include "kernel/printf.asm"
|
|
|
|
section .data
|
|
|
|
testfcb: db 0
|
|
db "HELLO ", "COM"
|
|
times 30 db 0
|
|
|
|
section .bss
|
|
|
|
stack: resb stacksize
|