delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/15/20:27:44

From: tweety AT Torino DOT ALPcom DOT it (Jurgen Schwietering)
Newsgroups: comp.os.msdos.djgpp
Subject: Timer irq 8 and local multitask.
Date: 15 Dec 1996 21:17:58 GMT
Organization: ALPcom - The Network Provider
Lines: 34
Message-ID: <591pu6$1mv@galileo.polito.it>
NNTP-Posting-Host: monviso.alpcom.it
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Someone who likes hardware interrupts and multitasking?

As I'm new to 32bit programming I'm coming up with a question which is
explained only partially in the faq.
From dos real mode I need to port a routine which I wrote (with some
fatigue) and that works still fine:
I install a handler at interrupt 0x08 (timer) which will chain also to the
old routine. The routine will count (millseconds resolution) a certain
amount of ticks and when necessary call a function which will invoke a
part of the code bye manipulating the stack. So the timer will continue to
count and the routine will do what it needs to do (setting up an
apropriate semaphore and some longer stuff using serial port). When this
routine finishes it will restore th values of the interrupted
programme (stack, registers) manipulating the return stack and finally
doing the ret. During the execution of the secondary routine may
occure other timer interrupts (and they will occur) so a semaphore will
tell the timer to return immediatly to the interrupted routine (which will
be in that moment the secondary routine).

-------i---main programme------------------------------------->
       \---timer interrupt manipulate stack and call iret-\
                                                         |
                     /-----------------------------------/
                     |
                     \-----timer routine----  setup retstack for
original interupted routine and  ret to interupted mainprogramme.

So this is my question: how can handle all this with the dpmi ifc?  Any
sample code under djgpp doing something similar (multitasing kernels do
quite the same)? 

Thank you for your attention
Jurgen

- Raw text -


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