www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/12/12:07:46

From: Erik Rull <erik_rull AT bluewin DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Still problems with protected_mode_int
Date: Wed, 12 Jan 2000 15:55:02 +0100
Organization: tesion Communikationsnetze Suedwest GmBH & Co.KG, Stuttgart, Germany
Lines: 65
Message-ID: <387C95C6.B2FA8951@bluewin.de>
NNTP-Posting-Host: stu1ir4-102-73.ras.tesion.net
Mime-Version: 1.0
X-Mailer: Mozilla 4.6 [de]C-CCK-MCD QXW03207 (Win95; I)
X-Accept-Language: de,en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi,

I've tried your solution with _my_cs(), but it still doesn't do what I
want...
In plain DOS, the timer_handler() is not called. I don't get the output
of printf().
When I run it from a DOS Box in W95, it works.
Where could the problem be??

Here is my last Mail with the corrected programms:

First I wrote a programm that increases a timer variable when the
timer-int occurs. Then I inserted a system() call that calls another
programm, with the active timer-int.
To make it easier for you, I'll add the sources of the programms to this
mail.
Thanks for helping me!

The programm that contains the system() call:

#include <pc.h>
#include <dpmi.h>
#include <stdio.h>

     volatile int tics = 0;

     void timer_handler()
     {
       printf("Tics passed: %d\n",++tics);
     }

     int main()
     {
       _go32_dpmi_seginfo old_handler, new_handler;

       printf("grabbing timer interrupt\n");
       _go32_dpmi_get_protected_mode_interrupt_vector(8, &old_handler);

       new_handler.pm_offset = (int) timer_handler;
       new_handler.pm_selector = _go32_my_cs();
       _go32_dpmi_chain_protected_mode_interrupt_vector(8,
&new_handler);

       getkey();
       system("timer3.exe");

       printf("releasing timer interrupt\n");
       _go32_dpmi_set_protected_mode_interrupt_vector(8, &old_handler);
       printf("Time : %d",tics);

       return 0;
     }

The programm called by system():

#include <stdio.h>

main()
{
        printf("Timer3.exe is running!\n");
}

P.S. I'm still using version 2.6.3 (1.12 maint3), because no other
works...

- Raw text -


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