sched: add root vm-region and handle table to struct task
This commit is contained in:
10
sched/task.c
10
sched/task.c
@@ -1,10 +1,12 @@
|
||||
#include <mango/clock.h>
|
||||
#include <mango/cpu.h>
|
||||
#include <mango/handle.h>
|
||||
#include <mango/libc/stdio.h>
|
||||
#include <mango/locks.h>
|
||||
#include <mango/object.h>
|
||||
#include <mango/printk.h>
|
||||
#include <mango/sched.h>
|
||||
#include <mango/vm-region.h>
|
||||
|
||||
#define TASK_CAST(p) OBJECT_C_CAST(struct task, t_base, &task_type, p)
|
||||
|
||||
@@ -84,6 +86,14 @@ kern_status_t setup_kernel_task(void)
|
||||
__kernel_task->t_state = TASK_RUNNING;
|
||||
__kernel_task->t_pmap = get_kernel_pmap();
|
||||
|
||||
vm_region_create(
|
||||
NULL,
|
||||
"root",
|
||||
VM_KERNEL_BASE,
|
||||
VM_KERNEL_LIMIT - VM_KERNEL_BASE,
|
||||
VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXEC | VM_PROT_SVR,
|
||||
&__kernel_task->t_address_space);
|
||||
|
||||
snprintf(
|
||||
__kernel_task->t_name,
|
||||
sizeof __kernel_task->t_name,
|
||||
|
||||
Reference in New Issue
Block a user