IRQs/PIC/IDT interrupts/Exceptions

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
Beginner

IRQs/PIC/IDT interrupts/Exceptions

Post by Beginner »

Just finished my first bootloader and yesterday I started writing a kernel. Anyone who knows where I can find everything I need about the PIC/IRQs/IDT and all that stuff.. tried to read the FAQ but didnt get much out of it. I barely know anythings about this subjects, so a basic tutorial or something would be the best :)
Beginner

Re:IRQs/PIC/IDT interrupts/Exceptions

Post by Beginner »

I might add, I dont need code or anything, just wanna know how it works and all that
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:IRQs/PIC/IDT interrupts/Exceptions

Post by Pype.Clicker »

http://osdev.neopages.net/tutorials.php?cat=5&sort=1 might provide you the tutorials you wish ...
Beginner

Re:IRQs/PIC/IDT interrupts/Exceptions

Post by Beginner »

Alright... but what?s software interrupts for? I mean if I wanna check if a key?s been hit I use hardware interrupts..but what can I use software interrupts for in PM? Cause in Real Mode I use BIOS-interrupts (INT instruction) e.g. to wait for the user to press a key, but to do this in PM I read it was better to use a hardware interrupt for such things..
Beginner

Re:IRQs/PIC/IDT interrupts/Exceptions

Post by Beginner »

I mean, in PM, is there already pre-defined software interrupts that I can "launch" with the INT instruction, or do I have to write an ISR for these aswell? Cause if I do I dont see the point with using them since I only could replace the INT-instrction with a function call to the ISR?
DennisCGc

Re:IRQs/PIC/IDT interrupts/Exceptions

Post by DennisCGc »

Beginner wrote: I mean, in PM, is there already pre-defined software interrupts that I can "launch" with the INT instruction, or do I have to write an ISR for these aswell?
Yes, you have to write it yourself as well....
Beginner

Re:IRQs/PIC/IDT interrupts/Exceptions

Post by Beginner »

But hey I dont really get it... you write an ISR for a software interrupt..and then you call it using INT... but Why? why use interrupts that?ll just call a method? why do it via interrupts?
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:IRQs/PIC/IDT interrupts/Exceptions

Post by Pype.Clicker »

in pmode, interrupts will mainly be useful when user-level software needs to trap to the kernel. A simple function call cannot do this.
The IBM approach of having the different hardware components and software services using different well-known interrupt numbers are replaced by OS-specific abstractions ...
Beginner

Re:IRQs/PIC/IDT interrupts/Exceptions

Post by Beginner »

So there?s no really reason for me to use software interrupts if I only wanna write a small kernel (and not develop programs?).. so if a programmer wanna make a program for my OS, then I wanna let Him use my software interrupts?
Curufir

Re:IRQs/PIC/IDT interrupts/Exceptions

Post by Curufir »

If you're just writing a kernel then no, you don't need software interrupts. Since everything is running in ring 0 you can just use pointers instead.
Beginner

Re:IRQs/PIC/IDT interrupts/Exceptions

Post by Beginner »

Thanks a lot :)
Post Reply