bounds check gpt starting lba
This commit is contained in:
1 parent
f645368a06
commit
f86617e750
1 file changed
+16
-8
@@ -86,14 +86,22 @@ bits 16
|
||||
repe cmpsb
|
||||
jne .panic
|
||||
|
||||
; mov word fs:[0x0000], 0xc048
|
||||
; mov word fs:[0x0002], 0xc069
|
||||
mov al, [0x7e00]
|
||||
mov byte fs:[0x0000], al
|
||||
mov al, [0x7e01]
|
||||
mov byte fs:[0x0002], al
|
||||
mov al, [0x7e02]
|
||||
mov byte fs:[0x0004], al
|
||||
; Ensure the 8-byte starting LBA fits in 16 bits
|
||||
mov di, 0x7e00 ; the rep increments di so we need to reset it
|
||||
xor bx, bx
|
||||
mov ax, [di + 0x4a]
|
||||
or bx, ax
|
||||
mov ax, [di + 0x4c]
|
||||
or bx, ax
|
||||
mov ax, [di + 0x4e]
|
||||
or bx, ax
|
||||
jnz .panic
|
||||
|
||||
mov ax, [di + 0x48]
|
||||
|
||||
mov word fs:[0x0000], 0xc048
|
||||
mov word fs:[0x0002], 0xc069
|
||||
|
||||
hlt
|
||||
|
||||
.panic:
|
||||
|
||||
Reference in new issue
Block a user