summaryrefslogtreecommitdiff
path: root/Source/Kernel/TaskManager
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Kernel/TaskManager')
-rw-r--r--Source/Kernel/TaskManager/V86/V86.ns.cpp7
-rw-r--r--Source/Kernel/TaskManager/V86/V86.ns.h1
-rw-r--r--Source/Kernel/TaskManager/V86/V86Thread.class.cpp4
3 files changed, 9 insertions, 3 deletions
diff --git a/Source/Kernel/TaskManager/V86/V86.ns.cpp b/Source/Kernel/TaskManager/V86/V86.ns.cpp
index bd16e06..93d51f2 100644
--- a/Source/Kernel/TaskManager/V86/V86.ns.cpp
+++ b/Source/Kernel/TaskManager/V86/V86.ns.cpp
@@ -12,6 +12,13 @@ void run(v86_function_t& entry, registers_t &regs, u32int data) {
while (!ret.finished) Task::currThread()->sleep(10);
}
+void map(Process* p) {
+ if (p == 0) p = Task::currProcess();
+ for (u32int i = 0x00000; i < 0xFFFFF; i += 0x1000) {
+ p->getPagedir()->allocFrame(i, true, true);
+ }
+}
+
u16int allocSeg(u16int length, Process* p) {
if (p == 0) p = Task::currProcess();
if (length & 0xF) length = (length & 0xFFFF0) + 0x10;
diff --git a/Source/Kernel/TaskManager/V86/V86.ns.h b/Source/Kernel/TaskManager/V86/V86.ns.h
index cdeef25..9fa132b 100644
--- a/Source/Kernel/TaskManager/V86/V86.ns.h
+++ b/Source/Kernel/TaskManager/V86/V86.ns.h
@@ -25,6 +25,7 @@ inline FARPTR LINEAR_TO_FP(void* ptr) {
namespace V86 {
void run(v86_function_t& entry, registers_t &regs, u32int data);
+ void map(Process* p = 0); //Maps lower 1MB of virtual memory to physical memory (lower 1MB as well)
u16int allocSeg(u16int size, Process* p = 0);
void* alloc(u16int size, Process* p = 0);
}
diff --git a/Source/Kernel/TaskManager/V86/V86Thread.class.cpp b/Source/Kernel/TaskManager/V86/V86Thread.class.cpp
index 4b07e98..26fca63 100644
--- a/Source/Kernel/TaskManager/V86/V86Thread.class.cpp
+++ b/Source/Kernel/TaskManager/V86/V86Thread.class.cpp
@@ -61,9 +61,7 @@ V86Thread::V86Thread(v86_function_t* entry, v86_retval_t* ret, u32int data) : Th
m_process->getPagedir()->switchTo();
//Map all lower memory
- for (u32int i = 0x00000; i < 0xFFFFF; i += 0x1000) {
- m_process->getPagedir()->allocFrame(i, true, true);
- }
+ V86::map();
u16int cs = V86::allocSeg(entry->size); //Alocate segments for the code to run in
u8int* codeptr = (u8int*)(FP_TO_LINEAR(cs, 0));