Change kernel blob format to be option rom compatible

This commit is contained in:
Nero 2019-04-20 21:02:35 +00:00
parent 3b3fa349d4
commit d8fe1b211c
4 changed files with 152 additions and 52 deletions

View file

@ -48,10 +48,6 @@ _startup:
; setup stack area growing down from 0x10000
mov ss, ax
mov sp, ax
; backup important values
push bx
push cx
push dx
; adjust CS
jmp 0x07C0:main
@ -63,6 +59,11 @@ rootdir:
dw 0
main:
; backup important values
push bx
push cx
push dx
; setup buffer area directly at 4k
mov ax, 0x0100
mov ds, ax
@ -78,13 +79,16 @@ main:
; restore important variables
xor ax, ax
mov bp, ax
mov si, ax
mov di, ax
pop dx
pop cx
pop bx
jmp 0x0100:0000
mov di, [0x001A]
mov ax, [di+0x1A]
push ds
push ax
retf
call error
db "ROM ERROR", 0
; Write AX, a string and bail out
; Return pointer is the string start
@ -228,9 +232,9 @@ loadblk:
times (0x1F0 - ($-$$)) db 0
bootfilename:
db "BOOT"
db "KERNEL"
times (0x1F8 - ($-$$)) db " "
db "BIN"
db "ROM"
times (0x1FE - ($-$$)) db 0