diff options
Diffstat (limited to 'src/kernel/arch/i386/boot.c')
-rw-r--r-- | src/kernel/arch/i386/boot.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/kernel/arch/i386/boot.c b/src/kernel/arch/i386/boot.c new file mode 100644 index 0000000..2bb18be --- /dev/null +++ b/src/kernel/arch/i386/boot.c @@ -0,0 +1,33 @@ +#include <kernel/arch/generic.h> +#include <kernel/arch/i386/gdt.h> +#include <kernel/arch/i386/interrupts/idt.h> +#include <kernel/arch/i386/multiboot.h> +#include <kernel/arch/i386/sysenter.h> +#include <kernel/arch/i386/tty.h> +#include <kernel/main.h> +#include <kernel/panic.h> + +void kmain_early(struct multiboot_info *multiboot) { + struct kmain_info info; + + // setup some basic stuff + tty_clear(); + log_const("gdt..."); + gdt_init(); + log_const("idt..."); + idt_init(); + log_const("sysenter..."); + sysenter_setup(); + + { // find the init module + struct multiboot_mod *module = &multiboot->mods[0]; + if (multiboot->mods_count < 1) { + log_const("can't find init! "); + panic(); + } + info.init.at = module->start; + info.init.size = module->end - module->start; + } + + kmain(info); +} |