X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/14b86eca7f36eedde35cb47b41afc36f9097ea7c..e66387b252f36c894d79769cbfb178bc950600d4:/lunaix-os/kernel/proc0.c diff --git a/lunaix-os/kernel/proc0.c b/lunaix-os/kernel/proc0.c index a2102ae..074bcd9 100644 --- a/lunaix-os/kernel/proc0.c +++ b/lunaix-os/kernel/proc0.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -35,11 +36,27 @@ void __proc0() { init_platform(); + asm volatile("movw %0, %ax\n" + "movw %ax, %es\n" + "movw %ax, %ds\n" + "movw %ax, %fs\n" + "movw %ax, %gs\n" + "pushl %0\n" + "pushl %1\n" + "pushl %2\n" + "pushl %3\n" + "retf" ::"i"(UDATA_SEG), + "i"(USTACK_TOP & ~0xf), + "i"(UCODE_SEG), + "r"(&&usr)); +usr: if (!fork()) { asm("jmp _lxinit_main"); } - asm("1: jmp 1b"); + while (1) { + yield(); + } } extern uint8_t __kernel_start; /* link/linker.ld */