diff options
author | AlmuHS <almuhs@github.com> | 2019-07-08 21:20:40 +0200 |
---|---|---|
committer | AlmuHS <almuhs@github.com> | 2019-07-08 21:20:40 +0200 |
commit | 90ca35f8c0d8d84093628bcc1ffe78f5479b51e3 (patch) | |
tree | 8774c9159bdf5a0b082d197dfc901c221e1d5fab | |
parent | 1b05999a3d13b1c7ad9a57bfb85b8e69ec9a6c96 (diff) |
refactor: removed paging code from assembly routine
-rw-r--r-- | i386/i386/cpuboot.S | 73 |
1 files changed, 5 insertions, 68 deletions
diff --git a/i386/i386/cpuboot.S b/i386/i386/cpuboot.S index e1e3635a..5373e9a3 100644 --- a/i386/i386/cpuboot.S +++ b/i386/i386/cpuboot.S @@ -85,74 +85,7 @@ _apboot: movw %ax,%es movw %ax,%ss -/*#if PAE*/ -/* //set_cr3((unsigned)_kvtophys(kernel_pmap->pdpbase));*/ -/* movl (pdpbase_addr), %eax*/ -/* movl %eax, %cr3*/ - -/*#ifndef MACH_HYP*/ -/* //if (!CPU_HAS_FEATURE(CPU_FEATURE_PAE))*/ -/* movl (cpu_features), %eax*/ -/* test $(1<<CPU_FEATURE_PAE), %eax*/ -/* jnz setpae*/ -/* jz nopae*/ - -/*setpae:*/ -/* //set_cr4(get_cr4() | CR4_PAE);*/ -/* movl %cr4, %eax*/ -/* orl $CR4_PAE, %eax*/ -/* movl %eax, %cr4*/ -/*nopae:*/ -/* nop*/ - -/*#endif /* MACH_HYP */ -/*#else*/ -/* //set_cr3((unsigned)_kvtophys(kernel_page_dir));*/ -/* movl (kernel_page_dir_addr), %eax*/ -/* movl %eax, %cr3*/ - -/*#endif PAE */ -/*#ifndef MACH_HYP*/ -/* /* Turn paging on.*/ -/* * Also set the WP bit so that on 486 or better processors*/ -/* * page-level write protection works in kernel mode.*/ -/* */ -/* //set_cr0(get_cr0() | CR0_PG | CR0_WP);*/ -/* //movl %cr0, %eax*/ -/* //orl $(CR0_PG | CR0_WP), %eax*/ -/* movl $0x8001003b, %eax*/ -/* movl %eax, %cr0*/ - -/* //set_cr0(get_cr0() & ~(CR0_CD | CR0_NW));*/ -/* movl %cr0, %eax*/ -/* andl $(~(CR0_CD | CR0_NW)), %eax*/ -/* movl %eax, %cr0*/ - - -/* //if (CPU_HAS_FEATURE(CPU_FEATURE_PGE))*/ -/* movl (cpu_features), %eax*/ -/* test $(1<<CPU_FEATURE_PGE), %eax*/ -/* jnz setpge*/ -/* jz nopge*/ - -/* setpge:*/ -/* //set_cr4(get_cr4() | CR4_PGE);*/ -/* movl %cr4, %eax*/ -/* orl $CR4_PGE, %eax*/ -/* movl %eax, %cr4*/ -/* nopge:*/ -/* nop*/ - -/*#endif /* MACH_HYP */ - -/* //flush_instr_queue();*/ -/* jmp 0f*/ -/*0:*/ -/* //flush_tlb();*/ -/* movl %cr3, %eax*/ -/* movl %eax, %cr3*/ - - + /* Load cpu stack */ movl stack_ptr, %esp addl $STACK_SIZE, %esp @@ -160,9 +93,13 @@ _apboot: pushl $0 popf + /* Load stack pointer */ pushl stack_ptr + /* Enable paging in the cpu */ call paging_setup + + /* Finish the cpu configuration */ call cpu_ap_main cli |