From 0ba991750314310a5e53b0d8135aef5b1352b261 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 20 Nov 2019 22:17:48 +0100 Subject: Began two-stage hdd bootloader and os installer --- src/kernel/kernel.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/kernel/kernel.c') diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c index 3bef5c6..eb75d32 100644 --- a/src/kernel/kernel.c +++ b/src/kernel/kernel.c @@ -6,15 +6,17 @@ #include #include #include -#include #include #include +#include +#include extern void switch_to_user(); void kernel_main() { vga_log("Installing basic features of Melvix...", 0); // Install features + // memory_init(); timer_install(); gdt_install(); init_serial(); @@ -37,6 +39,11 @@ void kernel_main() { // Booting process complete - emulate newline key vesa_keyboard_char('\n'); + uint8_t boot_drive_id = (uint8_t) (*((uint8_t *) 0x9000)); + if (boot_drive_id == 0xE0) { + install_melvix(); + } + // Setup initial ramdisk /*assert(mboot_ptr->mods_count > 0); uint32_t initrd_location = *((uint32_t *) mboot_ptr->mods_addr); -- cgit v1.2.3