I am learning assembly and I have a question about interrupts. Are they bound to a specific OS? I, like a lot of people, want to make a simple OS of my own, not that I ever will. I was wondering if I can use interrupts like 10h without having windows installed, and also how would I compile the code onto a bootable CD? thanks in advance

6 Years
Discussion Span
Last Post by maf5693

The embedded firmware in the ROMS typically have their own reserved interrupts.

On a PC 10h is the video Bios so not available! There are many others.

Since you're writing your own O.S. then 20h and 21h are up for grabs as that is the DOS interrupt and if you don't install DOS then they're definitely available!


thanks for the reply. Just to double check, that means that 20 and 21 are in?


If you mean 20 hex and 21 hex yes, they're available for you to use in your O.S. Since you're doing your own loader. But for purposes of debugging, etc. You should probably find another hex Interrupt address that's available!


You can re-vector or "hook" any interrupt you want. The table is stored in RAM. The issue is if there is a BIOS function or extension that you require already using it (or a physical interrupt which could be used but wouldn't make much sense to use).

If you wanted you could use 10h and simply pass in parameters not used by VGA BIOS in this case. If the call is actually for VGA BIOS, which you could tell by examining the parameters in your code, then you can pass it on to the VGA BIOS (using a jump to the old interrupt vector, which save when you hooked it ...right?).

Since you are creating the OS , you would want to provide your own drivers anyways, so using BIOS calls would be silly.


there are BIOS bound interrupts which typically give easy input output to hardware devices, and then there are the interrupts defined in the IDT(Interrupt Descriptor Table) usually found in the boot sector and referenced using lidt (look up a tutorial on the IDT). On intel-compatible processors there are typically 19 exceptions that have to be handled using OS-defined interrupts 1-19 in the IDT, then 20-31 are reserved by the processor, then 31-255 are OS-defined. Non-cpu hardware interrupts(i.e. int 09h, which is the keyboard interrupt), are an entirely different story, and require their own special interrupt handlers. If you want to learn more about OS defined interrupts, download the intel architecture manual.

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.