summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlmuHS <almuhs@github.com>2019-05-20 20:40:23 +0200
committerAlmuHS <almuhs@github.com>2019-05-20 20:40:23 +0200
commit0c5c4fcd9de8aa21c0c6a424576abe6b7b0ae949 (patch)
tree52391eb58782e4acc0fd85027081de2f31ac8117
parent0cf928ec1e011d352301ca073eb1d96a4b6829d7 (diff)
fix: fix address and registers
-rw-r--r--i386/i386/cpuboot.S12
-rw-r--r--i386/i386/mp_desc.c4
2 files changed, 7 insertions, 9 deletions
diff --git a/i386/i386/cpuboot.S b/i386/i386/cpuboot.S
index 26a249f9..dad5f192 100644
--- a/i386/i386/cpuboot.S
+++ b/i386/i386/cpuboot.S
@@ -93,7 +93,7 @@ _apboot:
#if PAE
//set_cr3((unsigned)_kvtophys(kernel_pmap->pdpbase));
movl %cr3, %eax
- movl kernel_pmap->pdpbase - KERNELBASE, %eax
+ movl pdpbase_addr, %eax
movl %eax, %cr3
#ifndef MACH_HYP
@@ -105,7 +105,7 @@ _apboot:
setpae:
movl %cr4, %eax
- orl CR4_PAE, %eax
+ orl $CR4_PAE, %eax
movl %eax, %cr4
nopae:
nop
@@ -113,8 +113,7 @@ nopae:
#endif /* MACH_HYP */
#else
//set_cr3((unsigned)_kvtophys(kernel_page_dir));
- movl %cr3, %eax
- movl kernel_page_dir - KERNELBASE, %eax
+ movl kernel_page_dir_addr, %eax
movl %eax, %cr3
#endif /* PAE */
@@ -125,8 +124,7 @@ nopae:
*/
//set_cr0(get_cr0() | CR0_PG | CR0_WP);
movl %cr0, %eax
- orl CR0_PG, %eax
- orl CR0_WP, %eax
+ orl $(CR0_PG | CR0_WP), %eax
movl %eax, %cr0
//set_cr0(get_cr0() & ~(CR0_CD | CR0_NW));
@@ -148,7 +146,7 @@ nopae:
setpge:
//set_cr4(get_cr4() | CR4_PGE);
movl %cr4, %eax
- orl CR4_PGE, %eax
+ orl $CR4_PGE, %eax
mov %eax, %cr4
nopge:
nop
diff --git a/i386/i386/mp_desc.c b/i386/i386/mp_desc.c
index 9f1bb64e..93876da5 100644
--- a/i386/i386/mp_desc.c
+++ b/i386/i386/mp_desc.c
@@ -300,8 +300,8 @@ cpu_setup()
int i = 1;
while(i < ncpu && (machine_slot[i].running == TRUE)) i++;
- //unsigned apic_id = (((ApicLocalUnit*)phystokv(lapic_addr))->apic_id.r >> 24) & 0xff;
- unsigned apic_id = lapic->apic_id.r >> 24;
+ unsigned apic_id = (((ApicLocalUnit*)phystokv(lapic_addr))->apic_id.r >> 24) & 0xff;
+ //unsigned apic_id = lapic->apic_id.r >> 24;
/* panic? */
if(i >= ncpu)