diff options
| author | Michal Idziorek <m.i@gmx.at> | 2015-05-16 04:46:12 +0200 |
|---|---|---|
| committer | Michal Idziorek <m.i@gmx.at> | 2015-05-16 04:46:12 +0200 |
| commit | ec6d07e29d1d55afe9d2c6f7f25e9fed20819af6 (patch) | |
| tree | ad990d16626fdd0835d1ae0d6252a7833de13588 | |
| parent | da62d2a7efc756870143ecda6566b0bea91b817f (diff) | |
started reactivating multiple processors
| -rw-r--r-- | Makefile | 4 | ||||
| -rw-r--r-- | kernel/acpi.c (renamed from xxx/inactive/acpi.c) | 3 | ||||
| -rw-r--r-- | kernel/acpi.h (renamed from xxx/inactive/acpi.h) | 0 | ||||
| -rw-r--r-- | kernel/kernel.c | 36 | ||||
| -rw-r--r-- | kernel/mp.c (renamed from xxx/inactive/mp.c) | 1 | ||||
| -rw-r--r-- | kernel/mp.h (renamed from xxx/inactive/mp.h) | 0 | ||||
| -rw-r--r-- | kernel/smp.c (renamed from xxx/inactive/smp.c) | 4 | ||||
| -rw-r--r-- | kernel/smp.h (renamed from xxx/inactive/smp.h) | 0 | ||||
| -rw-r--r-- | xxx/boot2/mp.asm | 1 |
9 files changed, 23 insertions, 26 deletions
@@ -160,12 +160,12 @@ run-bochs: all # run in qemu run-qemu: - qemu -enable-kvm disk.img -s + qemu -enable-kvm disk.img -smp 4 -s run-qemu-debug: # qemu -enable-kvm -s -S ~/temp/FoolOs/disk.img # qemu -enable-kvm -s -singlestep disk.img - qemu -enable-kvm -s -S -kernel foolos.img # -initrd ext2.img + qemu -enable-kvm -s -S -kernel foolos.img -smp 4 # -initrd ext2.img stop: killall qemu diff --git a/xxx/inactive/acpi.c b/kernel/acpi.c index b42f628..3aec83b 100644 --- a/xxx/inactive/acpi.c +++ b/kernel/acpi.c @@ -4,8 +4,7 @@ #define FOOLOS_MODULE_NAME "acpi" #include "lib/logger/log.h" -#include "lib/int/stdint.h" -#include "lib/bool/bool.h" +#include <stdint.h> #include "lib/string/string.h" #include "smp.h" diff --git a/xxx/inactive/acpi.h b/kernel/acpi.h index b7c7342..b7c7342 100644 --- a/xxx/inactive/acpi.h +++ b/kernel/acpi.h diff --git a/kernel/kernel.c b/kernel/kernel.c index 5f6981b..e5369f4 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -14,6 +14,7 @@ #include "timer.h" #include "mem.h" #include "vmem.h" +#include "mp.h" #include "interrupts.h" #include "multiboot.h" @@ -69,6 +70,23 @@ void kernel_main(uint32_t eax,uint32_t ebx) // uint32_t kernel_blocks=mem_init(info); + // + // Gather Info about other processors. (APs = application processors) + // ACPI or MP + // + smp_processors procdata; + + if(!acpi_find(&procdata)) + if(!mp_find(&procdata)) + panic(FOOLOS_MODULE_NAME,"ACPI and MP search failed! I do not want to continue!"); + // + // Start the other Processors (before paging) + // + smp_log_procdata(&procdata); + //TODO: !!! Check commented out sleep ()!!! + //smp_start_aps(&procdata,0x80000); // starts at 0x80000 + // but it will be copied over mbr + while(1); // // Activate Virtual Memory (paging) @@ -91,24 +109,6 @@ void kernel_main(uint32_t eax,uint32_t ebx) //pci_init(); - // - // Gather Info about other processors. (APs) - // ACPI or MP - // - // - /* - smp_processors procdata; - - if(!acpi_find(&procdata)) - if(!mp_find(&procdata)) - panic(FOOLOS_MODULE_NAME,"ACPI and MP search failed! I do not want to continue!"); - */ - // - // Start the other Processors (also before paging for some reason!) - // - //smp_log_procdata(&procdata); - //smp_start_aps(&procdata,0x80000); // starts at 0x80000 - // but it will be copied over mbr // // Mount Root EXT2 ramimage diff --git a/xxx/inactive/mp.c b/kernel/mp.c index 1f6c2e6..8312821 100644 --- a/xxx/inactive/mp.c +++ b/kernel/mp.c @@ -2,7 +2,6 @@ #include "x86.h" #include "lib/logger/log.h" // logger facilities -#include "lib/bool/bool.h" #include "lib/string/string.h" #include "smp.h" diff --git a/xxx/inactive/mp.h b/kernel/mp.h index fc7f036..fc7f036 100644 --- a/xxx/inactive/mp.h +++ b/kernel/mp.h diff --git a/xxx/inactive/smp.c b/kernel/smp.c index 63b4087..8d122ee 100644 --- a/xxx/inactive/smp.c +++ b/kernel/smp.c @@ -1,7 +1,7 @@ #define FOOLOS_MODULE_NAME "smp" #include "lib/logger/log.h" -#include "lib/int/stdint.h" +#include <stdint.h> #include "smp.h" #include "mem.h" #include "spinlock.h" @@ -91,7 +91,7 @@ void smp_start_aps(smp_processors *pros,uint8_t *start_sel) // do we really neet this? // todo: use some real sleep (not implemented yet :( ) - sleep(30); + //sleep(30); // start proc 0x7 = 0x7000; etc.. *reg=(6<<8)|(1<<14)|0x7; // 110 SIPI diff --git a/xxx/inactive/smp.h b/kernel/smp.h index 8737ffc..8737ffc 100644 --- a/xxx/inactive/smp.h +++ b/kernel/smp.h diff --git a/xxx/boot2/mp.asm b/xxx/boot2/mp.asm index b6efd04..6273226 100644 --- a/xxx/boot2/mp.asm +++ b/xxx/boot2/mp.asm @@ -30,7 +30,6 @@ init_pm: boot_32_pm: - mov eax,1 ; call 0x18000 ;jump into our Kernel! |
