diff options
author | Raghuram Subramani <raghus2247@gmail.com> | 2025-02-01 09:17:19 -0500 |
---|---|---|
committer | Raghuram Subramani <raghus2247@gmail.com> | 2025-02-01 09:17:19 -0500 |
commit | 4111fee72bcde6db229fc45b0076db8bc7407937 (patch) | |
tree | 18778d7ce8ce1b1d8f68087b8c41dc3e643d41b5 /kernel/mm/virtual_mm/virtual_mm.cc | |
parent | f8942052f2a71c2603fbc4b91303137d07151e72 (diff) |
libk: Working (afaik) kmalloc implementation
Diffstat (limited to 'kernel/mm/virtual_mm/virtual_mm.cc')
-rw-r--r-- | kernel/mm/virtual_mm/virtual_mm.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/kernel/mm/virtual_mm/virtual_mm.cc b/kernel/mm/virtual_mm/virtual_mm.cc index 401113b..ee2e78a 100644 --- a/kernel/mm/virtual_mm/virtual_mm.cc +++ b/kernel/mm/virtual_mm/virtual_mm.cc @@ -102,14 +102,15 @@ uint32_t * make_table(uint32_t *pd_entry) { uint32_t *table = 0; - if (!kmalloc_initialized()) + if (!kmalloc_initialized()) { /* If we don't have a dynamic memory allocator yet (this will happen only * once, when we initialize the dynamic allocator), then we hard code the * next page table to be at 7MiB */ table = (uint32_t *) (7 * MiB); - else - // table = (uint32_t *) kmalloc(sizeof(uint32_t) * 1024); - ASSERT_NOT_REACHED(); + printk("virtual_mm", + "Using our hard coded table; this should happen only once."); + } else + table = (uint32_t *) kmalloc(sizeof(uint32_t) * 1024); for (uint32_t i = 0; i < 1024; i++) table[i] = 0x0; |