aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/kernel.c
diff options
context:
space:
mode:
authorMarvin Borner2019-11-20 22:17:48 +0100
committerMarvin Borner2019-11-20 22:28:30 +0100
commit0ba991750314310a5e53b0d8135aef5b1352b261 (patch)
treeacae7106a24b85116cd7119bd239c3d9299f2ba8 /src/kernel/kernel.c
parent6ca5f1bcec7f0716bad5e1cdd38d41be137fe7e5 (diff)
Began two-stage hdd bootloader and os installer
Diffstat (limited to 'src/kernel/kernel.c')
-rw-r--r--src/kernel/kernel.c9
1 files changed, 8 insertions, 1 deletions
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 <kernel/paging/paging.h>
#include <kernel/input/input.h>
#include <kernel/acpi/acpi.h>
-#include <kernel/fs/initrd.h>
#include <kernel/syscall/syscall.h>
#include <kernel/smbios/smbios.h>
+#include <kernel/fs/install.h>
+#include <kernel/lib/lib.h>
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);