Adds stub class for physical memory managment.

This commit is contained in:
Felix Queißner 2016-05-03 00:43:14 +02:00
parent e45cd0e40e
commit 782fddf606
3 changed files with 48 additions and 1 deletions

View file

@ -38,4 +38,7 @@ kernel-base.ker: $(OBJS)
run:
qemu-system-i386 -kernel kernel-base.ker
bnr: kernel-base.ker run
bnr: kernel-base.ker run
deploy: kernel-base.ker
cp kernel-base.ker /srv/tftp/kernel-base.ker

View 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);
};

View 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)
{
}