diff options
author | Marvin Borner | 2021-03-12 16:07:45 +0100 |
---|---|---|
committer | Marvin Borner | 2021-03-12 16:07:45 +0100 |
commit | f1751c121d48f2d8936c72bdc347777d1e7402d9 (patch) | |
tree | 399c08a59756d8980aad6c451e2b0e4c97b3911f /kernel/features/proc.c | |
parent | 99b674a9e8d78b12188cc0280b990ec50de109d8 (diff) |
Let's gooo!
Diffstat (limited to 'kernel/features/proc.c')
-rw-r--r-- | kernel/features/proc.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/kernel/features/proc.c b/kernel/features/proc.c index 19a92d3..4d1311e 100644 --- a/kernel/features/proc.c +++ b/kernel/features/proc.c @@ -57,7 +57,7 @@ void scheduler(struct regs *regs) } } - memory_dir_switch(((struct proc *)current->data)->page_dir); + memory_switch_dir(((struct proc *)current->data)->page_dir); memcpy(regs, &((struct proc *)current->data)->regs, sizeof(struct regs)); if (regs->cs != GDT_USER_CODE_OFFSET) { @@ -248,9 +248,9 @@ struct proc *proc_make(enum proc_priv priv) proc->state = PROC_RUNNING; if (priv == PROC_PRIV_KERNEL) - proc->page_dir = memory_kernel_dir(); + proc->page_dir = virtual_kernel_dir(); else - proc->page_dir = memory_dir_create(); + proc->page_dir = virtual_create_dir(); if (current) list_add(proc_list, proc); @@ -472,11 +472,11 @@ void proc_init(void) vfs_mount(dev, "/proc/"); // Idle proc - struct proc *kernel_proc = proc_make(PROC_PRIV_NONE); - proc_load(kernel_proc, (u32)kernel_idle); - strcpy(kernel_proc->name, "idle"); - kernel_proc->state = PROC_SLEEPING; - idle_proc = list_add(proc_list, kernel_proc); + /* struct proc *kernel_proc = proc_make(PROC_PRIV_NONE); */ + /* proc_load(kernel_proc, (u32)kernel_idle); */ + /* strcpy(kernel_proc->name, "idle"); */ + /* kernel_proc->state = PROC_SLEEPING; */ + /* idle_proc = list_add(proc_list, kernel_proc); */ // Init proc (root) struct node *new = list_add(proc_list, proc_make(PROC_PRIV_ROOT)); @@ -496,7 +496,9 @@ void proc_init(void) /* ((u32 *)_esp)[-1] = (u32)argv; // Second argument (argv) */ printf("Jumping to userspace!\n"); - memory_dir_switch(((struct proc *)new->data)->page_dir); + /* printf("%x\n", ((u32 *)((struct proc *)new->data)->entry)[5]); */ + memory_switch_dir(((struct proc *)new->data)->page_dir); + /* printf("%x\n", ((u32 *)((struct proc *)new->data)->entry)[5]); */ proc_jump_userspace(); while (1) { }; |