summaryrefslogtreecommitdiff
path: root/boot/arch/amd64/mbr/mbr.S
diff options
context:
space:
mode:
authorChloe M. <chloe@aptel.org>2026-08-20 06:50:03 +0000
committerChloe M. <chloe@aptel.org>2026-08-20 06:50:03 +0000
commit57f2ee84a8bbfe26ed880d03aa9ca96566e6b8f3 (patch)
treedf943c184b4a8eb82a350bcfdfe57e003921f7d1 /boot/arch/amd64/mbr/mbr.S
parente53055872e7dddaf9df51c9a3b5bf95778509fe2 (diff)
boot: mbr: Link with address relative to 0x0000
Signed-off-by: Chloe M. <chloe@aptel.org>
Diffstat (limited to 'boot/arch/amd64/mbr/mbr.S')
-rw-r--r--boot/arch/amd64/mbr/mbr.S5
1 files changed, 4 insertions, 1 deletions
diff --git a/boot/arch/amd64/mbr/mbr.S b/boot/arch/amd64/mbr/mbr.S
index e071a41..236f9f1 100644
--- a/boot/arch/amd64/mbr/mbr.S
+++ b/boot/arch/amd64/mbr/mbr.S
@@ -1,7 +1,10 @@
+/* Segment constants */
+#define BOOT_SEG 0x7C0 /* Segment we reside on startup */
+
.code16
_start:
/* Normalize CS + other selectors */
- ljmp $0x00,$1f
+ ljmp $BOOT_SEG,$1f
1: xor %ax, %ax
mov %ax, %ds
mov %ax, %ss