www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/05/30/09:24:17

Date: Mon, 30 May 1994 14:58:00 --100
From: grzegorz AT kmm-lx DOT p DOT lod DOT edu DOT pl (Grzegorz Jablonski)
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: protected mode and inteerupts

cnc AT netcom DOT com (Christopher Christensen) writes:

>  if I used _go32_dpmi_allocate_iret_wrapper() it would crash my program on
>  the first interrupt.  My solution:  don't use _go32_allocate_iret_wrapper,
>  instead make your own iret wrapper with a bit of assembly language in a
>  separate file.

I observed, that allocate_iret_wrapper works in maint5. I tried it in
previous version and it did not work correctly.

>In VCPI mode (i.e. no DPMI)
>* go32 will not redirect real mode interrupts to a protected mode handler, so
>  you have to hook the real mode ivector and point it to a real-mode callback
>  which points to your protected mode function.  Do that with
>  _go32_dpmi_allocate_real_mode_callback_iret()
>* unfortunately, the above doesn't work yet.  I find that even though I have
>  hooked real mode interrupts and allocated the callback it still doesn't
>  catch the real mode interrupts, they must be going to some vector other
>  than int 9 because when I exit my program I see all of the keypresses
>  that were missed on the command line (i.e. they managed to find their way
>  into the keyboard buffer even with both real and protected mode int 9
>  vectors hooked)

The master interrupt controller is relocated, because IBM PC designers
used processor exceptions reserved by Intel for hardware interrupts.
Maint5 knows about it and you can use standard interrupt numbers. In
preceding versions only functions setting protected mode interrupts knew.

There is one more thing - the ISR and data it references should be locked.
Paging in ISR causes general protection fault. There is no such possibility
in maint5, but this DPMI server has it. I think, it should be incorporated
in go32. I also found out, that enabling interrupts in ISR is not allowed.
Some procedures in go32 are not reentrant and strange things happen.

					  Grzegorz W. Jablonski
					  grzegorz AT kmm-lx DOT p DOT lodz DOT pl

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019