Mail Archives: djgpp/1999/04/18/11:58:13
ams AT ludd DOT luth DOT se (Martin Str|mberg) writes:
> Now I'm back to the basics. Here follows a minimal interrupt handler
> that only chains to the previous one. After that one is installed I
> issue an interrupt just to make sure it's working. Alas it isn't; the
> program stops after inserting the interrupt handler. The last thing it
> prints is "Now.".
>
> popl %ds
> ljmp %fs:_old_isr
IMHO, it should be %cs:_old_isr. And you don't need to clobber %fs.
> new_isr.offset32 = (unsigned long)&handler;
> asm("movw %%cs, %0": "=g" (new_isr.selector) );
It can be written as
new_isr.selector = _my_cs ();
> address_of_old_isr = old_isr.offset32;
> selector_of_old_isr = old_isr.selector;
This is not necessary when using ljmp %cs:_old_isr and
lcall %cs:_old_isr.
--
Michael Bukin
- Raw text -