Closed
Description
Currently, LegacyFrameAllocator::allocate_frame_from_descriptor
only ever increases self.next_frame
. This is problematic, as the memory map descriptors aren't guaranteed to be in ascending start address order (at least for UEFI). If the first descriptor provided by the memory map were also the one with the largest start address, the frame allocator would not allocate from the other descriptors.
Rather than checking whether self.next_frame < self.start_frame
in allocate_frame_from_descriptor
, we should set self.next_frame
to the start address of the descriptor when we find the next suitable descriptor in allocate_frame
.