rdos/kernel/main.asm

95 lines
1.2 KiB
NASM
Raw Normal View History

cpu 8086
org 0x0000
2019-09-07 01:42:39 +02:00
rom:
db 0x55, 0xAA
2019-09-07 01:42:39 +02:00
.sectors:
db 0x00
2019-09-07 01:42:39 +02:00
.init:
push cs
pop es
mov di, start
mov ax, 0x18
call intr_register
retf
.name:
db "ROM DOS", 0
2019-09-07 01:42:39 +02:00
times (0x18 - ($-$$)) db 0
.pcir_ptr:
dw 0
times (0x1A - ($-$$)) db 0
.pnp_ptr:
dw pnp
pnp:
db "$PnP"
2019-08-31 00:18:05 +02:00
.version:
db 1 ; version 1
2019-08-31 00:18:05 +02:00
.length:
db 2 ; 2 * 16 length
dw 0 ; offset of next header
db 0
2019-08-31 00:18:05 +02:00
.checksum:
db 0 ; checksum (filled by fix-rom)
dd 0 ; device identifier
2019-09-07 01:42:39 +02:00
dw 0 ; manufacturer string
dw rom.name ; product name string
db 0,0,0 ; device type string
db 0x20 ; device indicator, bit for "read cacheable" set
dw 0 ; boot connection vector
dw 0 ; boot disconnect vector
dw start ; bootstrap entry point
dw 0 ; reserved
dw 0
start:
xor ax, ax
mov ds, ax
mov es, ax
mov ss, ax
mov sp, 0x800
mov di, sp
2019-09-03 12:58:06 +02:00
call drvtab_create
2019-09-06 00:24:39 +02:00
push cs
pop es
mov di, isr_dos_main
mov ax, 0x21
call intr_register
.loop:
mov ah, 0x01
int 0x21
2019-09-07 01:42:39 +02:00
int3
2019-09-06 00:24:39 +02:00
jmp .loop
2019-09-03 12:58:06 +02:00
2019-08-31 00:18:05 +02:00
cli
.halt:
hlt
jmp .halt
2019-09-06 00:24:39 +02:00
isr_dos_main:
cmp ah, 0x01
je isr_getc
cmp ah, 0x02
je isr_putc
isr_error:
push bp
mov bp, sp
; set carry flag
or WORD [SS:BP+6], 1
pop bp
isr_return:
iret
2019-09-03 12:58:06 +02:00
%include "intr.asm"
%include "drvtab.asm"
2019-09-06 00:24:39 +02:00
%include "chario.asm"
2019-08-30 19:40:47 +02:00
align 512