diff options
| author | Miguel <m.i@gmx.at> | 2018-09-04 01:39:10 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-09-04 01:39:10 +0200 |
| commit | f67ad595650954195ef064a8b91038dbd0e16842 (patch) | |
| tree | f954239e0b9125df4ca44cdc6bb85090a1cfbe51 /kernel/smp.c | |
| parent | 7eb87bf3f3fa6226657a7106eb255cbfa97758d2 (diff) | |
ioapic & lapic
Diffstat (limited to 'kernel/smp.c')
| -rw-r--r-- | kernel/smp.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/kernel/smp.c b/kernel/smp.c index 894dbe0..4aff013 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -26,17 +26,16 @@ void smp_main() // klog("local apic_addr:0x%08X",local_apic_addr); - - uint32_t *reg=local_apic_addr+FOOLOS_APIC_ID; + // // uint32_t *reg=local_apic_addr+FOOLOS_APIC_ID; //klog("local apic id: 0x%08X",(*reg)); - *reg=local_apic_addr+FOOLOS_APIC_SPUR_INT; - *reg|=0x100;//0xffffffff; // all bits 1 and interrupt 255 + // // // *reg=local_apic_addr+FOOLOS_APIC_SPUR_INT; + // // // *reg|=0x100;//0xffffffff; // all bits 1 and interrupt 255 // *reg=0;//xffffffff; // all bits 1 and interrupt 255 -// int_install(); + int_install(); -// x86_sti(); + x86_sti(); @@ -100,9 +99,8 @@ void smp_start_aps(smp_processors *pros,char *path) { if(pros->boot==i)continue; - klog("starting cpu %d",i); - uint8_t dest=pros->local_apic_id[i]; + klog("starting cpu %d (dest: %d) ",i,dest); reg=local_apic_addr+FOOLOS_APIC_INT_COMMAND_HIGH; *reg=dest<<24; // destination apic. @@ -115,7 +113,7 @@ void smp_start_aps(smp_processors *pros,char *path) // todo: use some real sleep (not implemented yet :( ) //sleep(30); - // start proc 0x7 = 0x7000; etc.. + // start proc 0x7 = 0x7000; *reg=(6<<8)|(1<<14)|0x7; // 110 SIPI } } |
