rdos/kernel/main.asm

52 lines
626 B
NASM
Raw Normal View History

cpu 8086
org 0x0100
jmp init
2019-09-06 00:24:39 +02:00
isr_dos_main:
cmp ah, 0x01
je isr_getc_echo
cmp ah, 0x02
je isr_putc
jmp isr_invalid
%include "chario.asm"
%include "intr.asm"
%include "cache.asm"
; ISR for invalid subfunctions or unimplemented
isr_invalid:
mov bp, 0xFEFE
int3
.hlt:
hlt
jmp .hlt
; ISR tail to set carry flag to signal error
2019-09-06 00:24:39 +02:00
isr_error:
push bp
mov bp, sp
; set carry flag
or WORD [SS:BP+6], 1
pop bp
isr_return:
iret
init:
push cs
pop es
mov di, isr_dos_main
mov ax, 0x21
call intr_register
mov di, kernel_end
call cache_init
2019-09-03 12:58:06 +02:00
int3
cli
.halt:
hlt
jmp .halt
2019-09-06 00:24:39 +02:00
kernel_end: