IDT GDT on multiproc

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.
Post Reply
puneet
Posts: 7
Joined: Thu Jan 07, 2010 7:29 am

IDT GDT on multiproc

Post by puneet »

Greetings all,

I am a little confused about the IDT and GDT on multiproc. Do I need to do lgdt and lidt on all the CPUs or just once.


Well it looks like I am sure it should be done on all procs and I have already coding my OS that way, but I didn't find it in the multiproc initilization part of Intel proc manuals. Can you guys please put some light.



Thanks,
Puneet
User avatar
xenos
Member
Member
Posts: 1121
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: IDT GDT on multiproc

Post by xenos »

You need to do perform lgdt and lidt on all CPUs. Each CPU has its own GDT and IDT registers, so they have to be loaded separately. But of course, you can load the same value into each of them, so you need only one copy of the GDT / IDT stored in memory.
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
puneet
Posts: 7
Joined: Thu Jan 07, 2010 7:29 am

Re: IDT GDT on multiproc

Post by puneet »

Thanks XenOS!!

As I need different TSS for every proc, for thread jump from user to kernel so I have kept separate GDT per processor but same IDT.


Thanks again,
Puneet
Post Reply