rdos/boot/kernel.asm

57 lines
748 B
NASM
Raw Normal View History

cpu 8086
org 0x7C00
%include "inc/bpb.asm"
%include "inc/mbr.asm"
; kernel stack size in words
%define stacksize 512
jmp near init
%defstr STRVER VERSION
%define INTVER 0x %+ VERSION
db STRVER
; mformat writes stuff until 0x3E
params: times ( 0x3E - ($-$$) ) nop
init: cli
xor ax, ax
mov ds, ax
mov es, ax
mov ss, ax
mov sp, ( stack+stacksize )
mov ax, [params+bpb.sectoroffset]
mov dx, [params+bpb.sectoroffset+2]
mov ax, 0x0201
mov cx, 0x0002
mov dh, 0
mov bx, 0x7E00
int 0x13
mov ax, [0x7E00]
mov cx, [0x7E02]
mov dx, [0x7E04]
int 3
hlt: hlt
jmp hlt
2020-04-20 19:13:06 +02:00
times (0x1FE - ($-$$)) db 0
dw 0xAA55
db "rdos kernel"
dd INTVER
end: align 512
2020-04-23 21:36:20 +02:00
section .bss
stack: resb stacksize