Relocate kernel to 0x01000 per convention

This commit is contained in:
Nero 2019-04-16 07:22:53 +00:00
parent 0094ee6b95
commit 8cdc21b596

View File

@ -44,26 +44,16 @@ fdc: ; FDC Descriptor as per ECMA-107
times (62 - ($-$$)) db " "
_startup:
mov ax, 0x1050
; setup relocated stack area
xor ax, ax
; setup stack area growing down from 0x10000
mov ss, ax
xor sp, sp
mov sp, ax
; backup important values
push bx
push cx
push dx
; setup relocated code area
mov es, ax
mov di, 0x0000
; setup start code area
xor ax, ax
mov ds, ax
mov si, 0x7C00
; relocate 256 words
mov cx, 0x0100
rep movsw
; adjust CS
jmp 0x1050:main
jmp 0x07C0:main
; non-fdc variables
rootdir:
@ -73,8 +63,8 @@ rootdir:
dw 0
main:
; setup buffer area directly after the BDA
mov ax, 0x0050
; setup buffer area directly at 4k
mov ax, 0x0100
mov ds, ax
mov es, ax
@ -94,7 +84,7 @@ main:
pop dx
pop cx
pop bx
jmp 0x0050:0000
jmp 0x0100:0000
; Write AX, a string and bail out
; Return pointer is the string start