sched: add root vm-region and handle table to struct task

This commit is contained in:
2026-02-08 13:10:54 +00:00
parent 27bed1a3d3
commit d2f303680d
3 changed files with 13 additions and 0 deletions

View File

@@ -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,