This isn’t for anything remotely serious, merely for my own edification. I know that I’m requesting knowledge that has been obsolete for a good while, and only appertains to a rather crappy OS in the first place.
What I want to do is establish my own software interrupt handler under a generic DOS-a-like running on x86 hardware (either IA-16 (8086 and upwards) or IA-32 (80386 and upwards)). I wish to create what would be something like an OS extension without having to modify the OS source code.
To further clarify, I’ll give an example: When you execute the int 21h opcode under most DOS clones, you send the CPU to look at a specifc offset in a jump table. The jump opcode stored at that offset sends it into RAM claimed by the OS so the OS can service the interrupt and then return control to the program. I wish to load my own jump opcode into that table (if I can) and then load my own interrupt-servicing code into RAM, hooking up (say) interrupt 13h to some piece of code I wrote that would do what I choose.
I’m well-versed in both 8086 and 80386 assembly, and I create assembly programs for both dosemu and i686-Linux (I run an AMD Pentium clone). I prefer NASM syntax, as that is the assembler I use, but I’ll be able to work my way through MASM or TASM if I get some help about directives and such. (I doubt GAS will be much used. ;)) If there’s a way to do it in a language that’s not assembly, I’m all ears. Oh, and I have Ralf Brown’s Interrupt List, so I’ll be able to choose an interrupt that isn’t claimed by anything else (with 256 to choose from, it shouldn’t be hard to find a gap).