diff options
Diffstat (limited to 'kernel/main.c')
-rw-r--r-- | kernel/main.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/kernel/main.c b/kernel/main.c index d2f0693..e63ca14 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -1,8 +1,24 @@ #include <kernel/gdt.h> #include <kernel/tty.h> +#include <platform/sysenter.h> + +extern void stack_top; + +void r3_test(); void kmain() { tty_clear(); gdt_init(); + sysenter_setup(); + + tty_write("user...", 7); + sysexit(r3_test, &stack_top); +} + +void r3_test() { + tty_write("in ring3", 8); + asm("cli"); // privileged instruction, should cause a GP + tty_write(" oh no", 6); // shouldn't happen + for (;;) {} } |