From 59bba7624f6236fe7010e0b4da455724dede7304 Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Wed, 11 Feb 2015 15:50:50 +0100 Subject: [PATCH] hw_x86_64: Set system control flags of cr0 register Enable paging, write protection, caching and native FPU error reporting, see Intel SDM Vol. 3A, section 2.5. --- repos/base-hw/src/core/spec/x86_64/kernel/crt0.s | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/repos/base-hw/src/core/spec/x86_64/kernel/crt0.s b/repos/base-hw/src/core/spec/x86_64/kernel/crt0.s index 864754984..25e4cebe0 100644 --- a/repos/base-hw/src/core/spec/x86_64/kernel/crt0.s +++ b/repos/base-hw/src/core/spec/x86_64/kernel/crt0.s @@ -45,6 +45,15 @@ btsl $11, %eax wrmsr + /* Enable paging, write protection, caching and FPU error reporting */ + movl %cr0, %eax + btsl $5, %eax + btsl $16, %eax + btrl $29, %eax + btrl $30, %eax + btsl $31, %eax + movl %eax, %cr0 + /* * Install initial temporary environment that is replaced later by the * environment that init_main_thread creates.