Quick question

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
DarylD

Quick question

Post by DarylD »

After I load a new CS selector do I need to do anything special? (I am already in protected mode).

I am doing this because I have changed the GDT and want to reload CS/DS just to be on the safe side.

I get triple fault though??
Keith

RE:Quick question

Post by Keith »

No, but you're probably reloading your GDT improperly.  Once you have a GDT in place, pointed to by the GDTR, you can't alter it directly if the segment is in use (it's very ill advised).  Your BEST bet would be to relocate the GDT to some new memory area, do _not_ edit the existing copy in place.  Make sure that your CODE and DATA segments defined in your GDT are the same in both (they can have different base, limit, granularity, etc.), but you'll want to make sure that the SELECTORS for these entries would be the same.  After you build it, execute lgdt with the address and boom, no need to reload your CS or DS selector, either.
Post Reply