how do i program my own interupts?
Posted on 2002-08-17 00:58:48 by Qages
Program your own OS.
Posted on 2002-08-17 04:34:03 by bazik
1. Design and program your own OS
2. Take interrupt code from "X" OS and modify it and/or modify the interrupt descriptor for each vector
Posted on 2002-08-17 06:47:02 by SpooK the Intel Architecture Software Developers manual (There are three extensive volumes) there is a complete section on the interrupt descriptor table and soforth. It does not go into great specific detail on programmijng interupts but gives enough detail that if you read it carefully you will be able to figure it out. It has examples of how to write exception handlers which are really interupts by another name. Once you write an exception handler you will be able to write an interrupt handler no problem.

Posted on 2002-08-17 13:31:15 by IwasTitan

Program your own OS.

this is what im doing, thats why i need i need to make my own interupts
Posted on 2002-08-17 17:03:55 by Qages
I'm doing the same thing right now for DynatOS... advanced interrupt implementation.

Interrupts are nothing more than "subroutines" at the core... automatic situation handlers.

A common starting ground is implementing the "required" vectors 0 - 31 (some are reserved/not used used yet)... the rest of those vectors must exist and must have concise code "handlers" applied to them. Another usual approach (after the basic 32 are complete) is to map IRQs 0-15 to Interrupt Vectors 32-47... this gives great ease in handling common Interrupts and Exceptions. The rest of the vectors (48-255 or 32-255 if you don't map the IRQs) are at your disposal.

There are only a few things to keep in mind about interrupts.
1. The IDT (32-bit protected mode) is nothing more than a descriptor-vector lookup table.
2. Each descriptor points to a GDT descriptor vector, the offset address from the base of the said GDT descriptor to the actual handler code, and the attributes of the IDT descriptor.
3. Some Interrupts/Exceptions require a jump from ring-to-ring (usually ring-3 to ring-0), for this you use a task gate (if my mind hasn't wandered off too much), but most of the work is done by the CPU in successfully executing the Interrupt/Exception Handler and returning with the "IRET".
4. Have fun... I still can't figure out which was/is more "fun"... memory management or messing with the interrupts.
Posted on 2002-08-17 21:45:13 by SpooK
if you coukld tell me how to implement memory mananament too would be nice, i use disk/io to read 0s into memory from floppy for memory allocation right now... all i basicly have right now is a bootloader, loads a file and executes it, displayes a message then stops at a prompt from bios int asking for y or n to reboot
Posted on 2002-08-18 01:38:36 by Qages
I'm not one to satisfy requests as such because they impede on the "feed me source code" one which I do not like. There is no way for me to "tell you" how to do things without giving my OS structure away.

If you need help... goto...
or (linking to this site from another won't work)
Posted on 2002-08-18 17:31:02 by SpooK