Rewrote page allocator; now allocate one at a time

This commit is contained in:
2021-04-04 19:05:26 -05:00
parent f4395ab6b5
commit 51b6c13b16
4 changed files with 92 additions and 371 deletions

View File

@@ -0,0 +1,34 @@
#ifndef PAGEALLOCATORSTACK_H
#define PAGEALLOCATORSTACK_H
#include "pageallocator.hpp"
#include "memorymap.hpp"
namespace kernelns
{
class PageAllocatorStack : public PageAllocator
{
public:
PageAllocatorStack(physaddr_t *stackBase, physaddr_t *stackTop, size_t frameSize, const MemoryMap& memoryMap);
virtual physaddr_t next();
virtual void free(physaddr_t location);
virtual size_t freeBlocks() const;
virtual size_t getMemorySize() const;
private:
size_t m_totalSize;
physaddr_t *m_stack, *m_base, *m_top;
};
}
#endif