summaryrefslogtreecommitdiff
path: root/Source/Kernel/MemoryManager/V86Segment.class.cpp
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-12-22 16:48:52 +0100
committerAlexis211 <alexis211@gmail.com>2009-12-22 16:48:52 +0100
commitbfec696da052c8c9320773ca69927422efebe8c7 (patch)
tree325efd88744344cd732d6e3d09bfebf3cb5847a4 /Source/Kernel/MemoryManager/V86Segment.class.cpp
parent2c23da1cf398aef420130dde1b86e4c474e3cacb (diff)
downloadMelon-bfec696da052c8c9320773ca69927422efebe8c7.tar.gz
Melon-bfec696da052c8c9320773ca69927422efebe8c7.zip
[noncompiling commit] Started working on a segmented memory model
Diffstat (limited to 'Source/Kernel/MemoryManager/V86Segment.class.cpp')
-rw-r--r--Source/Kernel/MemoryManager/V86Segment.class.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/Kernel/MemoryManager/V86Segment.class.cpp b/Source/Kernel/MemoryManager/V86Segment.class.cpp
new file mode 100644
index 0000000..e82a94c
--- /dev/null
+++ b/Source/Kernel/MemoryManager/V86Segment.class.cpp
@@ -0,0 +1,16 @@
+#include "V86Segment.class.h"
+#include <MemoryManager/PageDirectory.class.h>
+
+seg_map_t V86Segment::map(PageDirectory *pd) {
+ for (u32int i = 0; i < 0x100000; i += 0x1000) {
+ PageDirectory::map(pd->getPage(i, true), i / 0x1000, true, true);
+ }
+ seg_map_t map = {this, 0, 0x100000};
+ return map;
+}
+
+void V86Segment::unmap(PageDirectory* pd, seg_map_t *mapping) {
+ for (u32int i = 0; i < 0x100000; i += 0x1000) {
+ PageDirectory::unmap(pd->getPage(i, false));
+ }
+}