delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/13/03:03:04

From: Richard Nichols <tiberius AT mailhost DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: How to call the old hooked in int handler?
Date: Tue, 13 Jan 1998 05:38:14 +1000
Organization: None
Lines: 44
Message-ID: <34BA7126.20C3@mailhost.net>
Reply-To: tiberius AT mailhost DOT net
NNTP-Posting-Host: 138.77.56.32
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I've captured an IRQ with my own handler (irq 8 for timing)
and reprogrammed the PIT to synch to the display refresh. I got
the old int vector in

                 _go32_dpmi_seginfo oldhandler;

and I grab it into a structure like so:

    _go32_dpmi_get_protected_mode_interrupt_vector(irqnum,
&memIRQ[firstfree].oldhandler);
    memIRQ[firstfree].wrapper.pm_selector = _go32_my_cs();
    memIRQ[firstfree].wrapper.pm_offset   = (int)irqhandler;
    _go32_dpmi_allocate_iret_wrapper(&memIRQ[firstfree].wrapper);
    _go32_dpmi_set_protected_mode_interrupt_vector(irqnum,
&memIRQ[firstfree].wrapper);
    memIRQ[firstfree].irq = irqnum;
    memIRQ[firstfree].inuse = TRUE;

I tried to call the old function like:

  void (*memOldHandlerCall)(void);
  ...
  memOldHandlerCall = (void *)memIRQ[myirqnum].oldhandler.pm_offset;
  memOldHandlerCall();
  memOldHandlerCall = NULL;

but the prog always crashes. Because it's a timer which won't 
run at the same speed as the 18.2 clock refresh I won't need to
call the old handler at every interruption. How do I call it?

thanks in advance...

-Rich

-- 
  .------------------------------+--------------------------------.
  | Richard Nichols              | Inspire Media (Demos/Games)    |
  | mailto:tiberius AT mailhost DOT net | mailto:InspireMedia AT post1 DOT com  |
  | http://tiberius.home.ml.org/ | http://inspire.home.ml.org/    |
  +------------------------------+--------------------------------+
  |               Organizer, coder for Inspire Media              |
  `---------------------------------------------------------------'
        "The life of the coder is that of the hermit, except
           the hermit can't make shadebobs." -- Leviathan

- Raw text -


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