refactor(kmem): fix FrameAllocator::allocate/allocate_zeroed (#626)
* refactor(kmem): fix FrameAllocator::allocate/allocate_zeroed
This change fixes the way non-contiguous allocation works. Previously we had it allocate on-demand which works but both makes discontiguous *zeroed* allocations difficult (as
we need to borrow the physmap and arch while at the same time we probably want to map the allocated chunks) but also leads to less-than-ideal behaviour on allocation errors:
instead of failing early we would be failing in the middle of whatever we were doing.
This change forces FrameAllocator implementations to allocate all chunks upfront (or at least reserve them and check for allocation errors upfront) and return a non-fallible
iterator over the allocated chunks.
* refactor(BootstrapAllocator): fix unaligned allocations & clean up implementation
The existing `BootstrapAllocator` implementation was less than ideal: It did not return correctly aligned blocks, its internal implementation with the cross-region offset
was hard to understand and debug and lastly it was potentially wasting physical memory by "jumping"the offset to the next region.
This change completely overhauls the implementation, now featuring a list of `Arenas` that each manage a contiguous physical memory region and hold their own bump pointers.
This is both much easier to understand and produces actually correct allocations (including cleaning up on partial faliures in `allocate`)
authored by