]> git.corax.cc Git - corax/commitdiff
Create new processes with privilege level 3 by default
authorMatthias Kruk <m@m10k.eu>
Wed, 25 Sep 2019 10:05:05 +0000 (19:05 +0900)
committerMatthias Kruk <m@m10k.eu>
Wed, 25 Sep 2019 10:05:05 +0000 (19:05 +0900)
kernel/arch/process.c

index 264894b25ff80c036e5319fd901a2d255489da32..270850d1ace0960c474b34ed420a2ed9c84a7383 100644 (file)
@@ -13,11 +13,7 @@ struct process {
 
 void foo(void)
 {
-       dbg_printf("Running...\n");
-
-       for(;;) {
-               asm volatile("hlt");
-       }
+       for(;;);
 
        return;
 }
@@ -54,7 +50,7 @@ int process_create(process_t **dst)
                        goto cleanup;
                }
 
-               task_prepare(proc->p_tasks, (u32_t)pdbr, (u32_t)foo, (u32_t)kstack, (u32_t)ustack + PAGE_SIZE, 0);
+               task_prepare(proc->p_tasks, (u32_t)pdbr, (u32_t)foo, (u32_t)kstack, (u32_t)ustack + PAGE_SIZE, 3);
 
                proc->p_tasks->t_sp = (u32_t)(CONFIG_KERNEL_STACK_BASE + ((u32_t)proc->p_tasks->t_sp - (u32_t)kstack));
                dbg_printf("ESP0 = 0x%08x\n", proc->p_tasks->t_sp);
@@ -87,28 +83,8 @@ cleanup:
 
 int process_switch(process_t *proc)
 {
-//     struct stack_frame *sfrm;
        int ret_val;
-/*
-       sfrm = (void*)proc->p_tasks->t_sp;
-
-       dbg_printf("SS  = %08x\n"
-                          "ESP = %08x\n"
-                          "EFL = %08x\n"
-                          "CS  = %08x\n"
-                          "EIP = %08x\n"
-                          "DS  = %08x\n",
-                          sfrm->ss,
-                          sfrm->prevesp,
-                          sfrm->eflags,
-                          sfrm->cs,
-                          sfrm->eip,
-                          sfrm->ds);
-
-       for(;;) {
-               asm volatile("hlt");
-       }
-*/
+
        ret_val = task_switch(proc->p_tasks);
 
        return(ret_val);