summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile12
-rw-r--r--boot/mp.asm10
-rw-r--r--kernel/kernel.c8
-rw-r--r--kernel/smp.c17
4 files changed, 27 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index d59d676..426ae78 100644
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,7 @@
############ phony targets ############
-.PHONY: all clean run
+.PHONY: all clean run stick new newrun
############ some constants ############
@@ -58,6 +58,10 @@ FILLUP=./data/fill.bin
all: FoolOS.img FoolData.img
+new: clean all
+
+newrun: clean run
+
############ nasm assembling rules ############
%.o: %.asm
@@ -92,8 +96,10 @@ FoolOS.img: $(MBR) kernel.bin $(FILLUP)
binfont.img: binfont.bin
cat $^ > $@
-FoolData.img: binfont.bin
- cp $^ $@
+FoolData.img: $(FILLUP) binfont.bin $(MP_BIN)
+ cp $(FILLUP) $@
+ dd if=$(MP_BIN) of=$@ bs=512 seek=0 conv=notrunc
+ dd if=binfont.bin of=$@ bs=512 seek=1 conv=notrunc
############ vm stuff ############
diff --git a/boot/mp.asm b/boot/mp.asm
index 0e1ec7f..6763b27 100644
--- a/boot/mp.asm
+++ b/boot/mp.asm
@@ -1,13 +1,7 @@
; other processors will enter here!
-
-[org 0x9000]
-
-jmp switch_to_pm
-
-%include "boot/GDT.asm"
+[org 0x7000] ; here the binary will be loaded
[bits 16]
-switch_to_pm:
cli ;switch off interrupts!
lgdt [gdt_descriptor] ;load descriptor table!
@@ -39,3 +33,5 @@ boot_32_pm:
mov eax,1
;
call 0x10000 ;jump into our Kernel!
+
+%include "boot/GDT.asm"
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
}
}