From 0c74d1e873e5f53e8a4d280d5d4122434afff535 Mon Sep 17 00:00:00 2001 From: pantonshire Date: Tue, 25 Jun 2024 09:19:23 +0100 Subject: [PATCH] reserve space for mbr partition table --- boot.s | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/boot.s b/boot.s index 09e789c..c094b59 100644 --- a/boot.s +++ b/boot.s @@ -34,13 +34,23 @@ bits 16 ; TODO: grab all the info we can from bios interrupts and deliver it to ths OS nicely ; e.g. in a fixed memory location - ; Make sure we fit in a single 512-byte sector - %if ($ - $$) > 510 - %error "exceeded boot sector size" + ; MBR bootstrap field is 440 bytes long + %if ($ - $$) > 440 + %error "exceeded mbr bootstrap field size" %endif - ; Pad to the boot signature offset + ; Pad to the end of the MBR bootstrap field + times 440 - ($ - $$) db 0 + + ; Unique disk ID + dd 0x00000000 + ; Reserved + dw 0x0000 + + ; Zero the partition fields + ; TODO: fill in the field pointing to the GPT table times 510 - ($ - $$) db 0 + ; Boot signature db 0x55 db 0xaa