summaryrefslogtreecommitdiff
path: root/bootloader.asm
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2015-09-28 03:33:19 -0700
committeriximeow <me@iximeow.net>2015-09-28 03:36:28 -0700
commit74057dac1d460574f0b7edb89e9e4125a69c885a (patch)
tree8bd43ea888b33272d21719c7f97c51db1bc58c57 /bootloader.asm
parent4f63bab19769e2aedb9721322501cecf9934156c (diff)
add awful support for non-0x7e00 start, prefix real start address to kernel
Diffstat (limited to 'bootloader.asm')
-rw-r--r--bootloader.asm13
1 files changed, 7 insertions, 6 deletions
diff --git a/bootloader.asm b/bootloader.asm
index c9ed98b..7d218eb 100644
--- a/bootloader.asm
+++ b/bootloader.asm
@@ -13,7 +13,7 @@ start:
call verify_read
mov si, READ_NERR
call write_str
- jmp 0x7e00
+ jmp word [0x7dfc]
jmp hang
read_err:
@@ -23,17 +23,18 @@ hang:
jmp hang
verify_read:
+ mov bx, word [0x7dfc]
mov al, 0x66
- cmp al, [0x7e00]
+ cmp al, byte [bx]
jne read_err
mov al, 0x55
- cmp al, [0x7e01]
+ cmp al, byte [bx+1]
jne read_err
mov al, 0x66
- cmp al, [0x7e02]
+ cmp al, byte [bx+2]
jne read_err
mov al, 0x89
- cmp al, [0x7e03]
+ cmp al, byte [bx+3]
jne read_err
ret
@@ -106,7 +107,7 @@ LBA_DISK_READ_PACKET:
db 0x10
db 0
dw 32 ; number of blocks to read, reset to # actually read when done
- dw 0x7e00 ; read destination address
+ dw 0x7dfc ; read destination address
dw 0x0000
dd 1 ; lba to read from
dd 0 ; for extended lba adresses (not really used here)