Adds stub class for physical memory managment.
This commit is contained in:
parent
e45cd0e40e
commit
782fddf606
3 changed files with 48 additions and 1 deletions
|
@ -39,3 +39,6 @@ run:
|
|||
qemu-system-i386 -kernel kernel-base.ker
|
||||
|
||||
bnr: kernel-base.ker run
|
||||
|
||||
deploy: kernel-base.ker
|
||||
cp kernel-base.ker /srv/tftp/kernel-base.ker
|
28
prototypes/base/include/pmm.hpp
Normal file
28
prototypes/base/include/pmm.hpp
Normal file
|
@ -0,0 +1,28 @@
|
|||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
/**
|
||||
* Physical memory management tool.
|
||||
*/
|
||||
class PMM
|
||||
{
|
||||
private:
|
||||
PMM() = delete;
|
||||
public:
|
||||
/**
|
||||
* Marks a page as occupied by external memory management.
|
||||
* @returns true if the page was previously free, false if it was already allocated.
|
||||
*/
|
||||
static bool markOccupied(void *page);
|
||||
|
||||
/**
|
||||
* Allocates a single page.
|
||||
*/
|
||||
static void* alloc();
|
||||
|
||||
/**
|
||||
* Frees a given page by pointer.
|
||||
*/
|
||||
static void free(void *page);
|
||||
};
|
16
prototypes/base/src/pmm.cpp
Normal file
16
prototypes/base/src/pmm.cpp
Normal file
|
@ -0,0 +1,16 @@
|
|||
#include "pmm.hpp"
|
||||
|
||||
bool PMM::markOccupied(void *page)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void *PMM::alloc()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void PMM::free(void *page)
|
||||
{
|
||||
|
||||
}
|
Loading…
Reference in a new issue