aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/dev/v86.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/dev/v86.c')
-rw-r--r--src/kernel/dev/v86.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/kernel/dev/v86.c b/src/kernel/dev/v86.c
index 183b791..db84a4f 100644
--- a/src/kernel/dev/v86.c
+++ b/src/kernel/dev/v86.c
@@ -48,6 +48,9 @@ bool v86_begin_session() {
pd_map_page(addr, (uint32_t)addr / PAGE_SIZE, true);
}
pd_map_page(0, 0, true);
+ } else {
+ v86_prev_pagedir = get_current_pagedir();
+ switch_pagedir(v86_pagedir);
}
if (v86_thread == 0) {
@@ -70,6 +73,7 @@ bool v86_begin_session() {
void v86_end_session() {
switch_pagedir(v86_prev_pagedir);
+
v86_prev_pagedir = 0;
v86_caller_thread = 0;