Interupt help...
Posted: Fri Aug 23, 2002 7:38 pm
Ok, I really need someone to explain interupts more fully for me... from what I understand, there are a few "inbuilt" hardware interupts on the cpu for exeptions and stuff these are numbered 0 - 30 or something, then the rest are for you to use, and these are like mini-funtions or something, and these are stored in memory and when the CPU gets gets an IRQ/ISR (interupt service request) it saves all the regiseters then goes to the mini-function to handle it, and to know which one to goto it looks up the interupt number in the IDT (interupt descriptor table) for the memory address to goto, so for the general protection fault interupt it would look up the interupt number in the IDT, then goto that mem address to start executing the code, of which you might do a windows and show a message box before crashing the system , then it returns with the iret instruction to go back to what ever the cpu was doing before the interupt... so if you wanted to have your own software interupt you would add a value into the IDT...am I right so far? but how do you know what the interupt number is for like hardware and stuff? like it sends an interupt to tell you the mouse and been moved or the keyboard pressed, but how do you know which interupt gets sent etc for you to write a handler function?
So am I right? any mistakes or corrections you want to make? or explain some of it further for me?
And as I understand, if the CPU can only be executing the one stream of code then how could you have a multi-tasking OS... so am I to understand there is an inbuilt timer interupt which in the handler function would call the shedaler to swap the task? where can I get info on this interupt?
Thanks.
So am I right? any mistakes or corrections you want to make? or explain some of it further for me?
And as I understand, if the CPU can only be executing the one stream of code then how could you have a multi-tasking OS... so am I to understand there is an inbuilt timer interupt which in the handler function would call the shedaler to swap the task? where can I get info on this interupt?
Thanks.