delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/13/04:29:09

Date: Sun, 13 Feb 2000 09:45:55 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Rolf Campbell <moscoop AT nortelnetworks DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: How Do I start another DOS program from DJGPP ?
In-Reply-To: <38A32674.A12A521E@americasm01.nt.com>
Message-ID: <Pine.SUN.3.91.1000213094533.29873H-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: dj-admin AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Thu, 10 Feb 2000, Rolf Campbell wrote:

> Eli Zaretskii wrote:
> 
> > > int_handler
> > > {
> > > read_last_string_from_file("tempfile.txt");
> > > process_that_string_quickly_since_we_are_in_an_interrupt;
> > > }
> >
> > That won't work (or, rather, will crash your system): you cannot safely
> > make DOS calls from a hardware interrupt handler, and reading from a file
> > requires a DOS call.
> 
>     But isn't the DJGPP timer interrupt really delayed until data is
> acessed, and then called from the page-fault handler?

You are mixing two things: the DJGPP signal handlers and hardware
interrupt handlers.

Signal handlers indeed run in a safe state, just like the rest of the
application code, so you can do anything from them, including DOS file
I/O.

However, when a program calls DOS, signals are deferred until that
call returns.  Since spawning a child program requires a DOS call, the
parent program will not get any signals until the child program exits.

For this reason, I assumed that the original poster was talking about
a real hardware interrupt handler, not a signal handler.  And DOS file
I/O cannot be done from a hardware interrupt handler.

- Raw text -


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