www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/03/27/06:43:51

Date: Mon, 27 Mar 1995 09:52:29 EST
From: THE MASKED PROGRAMMER <badcoe AT bsa DOT bristol DOT ac DOT uk>
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Cc: badcoe AT bsa DOT bristol DOT ac DOT uk
Subject: How to debug after playing with timer-int ?

Hi,
	Badders here again.

	I'm still having some difficulty in my attempt to use a redirected
int 0x8 and a reprogrammed PIT to do screen-refreshes.  Let me just ask a few
questions out of context to see if I'm missing anything obvious:

(1) I've been told that a redirected int0x8 will crash if it occurs during an
    int0x16.  Aren't interrupts disabled during interrupt handling ? (I have
    the impression that HW ones are but SW one are not, can I disable SW ones ?
    My guess is not.)

(2) Which djgpp activities use int0x16 ?  My current guess is:

	printf/puts/getchar/getkey ...
	File I/O

    But are there any 'less obvious' ones (memory allocation ?  paging ?)

(3) Does anybody have any general advise for how to debug a program involving
    interrupt routines.  I sometimes try to use edebug (is that what its
    called ?) and sometimes it behaves reasonably and sometimes the machine
    hangs even before reaching points I know it reaches otherwise.

    I guess that edebug isn't really intended to handle this sort of thing ?
    (I did really expect it to.)  Is their some other way of doing it (given
    that I can't really put prints everywhere 'cos they cause crashes ...)

(4) Last night I advanced the program to the point where it was able to print
    error messages (instead of just hanging the system or printing:

	"UnspUnspUnsp ...."

    all over the screen and I got the message:

	"Internal Stack Exhausted
	 system halted"

    My guess is that this is a system error (or rather a processor exception ?)
    caused by my _go32_dpmi_simulate_fcall_iret to the old int0x8 handler
    running out of stack-space (I just gave it the default).  This morning I
    tried using _go32_dpmi_allocate_dos_memory() to get a buffer (512 bytes) for
    use as a local stack and the program crashed with an "Unsuported int0x0"
    but I didn't yet check that the allocation had succeded (how would I do
    that anyway, the info page is slightly ambiguous ...)

(5) I often get "Unsupported int 0xz" (where "z" is a number).  I guess that
    this is not a direct error, but is more likely to be due to some data
    getting corrupted and used to generate an interrupt ?

    Some times I get (as above) a screen-full of "UnspUnspUnsp" which I guess
    is due to the above occuring inside the int0x8 handler (and consequently
    the next error occurs *before* its printing the last one).


(6) What does it mean when I get two error dumps in a row, particularly when
    they have different selectors.  Can edebug display instructions from other
    that my_cs() ?

	Anyway, enough blind fumbling in the dark, does anybody have a light ?

	Badders


- Raw text -


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