summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2021-08-26 18:33:54 +0000
committerJoursoir <chat@joursoir.net>2021-08-26 18:33:54 +0000
commit3009fc4d4ea33d3d6e29d5b1877c6d21c3db3c47 (patch)
treeb60b08f2d12d612de99f46ad828d43538cb06b0c
parent47be053721ffd099f126e845809af35b0f6b8387 (diff)
downloadmfsos-3009fc4d4ea33d3d6e29d5b1877c6d21c3db3c47.tar.gz
mfsos-3009fc4d4ea33d3d6e29d5b1877c6d21c3db3c47.tar.bz2
mfsos-3009fc4d4ea33d3d6e29d5b1877c6d21c3db3c47.zip
x86/boot/bootsect: load the kernel at a new address
-rw-r--r--arch/x86/boot/bootsect.s3
1 files changed, 2 insertions, 1 deletions
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