If the pointer the the beginning of the slab was the beginning of the
aligned region, instead of jumping to the next, as was done previously,
we use the already aligned pointer instead.
This type should never be modified by the user, and only passed into the
functions in slab.c. Using a typedef to notifies the user semantically
of this fact
This also switches the kmalloc allocator over to the new rbtree
structure. As a balanced binary search tree, it is much more efficient
than the previous method
this massively speeds up boot on larger memory systems, as before this
was only tested on a 2GB system. Only identity mapping the first 4GB of
still allows MMIO to work, but without the massive space and time taken
by the previous method
allocating individual pages en-masse for kmap with the buddy allocator
is way too slow, especially with the new method of buddy allocation that
is noticeably slower to start, but scales more efficiently.
the slab allocator is extremely fast and is perfect for this purpose
before this patch, the buddy allocator used a hybrid bitmap-freelist
approach where free would use the bitmap to determine size, but all
other operations we O(n) traversals of the free-list.
now, both alloc and free use the bitmap exclusively for allocation.
this is now on its own branch and will be worked on separately from the
main focus of this project, which is to get a VFS and into userspace as
soon as possible
the `next_level` function was calling `alloc_page_early` directly
instead of using the pointer `alloc_page`, causing the mapping to work
inconsistently.
8259 PIC was used for interrupts for bootstrap development while the memory manager was being constructed. now that this is complete, a transition to the apic will begin
this patch fixes memory mapping issues with the reserved regions that caused page faults before.
before this would overwrite into the next region, which would cause an
error at `buddy_alloc_helper` as the region overridden was the `len`
field of a `struct buddy_free_list`
the buddy allocator now returns HHDM addresses as void* rather than
zero-based adddresses as paddr_t. it also automatically searches regions
now, rather than requiring a (struct mem_region_header *) for each
alloc/free