Use COM-based format, get bootloader working

This commit is contained in:
Nero 2019-09-08 01:04:01 +00:00
parent 11b4d07dc1
commit d853b87ec7
4 changed files with 201 additions and 207 deletions

View file

@ -1,60 +1,5 @@
cpu 8086
org 0x0000
rom:
db 0x55, 0xAA
.sectors:
db 0x00
.init:
push cs
pop es
mov di, start
mov ax, 0x18
call intr_register
retf
.name:
db "ROM DOS", 0
times (0x18 - ($-$$)) db 0
.pcir_ptr:
dw 0
times (0x1A - ($-$$)) db 0
.pnp_ptr:
dw pnp
pnp:
db "$PnP"
.version:
db 1 ; version 1
.length:
db 2 ; 2 * 16 length
dw 0 ; offset of next header
db 0
.checksum:
db 0 ; checksum (filled by fix-rom)
dd 0 ; device identifier
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
call drvtab_create
org 0x0100
push cs
pop es
mov di, isr_dos_main
@ -64,7 +9,6 @@ start:
.loop:
mov ah, 0x01
int 0x21
int3
jmp .loop
cli
@ -91,4 +35,4 @@ isr_return:
%include "chario.asm"
align 512
times 1000 db 0xEA