rdos/kernel/main.asm

65 lines
836 B
NASM
Raw Normal View History

; assumptions about the starting envionment
cpu 8086
org 0x0000
_startup:
mov ax, cs
2019-03-31 22:54:51 +02:00
mov ds, ax
mov es, ax
mov ss, ax
mov sp, 0x0000
main:
2019-03-31 22:54:51 +02:00
xor ax, ax
mov ds, ax
2019-03-31 22:54:51 +02:00
mov si, ax
mov cx, ax
call debug_init
int 0x2E
2019-03-31 22:54:51 +02:00
call ivt_backup
xor ax, ax
mov ds, ax
mov es, ax
xor cx, cx
mov si, ax
.loop:
mov ax, cx
call kprint8
mov al, '='
call kputc
lodsw
xchg ax, dx
lodsw
call kprint16
mov al, ':'
call kputc
xchg ax, dx
call kprint16
mov al, ' '
call kputc
inc cx
test cx, 0x0003
jnz .loop
mov al, 0x0A
call kputc
mov al, 0x0D
call kputc
cmp cx, 0x0060
jl .loop
.halt:
hlt
jmp .halt
%include "heap.asm"
%include "intr.asm"
%include "debug.asm"
%include "kprintf.asm"
_reloc_end:
align 16
heap: