summaryrefslogtreecommitdiff
path: root/kernel/main.c
blob: bc1e0d39bf4e8d541c1c3ec4298a1412f989250b (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
#include <kernel/gdt.h>
#include <kernel/idt.h>
#include <kernel/mem.h>
#include <kernel/proc.h>
#include <kernel/tty.h>
#include <platform/sysenter.h>

void r3_test();

void kmain()
{
	tty_clear();
	gdt_init();
	idt_init();
	sysenter_setup();
	mem_init();

	tty_const("creating process...");
	struct process *proc = process_new(r3_test);
	tty_const("switching...");
	process_switch(proc);
}

void r3_test() {
	tty_const("ok");
	asm("cli"); // privileged instruction, should cause a GP
	tty_const(" this shouldn't happen");
	for (;;) {}
}