multicore/multiprocessor [solved]

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.

Moderators: JAAman, klange, Octocontrabass, sortie, kmcguire, chase, thepowersgang, Owen, Combuster, AJ, 01000101, carbonBased, Candy, pcmattman

Post Reply
User avatar
os64dev
Member
Member
Posts: 553
Joined: Sat Jan 27, 2007 3:21 pm
Location: Best, Netherlands

multicore/multiprocessor [solved]

Post by os64dev »

Ok i am looking into multicpu programming and have a question regarding GDT and IDT. Do you share the same GDT and IDT on each processor or do you define new one for each proc.?
Last edited by os64dev on Thu Oct 18, 2007 6:15 am, edited 1 time in total.
Author of COBOS
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post by AJ »

Hi,

Each CPU has its own GDTR and IDTR, but the actual GDT and IDT can be shared. One thing you should do is have a separate TSS for each CPU, though (which kind of makes sense - there could otherwise be quite a mess if both processors are running different threads from the same task).

HTH,
Adam
User avatar
bluecode
Member
Member
Posts: 202
Joined: Wed Nov 17, 2004 12:00 am
Location: Germany
Contact:

Post by bluecode »

AJ wrote:One thing you should do is have a separate TSS for each CPU, though (which kind of makes sense - there could otherwise be quite a mess if both processors are running different threads from the same task).

Imho you can not even use the same TSS descriptor for different cpus, because one cpu sets the busy bit and the other throw an exception when it accesses that descriptor (because the busy bit is set).
User avatar
os64dev
Member
Member
Posts: 553
Joined: Sat Jan 27, 2007 3:21 pm
Location: Best, Netherlands

Post by os64dev »

bluecode wrote:
AJ wrote:One thing you should do is have a separate TSS for each CPU, though (which kind of makes sense - there could otherwise be quite a mess if both processors are running different threads from the same task).

Imho you can not even use the same TSS descriptor for different cpus, because one cpu sets the busy bit and the other throw an exception when it accesses that descriptor (because the busy bit is set).

Yeah that was happening just now. thanks for pointing it out it has saved me a whole lot of debugging. The sharing of the GDT and IDT is what i did already, though it gives an additional requirement: namely reentrant interrupt handlers
Author of COBOS
Post Reply