From 3009fc4d4ea33d3d6e29d5b1877c6d21c3db3c47 Mon Sep 17 00:00:00 2001 From: Joursoir Date: Thu, 26 Aug 2021 18:33:54 +0000 Subject: x86/boot/bootsect: load the kernel at a new address --- arch/x86/boot/bootsect.s | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'arch/x86/boot/bootsect.s') diff --git a/arch/x86/boot/bootsect.s b/arch/x86/boot/bootsect.s index 5932445..3410131 100644 --- a/arch/x86/boot/bootsect.s +++ b/arch/x86/boot/bootsect.s @@ -8,6 +8,7 @@ .set CODESEG, gdt_code - gdt_start .set DATASEG, gdt_data - gdt_start +.set SYSSEG, 0x1000 # Historical load address .set MAGIC, 0xAA55 .section .text.bootentry # Code that will start executing at @@ -38,7 +39,7 @@ load_kernel: # Load our kernel mov $0x02, %cl # Select sector 2 (next after the # boot sector) [has a base of 1] mov $0x01, %al # Read 1 sectors - mov $0x9000, %bx # Load sectors to ES:BS (0x9000) + mov $SYSSEG, %bx # Load sectors to ES:BX (0:$SYSSEG) int $0x13 # Start reading from drive jc disk_error # If carry flag set, bios failed to read -- cgit v1.2.3-18-g5258