summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2021-10-01 12:19:08 +0000
committerJoursoir <chat@joursoir.net>2021-10-01 12:19:08 +0000
commite46551eebeeed2e79f1784f1c2b5f48c65d95b1d (patch)
treee7a7f9b2e14c04a0d334be0af12e6b8394d3fba0
parent1d47855c80b63176cd55980cf68d5c187c44a766 (diff)
downloadmfsos-e46551eebeeed2e79f1784f1c2b5f48c65d95b1d.tar.gz
mfsos-e46551eebeeed2e79f1784f1c2b5f48c65d95b1d.tar.bz2
mfsos-e46551eebeeed2e79f1784f1c2b5f48c65d95b1d.zip
x86/boot/head: check a20 line
-rw-r--r--arch/x86/boot/head.s8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/x86/boot/head.s b/arch/x86/boot/head.s
index a1bc6d1..d24e36c 100644
--- a/arch/x86/boot/head.s
+++ b/arch/x86/boot/head.s
@@ -23,5 +23,13 @@ _start:
mov $0x90000, %ebp # Update stack position so it is right
mov %ebp, %esp # at the top of the free space.
+check_a20:
+ mov $0x112345, %edi # Odd megabyte address
+ mov $0x012345, %esi # Even megabyte address
+ mov %esi, (%esi) # If A20 line is disabled two pointers
+ mov %edi, (%edi) # would point to the address 0x012345
+ cmpsd # Compare values at addresses
+ je . # If equivalent, loop forever
+
call kernel_main
jmp . # infinite loop