reinstalling the IDT /GDT

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
User avatar
SphinCorp
Member
Member
Posts: 33
Joined: Sun Jun 01, 2008 1:26 pm
Location: In a pickle...
Contact:

reinstalling the IDT /GDT

Post by SphinCorp »

What would happen, should you install create two different IDTs/GDTs and install them at different moments? (bootloader + kernel)
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: reinstalling the IDT /GDT

Post by Combuster »

Have you even RTFMed that?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: reinstalling the IDT /GDT

Post by neon »

Are you expecting something special to happen the second time that you install a GDT or IDT? ;)

To put in other words, nothing would happen. (Depending on how different they are, you may need to do some setup work before reinstalling them though...The same principle with installing them for the first time).
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
CodeCat
Member
Member
Posts: 158
Joined: Tue Sep 23, 2008 1:45 pm
Location: Eindhoven, Netherlands

Re: reinstalling the IDT /GDT

Post by CodeCat »

lgdt and lidt store the current GDT and IDT in a hidden register. Every time you use those instructions, the register's contents, and therefore the GDT and IDT, are replaced with a new one.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: reinstalling the IDT /GDT

Post by Love4Boobies »

Having more than one IDT isn't all that uncommon anyway.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
Post Reply