summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2022-10-10 18:50:00 +0300
committerJoursoir <chat@joursoir.net>2022-10-13 19:02:08 +0300
commit5fdd893728a6506cd7980b85b9862523e841877d (patch)
treeb5b4bc6609acc8667de5ed30497523fc86155bba
parentbec2cd1c1322ed6ec3e988de9a9580562d481423 (diff)
downloadmfsos-5fdd893728a6506cd7980b85b9862523e841877d.tar.gz
mfsos-5fdd893728a6506cd7980b85b9862523e841877d.tar.bz2
mfsos-5fdd893728a6506cd7980b85b9862523e841877d.zip
pass multiboot information to the kernelHEADmaster
-rw-r--r--arch/x86/boot/multiboot/head.s5
-rw-r--r--kernel/main.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/arch/x86/boot/multiboot/head.s b/arch/x86/boot/multiboot/head.s
index 31051ff..99f8f98 100644
--- a/arch/x86/boot/multiboot/head.s
+++ b/arch/x86/boot/multiboot/head.s
@@ -81,6 +81,11 @@ _start:
runtime support to work as well.
*/
+ /* Push the pointer to the Multiboot information structure. */
+ push %ebx
+ /* Push the magic value. */
+ push %eax
+
/*
Enter the high-level kernel. The ABI requires the stack is 16-byte
aligned at the time of the call instruction (which afterwards pushes
diff --git a/kernel/main.c b/kernel/main.c
index 5b146bb..82cb175 100644
--- a/kernel/main.c
+++ b/kernel/main.c
@@ -1,3 +1,4 @@
+#include "multiboot.h"
#include "video/console/vgacon.h"
#include "gdt.h"
@@ -9,7 +10,8 @@
#if !defined(__i386__)
#error "This kernel needs to be compiled with a ix86-elf compiler"
#endif
-void kernel_main(void)
+
+void kernel_main(uint32_t magic, multiboot_info_t *multiboot)
{
init_segmentation();