[clug] Re: Real mode interrupt vectors

Martijn van Oosterhout kleptog at svana.org
Thu Apr 3 12:47:53 EST 2003

On Thu, Apr 03, 2003 at 12:23:37PM +1000, Michael Still wrote:
> 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
> therefore running.
> 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?

Ok, when the interrupt handler is called, the CS will be fine but *all other
registers* will be undefined, including DS (data seg) and SS (stack seg).
You shouldn't need to worry about the SS unless you plan on storing more
than a kilobyte on the stack. OTOH, if you want to access any of your
variables you'll need to fix the DS (or use the CS: override). The usual way

  push cs
  pop ds

Assuming your code and data are in the same segment. Since you don't intend
for your interrupt to return you don't need to worry about saving registers

Hope this helps,
Martijn van Oosterhout   <kleptog at svana.org>   http://svana.org/kleptog/
> "the West won the world not by the superiority of its ideas or values or
> religion but rather by its superiority in applying organized violence.
> Westerners often forget this fact, non-Westerners never do."
>   - Samuel P. Huntington
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://lists.samba.org/archive/linux/attachments/20030403/ada1efc2/attachment.bin

More information about the linux mailing list