mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[kernel] Use kernel proc space as kernel space
As mentioned in the last commit, with processes owning spaces, there was a weird extra space in the "kernel" process that owns the kernel threads. Now we use that space as the global kernel space, and don't create a separate one.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "frame_allocator.h"
|
||||
#include "io.h"
|
||||
#include "log.h"
|
||||
#include "objects/process.h"
|
||||
#include "objects/vm_area.h"
|
||||
#include "page_manager.h"
|
||||
#include "vm_space.h"
|
||||
@@ -38,9 +39,6 @@ page_manager &g_page_manager = __g_page_manager_storage.value;
|
||||
static kutil::no_construct<frame_allocator> __g_frame_allocator_storage;
|
||||
frame_allocator &g_frame_allocator = __g_frame_allocator_storage.value;
|
||||
|
||||
static kutil::no_construct<vm_space> __g_kernel_space_storage;
|
||||
vm_space &g_kernel_space = __g_kernel_space_storage.value;
|
||||
|
||||
void * operator new(size_t size) { return g_kernel_heap.allocate(size); }
|
||||
void * operator new [] (size_t size) { return g_kernel_heap.allocate(size); }
|
||||
void operator delete (void *p) noexcept { return g_kernel_heap.free(p); }
|
||||
@@ -111,7 +109,8 @@ memory_initialize_pre_ctors(args::header *kargs)
|
||||
// Create the page manager
|
||||
new (&g_page_manager) page_manager {g_frame_allocator, kpml4};
|
||||
|
||||
vm_space &vm = *new (&g_kernel_space) vm_space {kpml4};
|
||||
process *kp = process::create_kernel_process(kpml4);
|
||||
vm_space &vm = kp->space();
|
||||
vm.allow(memory::heap_start, memory::kernel_max_heap, true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user