feat(pfa): Add PageFrameAllocator class

This commit is contained in:
Daniel Hammer
2025-03-12 14:34:48 +01:00
parent 6efcd1d883
commit bf2cf6a59e
5 changed files with 94 additions and 18753 deletions
+28
View File
@@ -0,0 +1,28 @@
/*
* PageFrameAllocator.hpp
* Memory allocator for physical pages
* Copyright (c) 2025 Daniel Hammer
*/
#pragma once
#include "Memmap.hpp"
namespace Memory {
class PageFrameAllocator {
struct Page {
std::size_t size;
Page* next;
};
Page head{};
LargestSection g_section;
public:
PageFrameAllocator(LargestSection section);
void* Allocate();
void Free(void* ptr);
};
extern PageFrameAllocator* g_pfa;
};