Setting up IDT?

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
St8ic

Setting up IDT?

Post by St8ic »

I need to define a couple interrupts for my OS, but I don't know where to start on making an IDT. Can anyone help with some basics? It just needs to be small and simple.

Thanks.
EyeScream

RE:Setting up IDT?

Post by EyeScream »

1. Allocate a memory area for the IDT. The size is 8 * IDTEntryCount.
2. Fill the area with descriptors. They must follow the IDT format (read the Intel docs).
3. Disable interrupts (CLI), lock the bus (LOCK) and load the IDTR with LIDT [YourTable]. Enable interrupts and pray.

And NEVER overwrite the table once it's loaded. You'll get bad results. You might also want to re-program PIC. There are lots of info on this subject, so... go on and read!

Mike.
St8ic

RE:Setting up IDT?

Post by St8ic »

thanks! I found some additional material and I finaly figured it out....I almost can;t believe it works!
Post Reply