summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2014-09-04 15:51:43 +0200
committerMichal Idziorek <m.i@gmx.at>2014-09-04 15:51:43 +0200
commit75c46037e742f07001fafc5a093b27556d2490c9 (patch)
tree463089fd3c37f6ac397958d113c73b9b1ebfd426 /kernel
parent06e382afcbf199e5e4ec92574a3872ab04fb6e9e (diff)
reenabled symmetric multiprocessing entry
Diffstat (limited to 'kernel')
-rw-r--r--kernel/kernel.c8
-rw-r--r--kernel/smp.c17
2 files changed, 15 insertions, 10 deletions
diff --git a/kernel/kernel.c b/kernel/kernel.c
index 1688017..c95df11 100644
--- a/kernel/kernel.c
+++ b/kernel/kernel.c
@@ -78,7 +78,7 @@ void kernel_main(uint32_t initial_stack, int mp)
// our video memory
//
- uint32_t vesa_physbase=vesa_init(0x8300,0x8400,0x90000);
+ uint32_t vesa_physbase=vesa_init(0x8300,0x8400,0x90000+0x200);
// self-log message of logger :P
log_log();
@@ -131,7 +131,7 @@ void kernel_main(uint32_t initial_stack, int mp)
panic(FOOLOS_MODULE_NAME,"ACPI and MP search failed! I do not want to continue!");
// Start the other Processors (also before paging !)
- //smp_start_aps(&procdata);
+ smp_start_aps(&procdata,0x90000);// starts at 0x90000 but will be copied over mbr
/////////////////////
@@ -139,8 +139,6 @@ void kernel_main(uint32_t initial_stack, int mp)
// paging (pass the vesa physbase address for identity mapping)
// vmem_init(vesa_physbase);
- //////////////////////
-
//
// Scan the PCI Bus
//
@@ -149,7 +147,6 @@ void kernel_main(uint32_t initial_stack, int mp)
//
// pci_init();
-
//
// Initialize Floppy Disk if activated in config.h
//
@@ -175,7 +172,6 @@ void kernel_main(uint32_t initial_stack, int mp)
//
task_init();
-
//
// Just hang here.
//
diff --git a/kernel/smp.c b/kernel/smp.c
index b1a4e3a..0543943 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -19,8 +19,17 @@ void smp_log_procdata(smp_processors *procdata)
}
// this will start all our application processors!
-void smp_start_aps(smp_processors *pros)
+void smp_start_aps(smp_processors *pros,uint8_t *start_sel)
{
+
+ //lets copy the code to the bootsector !
+
+ uint8_t *dest=0x7000;
+ for(int i=0;i<0x100;i++)
+ {
+ dest[i]=start_sel[i];
+
+ }
//bsp (boot processor) enables its local apic
uint32_t *reg=pros->local_apic_address+FOOLOS_APIC_SPUR_INT;
@@ -42,10 +51,10 @@ void smp_start_aps(smp_processors *pros)
// do we really neet this?
// todo: use some real sleep (not implemented yet :( )
- sleep(3);
+ sleep(30);
- // start proc at 0x7000;
- *reg=(6<<8)|(1<<14)|0x9; // 110 SIPI
+ // start proc 0x7 = 0x7000; etc..
+ *reg=(6<<8)|(1<<14)|0x7; // 110 SIPI
}
}