delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/11/17/16:20:20

Date: Mon, 18 Nov 1996 10:08:55 +0000
From: Bill Currie <billc AT blackmagic DOT tait DOT co DOT nz>
Subject: Re: cwsdpmi - rm callbacks and pm sw ints
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Cc: Charles Sandmann <sandmann AT clio DOT rice DOT edu>, djgpp-workers AT delorie DOT com
Reply-to: billc AT blackmagic DOT tait DOT co DOT nz
Message-id: <329035B7.7AB9@blackmagic.tait.co.nz>
Organization: Tait Electronics NZ
MIME-version: 1.0
References: <Pine DOT SUN DOT 3 DOT 91 DOT 961117154821 DOT 13902A-100000 AT is>

Thanks for your effort's Eli, but I found the REAL cause of my problem,
I forgot the bump up the friggin realode stack pointer in my callback.

asm("
_handleInt21:
                pushl   %eax
                cmpw    $0x3000,%es:0x1c(%edi)
                je              1f
                cmpb    $0x40,%es:0x1d(%edi)
                jne             2f
                inb             $0x61,%al
                xorb    $2,%al
                outb    %al,$0x61
2:              movl    %cs:_oldInt21,%eax
                movl    %eax,%es:0x2a(%edi)
                popl    %eax
                iret
1:
                movl    $0xdeadbeef,%es:0x1c(%edi)
                movl    %ds:(%esi),%eax
                movl    %eax,%es:0x2a(%edi)
                movw    %ds:4(%esi),%ax
                movw    %ax,%es:0x20(%edi)
		addw	$6,%es:0x2e(%edi)	# the forgotten line (blush)
                popl    %eax
                iret
");



Eli Zaretskii wrote:
> 
> On Sun, 17 Nov 1996, Bill Currie wrote:
> 
> > If I allocate a real mode callback and insert it in the dos int 21 chain
> > (havn't tried for others), and do a __dpmi_int(0x21,&regs), everything
> > works fine. BUT, if I us a software interrupt instead, the computer
> > locks up  and requires a reset.
> 
> I modified the `main' a bit to not use `_farsetsel' (paranoia) and give me
> a chance to look at the printed values before it crashes (source below)
> and ran it with CWSDPMI, QDPMI and PMODE.  Results:
> 
>         QDPMI:   works, prints and beeps as advertised.
>         CWSDPMI: crashes when INT 21h is issued after the RMCB is
>                  installed.  It seems the crash is *after* the RMCB is
>                  called and chains, because I hear the beep.

That's the __dpmi_int() call working, I reversed the order of the calls
to see 
if it was my direct interrupt calling that caused the problem.

>         PMODE:   prints 0 instead of deadbeaf, crashes with SIGSEGV when
>                  INT 21h is issued.  I attach the traceback below, in the
>                  hope that it says something useful.

Interesting that you got a traceback at all.  When I tried it at home,
emm386 
gave me a (incomplete) stack fault message and my pc locked up.

I agree with your dropping of the _farns*, bloody risky.

I find it interesting that cwsdpmi would continue to work properly with
a naff 
stack pointer real mode when __dpmi_int is used.  Charles, is this a bug
or a 
feature?

Again, thanks for trying.

Bill
-- 
Leave others their otherness.

- Raw text -


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