diff options
author | AlmuHS <almuhs@github.com> | 2019-05-20 17:27:19 +0200 |
---|---|---|
committer | AlmuHS <almuhs@github.com> | 2019-05-20 17:27:19 +0200 |
commit | 5d4df7ed707fc4c7b09b48d6bdb122835494f13c (patch) | |
tree | c09516a489f7624506d78ea07ff6222388636cde /i386/i386/cpuboot.S | |
parent | f533f44f599e86da8e3b6d8dec8863b8a17b1dbd (diff) |
wip: fixed pagging enable in assembly macro (not tested yet)
Diffstat (limited to 'i386/i386/cpuboot.S')
-rw-r--r-- | i386/i386/cpuboot.S | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/i386/i386/cpuboot.S b/i386/i386/cpuboot.S index d50d2dc5..35ef2e92 100644 --- a/i386/i386/cpuboot.S +++ b/i386/i386/cpuboot.S @@ -1,5 +1,7 @@ #include <mach/machine/asm.h> #include <i386/i386asm.h> +#include <i386/locore.h> +#include <i386/proc_reg.h> #define STACK_SIZE (4096 * 2) @@ -96,9 +98,10 @@ _apboot: #ifndef MACH_HYP //if (!CPU_HAS_FEATURE(CPU_FEATURE_PAE)) - bt %cr4, $CPU_FEATURE_PAE - jc setpae - jnc nopae + mov cpu_features, %eax + test $(1<<CPU_FEATURE_PAE), %eax + jz setpae + jnz nopae setpae: movl %cr4, %eax @@ -132,14 +135,15 @@ nopae: movl $CR0_CD, %edx orl $CR0_NW, %edx not %edx - andl %edx, %eax + andl %edx, %eax movl %eax, %cr0 //if (CPU_HAS_FEATURE(CPU_FEATURE_PGE)) - bt %cr4, $CPU_FEATURE_PGE - jc setpge - jnc nopge + movl cpu_features, %eax + test $(1<<CPU_FEATURE_PGE), %eax + jnz setpge + jz nopge setpge: //set_cr4(get_cr4() | CR4_PGE); |