summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2021-08-30 12:54:55 +0000
committerJoursoir <chat@joursoir.net>2021-08-30 12:54:55 +0000
commit657cbdedb6edeec1340fa36b501c3b2e9fc6df0a (patch)
tree1399b0f7c9816170942e10811e9594ac77fc0e54
parentd835cae0968ea5d6e9989dac637449b8d403ac5e (diff)
downloadmfsos-657cbdedb6edeec1340fa36b501c3b2e9fc6df0a.tar.gz
mfsos-657cbdedb6edeec1340fa36b501c3b2e9fc6df0a.tar.bz2
mfsos-657cbdedb6edeec1340fa36b501c3b2e9fc6df0a.zip
x86/boot: add asm routine for entering the kernel
-rw-r--r--arch/x86/boot/kernel_entry.s12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/x86/boot/kernel_entry.s b/arch/x86/boot/kernel_entry.s
new file mode 100644
index 0000000..e0fd132
--- /dev/null
+++ b/arch/x86/boot/kernel_entry.s
@@ -0,0 +1,12 @@
+# bootsect.s loads the kernel and transfers control to SYSSEG address.
+# We cannot be sure that the main() function will be exactly at this
+# address.
+
+# Therefore, we will use a small trick for entering the kernel correctly:
+# Locate this small assembly routine at the beginning of the SYSSEG
+# address => we can be sure that control will transfer to main()
+
+.code32
+.extern kernel_main
+ call kernel_main
+ jmp .