diff options
| author | Michal Idziorek <m.i@gmx.at> | 2014-09-08 15:49:38 +0200 |
|---|---|---|
| committer | Michal Idziorek <m.i@gmx.at> | 2014-09-08 15:49:38 +0200 |
| commit | 4fdb0ed3a324adab8d752bdaa58b61ac445fea00 (patch) | |
| tree | d35e93c9971e903c6e3cac45acccb38c170abe9f /kernel/kernel.c | |
| parent | 12b60a62e6d639f53d64f8a5823870070d8b467b (diff) | |
spinlocks
Diffstat (limited to 'kernel/kernel.c')
| -rw-r--r-- | kernel/kernel.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/kernel/kernel.c b/kernel/kernel.c index 533ff7c..d1de73f 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -4,6 +4,7 @@ #include "lib/logger/log.h" #include "lib/int/stdint.h" #include "lib/bool/bool.h" + #include "smp.h" #include "time.h" @@ -21,7 +22,15 @@ void kernel_ap() { proc++; uint8_t p=proc; - while(1)cpu_counter[p]++; + while(1) + { + cpu_counter[p]++; +/* + lock_spin(0); + log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"cpu[%d] %d",p,cpu_counter[p]); + lock_release(0); +*/ + } } // @@ -131,19 +140,13 @@ void kernel_main(uint32_t initial_stack, int mp) mem_init(0x7c00+1,*((uint16_t *)(0x7c00))); // init spinlocks - log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"Initializing Spinlocks"); - init_spinlocks(); - lock_spin(0); - // // Start the other Processors (also before paging !) // smp_log_procdata(&procdata); - lock_spin(0); - smp_start_aps(&procdata,0x80000); // starts at 0x90000 // but it will be copied over mbr |
