diff options
author | Marvin Borner | 2021-04-10 00:26:39 +0200 |
---|---|---|
committer | Marvin Borner | 2021-04-10 00:26:39 +0200 |
commit | 9655593d80e23d2ea3c091e3187e8e47b278bc3d (patch) | |
tree | f618723fd9d457147f4663d2d4990f69fabb2d48 /kernel/features/mm.c | |
parent | eeb88df1d501ccec4737c18dddb7ca0a1176304f (diff) |
Gave procs own kernel stack (TSS)
Diffstat (limited to 'kernel/features/mm.c')
-rw-r--r-- | kernel/features/mm.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/features/mm.c b/kernel/features/mm.c index 466e448..0972ab3 100644 --- a/kernel/features/mm.c +++ b/kernel/features/mm.c @@ -677,8 +677,11 @@ void memory_user_hook(void) } } -CLEAR void memory_install(struct mem_info *mem_info, struct vid_info *vid_info) +CLEAR void memory_install(struct boot_info *boot) { + struct mem_info *mem_info = boot->mem; + struct vid_info *vid_info = boot->vid; + for (struct mmap_boot *p = mem_info->start; (u32)(p - mem_info->start) < mem_info->size; p++) { if (p->hbase || !p->acpi || !p->type) @@ -731,6 +734,9 @@ CLEAR void memory_install(struct mem_info *mem_info, struct vid_info *vid_info) MEMORY_NONE); fb_map_buffer(virtual_kernel_dir(), vid_info); + // Map TSS + memory_map_identity(&kernel_dir, memory_range_around(boot->tss, 0x1000), MEMORY_NONE); + // Unmap NULL byte/page struct memory_range zero = memory_range(0, PAGE_SIZE); virtual_free(&kernel_dir, zero); |