summaryrefslogtreecommitdiff
path: root/Source/Kernel/MemoryManager/PageDirectory.class.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Kernel/MemoryManager/PageDirectory.class.h')
-rw-r--r--Source/Kernel/MemoryManager/PageDirectory.class.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/Source/Kernel/MemoryManager/PageDirectory.class.h b/Source/Kernel/MemoryManager/PageDirectory.class.h
new file mode 100644
index 0000000..4591324
--- /dev/null
+++ b/Source/Kernel/MemoryManager/PageDirectory.class.h
@@ -0,0 +1,35 @@
+#ifndef DEF_PAGEDIRECTORY_CLASS_H
+#define DEF_PAGEDIRECTORY_CLASS_H
+
+#include <Core/common.wtf.h>
+
+struct page_t {
+ u32int present : 1;
+ u32int rw : 1;
+ u32int user : 1;
+ u32int accessed : 1;
+ u32int dirty : 1;
+ u32int unused : 7;
+ u32int frame : 20;
+};
+
+struct page_table_t {
+ page_t pages[1024];
+};
+
+struct PageDirectory {
+ page_table_t *tables[1024];
+ u32int *tablesPhysical;
+ u32int physicalAddr;
+
+ PageDirectory();
+ ~PageDirectory();
+ page_t *getPage(u32int address, bool make);
+ void allocFrame(u32int address, bool is_user, bool is_writable);
+ void freeFrame(u32int address);
+ void switchTo();
+};
+
+
+
+#endif