[kernel] Add VMA interface

Finished the VMA kobject and added the related syscalls. Processes can
now allocate memory! Other changes in this commit:

- stop using g_frame_allocator and add frame_allocator::get()
- make sure to release all handles in the process dtor
- fix kutil::map::iterator never comparing to end()
This commit is contained in:
2020-09-23 00:29:05 -07:00
parent d4283731e4
commit 0e0975e5f6
13 changed files with 245 additions and 173 deletions

View File

@@ -61,7 +61,17 @@ main(int argc, const char **argv)
_syscall_system_log("main thread starting");
j6_status_t result = _syscall_endpoint_create(&endp);
uintptr_t base = 0xcc0000000;
j6_handle_t vma = j6_handle_invalid;
j6_status_t result = _syscall_vma_create_map(&vma, 0x100000, base);
if (result != j6_status_ok)
return result;
uint64_t *vma_ptr = reinterpret_cast<uint64_t*>(base);
for (int i = 0; i < 4096; ++i)
vma_ptr[i] = uint64_t(i);
result = _syscall_endpoint_create(&endp);
if (result != j6_status_ok)
return result;