Real mode interrupt vectors
mikal at stillhq.com
Thu Apr 3 12:23:37 EST 2003
On Thu, 3 Apr 2003, Martijn van Oosterhout wrote:
> As the other guy said, you need you DS (or some segment) to be set. I only
> know Intel syntax off the top of my head so bear with me:
> push es
> lea si, [bad_opcode] ; or mov si, bad_opcode
> xor ax,ax
> mov es, ax
> mov es:[6*4], si
> mov es:[6*4+2], cs
> pop es
> Translate as appropriate.
Yeah, he was right. I came up with:
lea bad_opcode, %si
xorw %ax, %ax
movw %ax, %ds
mov %si, 0x18
mov %cs, 0x1A
Which seems to be calling the interrupt, because I call int 6, and my int
6 handler halts the CPU. I see haltedness of the machine, and it is
My new problem is, the interrupt handler wants to use subroutines defined
in the code segment which setup the interrupt handler. However, when I do
this, I get a "EBDA to big" message. Surfing seems to indicate this is a
LILO telling me about my dodgy kernel thing.
Will the interrupt magically be in the right code segment, or do I need to
use the value I saved when I setup the interrupt handler myself?
Michael Still (mikal at stillhq.com) | Stage 1: Steal underpants
http://www.stillhq.com | Stage 2: ????
UTC + 10 | Stage 3: Profit
More information about the linux