delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/12/23/12:30:06

Date: Mon, 23 Dec 2002 18:27:09 +0100
From: "@@spam.org" <""GEENSPAM_\"@@spam.org">">
User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.1) Gecko/20020829
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
CC: Ewout Boks <oldenburgh AT kiwanda DOT xs4all DOT nl>, djgpp AT delorie DOT com
Subject: Re: djgpp hw interrupt seg fault
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1021222075427 DOT 28392C AT is>
Lines: 50
Message-ID: <3e0746ad$0$142$e4fe514c@news.xs4all.nl>
NNTP-Posting-Host: 213.84.165.48
X-Trace: 1040664237 news.xs4all.nl 142 213.84.165.48:1816
X-Complaints-To: abuse AT xs4all DOT nl
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Eli Zaretskii wrote:
> On Thu, 19 Dec 2002, Ewout Boks wrote:
> 
> 
>>I installed a similar handler for the timer hook (using
>>_go32_dpmi_set_protected_mode_interrupt_vector() ) and I locked all
>>variables and code involved using the go32 lock functions. The handler
>>itself does all the necessary pushing and pooing of registers etc.
>>
>>When I run the code (on Win NT in a DOS box) I get a segmentation fault
>>as soon as the handler tries to modify a global variable - data local to
>>the handler can be manipulated without problems.
> 
> 
> Did you lock that global variable as well?
> 
> 

Thanks for your reply.

Yes, I did using the _go32_dpmi and later __dpmi__ functionsto lock 
variables, code and stack.

I did notice that the code behaved differently when I tested it on a 
system running FreeDOS instead of Win NT.

I also read that it is impossible to switch a protected mode stack frame 
when in the HW ISR handler. The only way to accomplish that would be to 
use the signal facility and do the switch when back in protected mode.
Trouble with that is, if you want to send a process a signal (with 
'kill') you need to supply kill with the pid of that process. This PID 
is also not available to the HW handler. I put it in a variable and 
locked that variable, but again I get a segmentation fault when the 
handler tries to read the pid value.

One other thing that may cause a problem : I am developing my code under 
FreeBSD, and use the djgpp port (package, like rpm under Redhat Linux) 
for FreeBSD. The djgpp port is version 2, but unfortunately uses version 
2.7 of the gcc cross compiler, which is really old. I haven't tried to 
install gcc 3.2 yet, perhaps that would solve this.
  Also, I think Windows NT isn't 100% compatible with 'real' MS DOS.

If you can shed any further light on this, that would be great!


Thanks,


Ewout  ( k i w a n d a @@@@@  b o k s . c o m )

- Raw text -


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