Switch page_manager to use frame_allocator.
Removed the frame allocation logic from page_manager and replaced it
with using an instance of frame_allocator instead. This had several
major ripple effects:
- memory_initalize() had to change to support this new world
- Where to map used blocks is now passed as a flag, since blocks don't
track their virtual address anymore
- Instead of the complicated "find N contiguous pages that can be
mapped in with one page table", we now just have the bootloader give
us some (currently 64) pages to use both for tables and scratch
space.
- frame_allocator initialization was split into two steps to allow
mapping used blocks before std::move()ing them over
This commit is contained in:
@@ -53,14 +53,18 @@ frame_block::copy(frame_block *other)
|
||||
|
||||
|
||||
frame_allocator::frame_allocator(
|
||||
frame_block_list free,
|
||||
frame_block_list used,
|
||||
frame_block_list cache)
|
||||
{
|
||||
m_block_slab.append(cache);
|
||||
}
|
||||
|
||||
void
|
||||
frame_allocator::init(
|
||||
frame_block_list free,
|
||||
frame_block_list used)
|
||||
{
|
||||
m_free.append(free);
|
||||
m_used.append(used);
|
||||
m_block_slab.append(cache);
|
||||
|
||||
consolidate_blocks();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user