delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1992/02/11/17:31:11

Date: Tue, 11 Feb 92 17:13:05 EST
From: Jerry Nash <jerry AT rat DOT nrl DOT navy DOT mil>
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: djgpp & DESQview
Status: O

Here is a patch that will let go32 coexist  peacefully with DESQview.  
The problem DESQview has with go32 is that go32 reprograms the  
interrupt controller to remap IRQ0 - IRQ7 to ints 0x78 - 0x7f, and  
then proceeds to clobber the vectors in this range. Unfortunately,  
DESQview uses these ints internally so the consequences are obvious.  
The good part is that there is an easy fix (at least it worked for  
me). Since DESQview already remaps IRQn, just stop go32 from  
remapping if it detects that someone else has already done it and  
tell it to use the existing map. That's all this patch does.

----------cut here -------------
diff old/control.c ./control.c
51a52,53
> extern word16 master_pic;
> 

138a141
>   unsigned char irq1=master_pic+1;
420c423
<   if (tss_ptr->tss_irqn == 0x79)
---
>   if (tss_ptr->tss_irqn == irq1)
diff old/debug.c ./debug.c
39a40
> extern word16 master_pic;
669c670
<   int n, i;
---
>   int n, i, irq1=master_pic+1;
686c687
<     if (i == 0x79)
---
>     if (i == irq1)
diff old/exphdlr.c ./exphdlr.c
46c46,47
< static word16 master_pic = 0x08;      /* Default IRQ0 Vector */
---
> word16 master_pic = 0x78;             /* Default remapped IRQ0  
Vector */
> static word16 old_master_pic = 0x08;  /* Default orig.IRQ0 Vector  
*/
71d71
<   movedata(0, 0x08*4, 0, 0x78*4, 0x08*4);
74,75c74,77
<     master_pic = vcpi_get_pic();
<     vcpi_set_pic(0x78);
---
>     old_master_pic = vcpi_get_pic();
>     if (old_master_pic != 0x08)         /* Someone remapped IRQ0 */
>       master_pic=old_master_pic;
>     else vcpi_set_pic(master_pic);
77c79,81
<   set_controller(0x78);
---
>   if (old_master_pic == 0x08)
>     movedata(0, 0x08*4, 0, master_pic*4, 0x08*4);
>   set_controller(master_pic);
84,86c88,90
<   if (vcpi_installed)
<     vcpi_set_pic(master_pic);
<   set_controller(master_pic);
---
>   if (vcpi_installed && (old_master_pic == 0x08))
>     vcpi_set_pic(old_master_pic);
>   set_controller(old_master_pic);
103,109c107,111
<   if ((i>=0x70) && (i<0x7f) && (i != 0x75))
<   {
<     if (i<0x78)
<       intr(i, &r);
<     else
<       intr(i-0x70, &r);
<     if (i == 0x79)
---
>   if ((i>=0x70) && (i<0x78) && (i != 0x75))
>     intr(i, &r);
>   if ((i>=master_pic) && (i<master_pic+7)){
>     intr(i-master_pic+8, &r);
>     if (i == master_pic+1)

- Raw text -


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