aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/kernel.c
diff options
context:
space:
mode:
authorMarvin Borner2020-04-17 00:39:10 +0200
committerMarvin Borner2020-04-17 00:39:10 +0200
commit203c6950ab45e89ababa594d5b359118e17bfd02 (patch)
treeb9caeb2f1c7ada9b728191cf3680873472f5cef6 /src/kernel/kernel.c
parent9ff8deafdff307cbec1ef431c65009ffb8119859 (diff)
Started implementing multiboot2 standard
Diffstat (limited to 'src/kernel/kernel.c')
-rw-r--r--src/kernel/kernel.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c
index 3339381..6a9bc09 100644
--- a/src/kernel/kernel.c
+++ b/src/kernel/kernel.c
@@ -19,12 +19,18 @@
#include <kernel/fs/ext2.h>
#include <kernel/fs/vfs.h>
-void kernel_main(uint32_t magic, multiboot_info_t *grub_header)
+void kernel_main(uint32_t magic, uint32_t multiboot_address)
{
if (magic != MULTIBOOT_BOOTLOADER_MAGIC) {
vga_log("Invalid boot magic!");
halt_loop();
}
+
+ if (multiboot_address & 7) {
+ vga_log("Unaligned mbi!");
+ halt_loop();
+ }
+
vga_log("Installing basic features of Melvix...");
// Install features
@@ -34,10 +40,16 @@ void kernel_main(uint32_t magic, multiboot_info_t *grub_header)
idt_install();
isrs_install();
irq_install();
- memory_init(grub_header);
+
+ multiboot_parse();
paging_install();
+
memory_print();
+ vfs_init();
+ ata_init();
+ ext2_init("/dev/hda", "/");
+
load_binaries();
set_optimal_resolution();
@@ -50,18 +62,11 @@ void kernel_main(uint32_t magic, multiboot_info_t *grub_header)
network_install();
sti();
- vfs_init();
- ata_init();
- ext2_init("/dev/hda", "/");
// tasking_install();
// Get hardware information
// get_smbios();
- // Print total memory
- info("Total memory found: %dMiB", (memory_get_all() >> 10) + 1);
- log("Total memory found: %dMiB", (memory_get_all() >> 10) + 1);
-
#ifdef INSTALL_MELVIX
panic("Installation isn't supported right now!");
#endif