summaryrefslogtreecommitdiff
path: root/Source/Kernel/MemoryManager
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-10-16 17:35:50 +0200
committerAlexis211 <alexis211@gmail.com>2009-10-16 17:35:50 +0200
commit4d5348a49f54d95c0271c8f9c4ef01c005d6b74b (patch)
treebf993a94f618982a511f6eb5f71b21abe6521c0d /Source/Kernel/MemoryManager
parent6e87493b8cd156388b075ecace376126a8875283 (diff)
downloadMelon-4d5348a49f54d95c0271c8f9c4ef01c005d6b74b.tar.gz
Melon-4d5348a49f54d95c0271c8f9c4ef01c005d6b74b.zip
We now use a temporary stack in task management for :
- deleting current thread whe it finishes - doing everything that goes with that
Diffstat (limited to 'Source/Kernel/MemoryManager')
-rw-r--r--Source/Kernel/MemoryManager/PageDirectory.class.cpp2
-rw-r--r--Source/Kernel/MemoryManager/PhysMem.ns.cpp5
2 files changed, 4 insertions, 3 deletions
diff --git a/Source/Kernel/MemoryManager/PageDirectory.class.cpp b/Source/Kernel/MemoryManager/PageDirectory.class.cpp
index 2c8507f..13fbc36 100644
--- a/Source/Kernel/MemoryManager/PageDirectory.class.cpp
+++ b/Source/Kernel/MemoryManager/PageDirectory.class.cpp
@@ -43,7 +43,6 @@ PageDirectory::PageDirectory(PageDirectory* other) {
}
PageDirectory::~PageDirectory() {
- PageAlloc::free((void*)tablesPhysical);
for (int i = 0; i < 768; i++) { //Only free addresses below 0xC0000000, upper is kernel space
if (tables[i] != 0) {
for (int j = 0; j < 1024; j++) {
@@ -52,6 +51,7 @@ PageDirectory::~PageDirectory() {
PageAlloc::free((void*)tables[i]);
}
}
+ PageAlloc::free((void*)tablesPhysical);
}
page_t *PageDirectory::getPage(u32int address, bool make) {
diff --git a/Source/Kernel/MemoryManager/PhysMem.ns.cpp b/Source/Kernel/MemoryManager/PhysMem.ns.cpp
index 1794106..382e8a4 100644
--- a/Source/Kernel/MemoryManager/PhysMem.ns.cpp
+++ b/Source/Kernel/MemoryManager/PhysMem.ns.cpp
@@ -61,8 +61,9 @@ void freeFrame(page_t *page) {
if (page->frame == 0) {
return;
} else {
- if (page->frame >= 0x100) //First 1M are reserved (system)
- frames->clearBit(page->frame / 0x1000);
+ if (page->frame >= 0x100) { //First 1M are reserved (system)
+ frames->clearBit(page->frame);
+ }
page->frame = 0;
}
}