diff options
author | Benji Dial <benji@benjidial.net> | 2024-01-10 00:17:29 -0500 |
---|---|---|
committer | Benji Dial <benji@benjidial.net> | 2024-01-10 00:17:29 -0500 |
commit | 15e62510104bc0e2b9180b66e5845d985cac03cc (patch) | |
tree | fa950c29622823a825a523e63de610746a70cbe1 /kernel/paging.cpp | |
parent | c2f48fb5df0981df1df23de2b277274f9fe75080 (diff) | |
download | hilbert-os-15e62510104bc0e2b9180b66e5845d985cac03cc.tar.gz |
partial (largely untested) memory block device and tar file system support
Diffstat (limited to 'kernel/paging.cpp')
-rw-r--r-- | kernel/paging.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/paging.cpp b/kernel/paging.cpp index 3bd27d0..8c27abc 100644 --- a/kernel/paging.cpp +++ b/kernel/paging.cpp @@ -96,6 +96,13 @@ namespace mercury::kernel::paging { return 0; } + void *map_new_kernel_pages(uint64_t count) { + uint64_t vaddr = find_unmapped_vram_region(count); + for (uint64_t i = 0; i < count; ++i) + map_kernel_page(take_pram_page(), vaddr + i * 4096, true, false); + return (void *)vaddr; + } + uint64_t get_used_vram_page_count() { uint64_t count = 0; for (uint64_t i = 0; i < kernel_vram_pages; ++i) |