Take the 2-minute tour ×

I'm writing my own operating system and need to know how to modify the interrupt table so that certain ones (print string, etc.) are redirected to the command prompt application, similar to how DOS did it.

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

For what it's worth, I've only done this in DOS in what now feels like another life, but - if I recall correctly - all we did was disable interrupts, write a new pointer to the desired entry in the interrupt table (starting at address 0:0), and then re-enable interrupts.

share|improve this answer
How wide are the pointers? And what is their structure –  Cole Johnson May 1 '12 at 17:26
In real mode, the interrupt entries are 4-byte values (segment, offset pairs). –  500 - Internal Server Error May 1 '12 at 17:28
Just for completeness : the interrupt vector table (as called by the Intel manuals) starts at address 0 by default, but that location can be changed by the LIDT instruction. You should note that this instruction is not available on the original 8086, though - but this shouldn't really be an issue. –  Daniel Kamil Kozar May 1 '12 at 17:33
The os runs in protected mode... What is the structure of that? –  Cole Johnson May 1 '12 at 17:43
I don't know - I've never worked directly with the interrupt table in protected mode. I suggest you post another question specifying protected mode since you've flagged this one as answered. –  500 - Internal Server Error May 1 '12 at 17:44
show 1 more comment

Your Answer


