blob: 2bb18be44b330b2b377d912c36a53fec16e923b9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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);
}
|