diff options
| author | Miguel <m.i@gmx.at> | 2018-09-11 12:07:07 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-09-11 12:07:07 +0200 |
| commit | 892f64ac908a474159fa3a952f13b62004662c70 (patch) | |
| tree | 9492dacf8a72a5f22232a83fd0b87606b7f61fb1 /kernel/smp.c | |
| parent | 75f0977e41004511bd475ee75a24fd04db4ddc39 (diff) | |
screen checks if video or textmode, cpu private memory pages implemented
Diffstat (limited to 'kernel/smp.c')
| -rw-r--r-- | kernel/smp.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/kernel/smp.c b/kernel/smp.c index 1b1659b..b385681 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -26,7 +26,6 @@ void smp_main() void kernel_ap() { - apic_enable(); klog("Install Interrupt Vector Table (IVT) on CPU with lapic_id=0x%x ...",apic_id()); interrupts_install(); @@ -39,8 +38,11 @@ void kernel_ap() x86_set_page_directory(dir); x86_paging_enable(); - uint32_t *cpu_mem=0x8000000; //1024 pages from here on are mapped per cpu for testing! TODO: dynamic! - *cpu_mem=apic_id(); + apic_enable(); + + //1024 pages from here on are mapped per cpu for testing! TODO: dynamic. + uint32_t *cpu_mem=VMEM_CPU_PRIVATE; + cpu_mem[0]=apic_id(); klog("Setup the LAPIC Timer on CPU with lapic_id=0x%x ...",apic_id()); apic_init_timer(1);// freq 1HZ @@ -50,9 +52,10 @@ void kernel_ap() asm_smp_unlock(); -// cpu_mem[1]=0; + cpu_mem[1]=0; + while(1){ - PutString("cpu cnt: %d",10,10+(*cpu_mem)*20,0xff0000,cpu_mem[1]++); + PutString("cpu cnt: %d",10,10+apic_id()*20,0xff0000,cpu_mem[1]++); asm("hlt"); } } @@ -67,7 +70,6 @@ void smp_start_aps(acpi_information *pros) uint8_t dest=pros->local_apic_id[i]; klog("starting cpu %d (destination apic id: 0x%x) ",i,dest); apic_sipi(dest,0x7); // start on 0x7000 - } } |
