rdos/boot/kernel.asm

64 lines
904 B
NASM
Raw Normal View History

cpu 8086
org 0x7C00
%include "inc/bpb.asm"
%include "inc/mbr.asm"
2020-10-13 22:10:23 +02:00
%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, ax
call printf
%defstr VERSIONSTR VERSION
db "RDOS ", VERSIONSTR, 0x0A, 0x0D, 0
push dx
call dinit
pop dx
2020-10-13 22:10:23 +02:00
cmp dl, 0x80
jc .k
sub dl, (0x80-2)
.k: mov [defdrv], dl
2020-12-26 18:44:48 +01:00
call logdrv
mov word [0x21*4], int21
mov word [0x21*4+2], cs
mov word [curpsp], 0x1000
mov ah, 2
mov dl, 0x37
int 0x21
2020-12-26 18:44:48 +01:00
restart:
hlt: hlt
jmp hlt
2020-04-20 19:13:06 +02:00
%include "kernel/bdos.asm"
%include "kernel/far.asm"
2020-10-13 22:10:23 +02:00
%include "kernel/fcb.asm"
%include "kernel/find.asm"
%include "kernel/drive.asm"
%include "kernel/printf.asm"
%include "kernel/char.asm"
2020-10-13 22:10:23 +02:00
section .data
testfcb: db 0
db "HELLO ", "COM"
times 30 db 0
2020-04-23 21:36:20 +02:00
section .bss
alignb 2
stack: resb stacksize