aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorMarvin Borner2021-05-18 22:06:59 +0200
committerMarvin Borner2021-05-18 22:07:19 +0200
commit45bfdffcb2e00fda595b3f9318469f6b0d29cbe4 (patch)
treef78d66a7687aeb5c4fe4806adf60f70bab95dd9b /kernel
parentc905cd632cc7c5fa8e61eae7c00ed8e14743ced9 (diff)
Fixed issues with intel emulation
Diffstat (limited to 'kernel')
-rw-r--r--kernel/drivers/cpu.c6
-rw-r--r--kernel/main.c1
2 files changed, 4 insertions, 3 deletions
diff --git a/kernel/drivers/cpu.c b/kernel/drivers/cpu.c
index 5d53bef..296e73a 100644
--- a/kernel/drivers/cpu.c
+++ b/kernel/drivers/cpu.c
@@ -179,12 +179,14 @@ CLEAR void cpu_enable_features(void)
void clac(void)
{
- __asm__ volatile("clac" ::: "cc");
+ if (cpu_extended_features.ebx & CPUID_EXT_FEAT_EBX_SMAP)
+ __asm__ volatile("clac" ::: "cc");
}
void stac(void)
{
- __asm__ volatile("stac" ::: "cc");
+ if (cpu_extended_features.ebx & CPUID_EXT_FEAT_EBX_SMAP)
+ __asm__ volatile("stac" ::: "cc");
}
CLEAR void cli(void)
diff --git a/kernel/main.c b/kernel/main.c
index c51adc9..93bfc29 100644
--- a/kernel/main.c
+++ b/kernel/main.c
@@ -29,7 +29,6 @@ int kernel_main(u32 magic, u32 addr, u32 esp)
multiboot_init(magic, addr);
memory_install();
- memory_switch_dir(virtual_kernel_dir());
cpu_enable_features();
cpu_print();