www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/01/05:39:41

Message-Id: <9809010939.AA16600@axe.bre.da>
Subject: SIGALRM question / Text in Graphics mode
To: djgpp AT delorie DOT com
Date: Tue, 01 Sep 1998 11:39:13 METDST
From: Jens Bischoff <j DOT bischoff AT airbus DOT dasa DOT de>

Hello,

I have two questions:


1.) See this demo program:

----
#include <stdio.h>
#include <signal.h>

static void sig_alarm (int sig)
  { static nr = 0;

     printf ("Seconds: %d\n", ++nr);
#ifdef unix    
     signal (SIGALRM, sig_alarm);
#endif      
     alarm (1);
  }

int main ()
  {
   int i = 1;

    if (SIG_ERR == signal (SIGALRM, sig_alarm))
      { puts ("SIG_ERR!");
        return 1;
      }
   alarm (1);
    while (' ' != getchar ());
   return 0;
  }
----

The signal handler should normally be called every 1 second.
But what happens is that it is called only after a key is pressed.
Is this a bug or a feature with DJGPP?

(By the way: Another stange behaviour occurs when I replace the
whole line that contains the "while"-statement with a simple
"while (1);": The program hangs (CTRL-C does not work, no output is
shown), but a "while (1);" works then. Why this?!?


2. ) When in Standard-VGA graphics mode, text output will be displayed 
     on the screen, too. How can this be done in VESA/Super-VGA
     modes (here the output is not shown) ?       


Any comment is welcome!
Many thanks in advance 


Jens 
--
|      |      | Jens Bischoff   |   Daimler-Benz Aerospace Airbus |
|   --<O>--   +-----------------+---------------------------------+
|      |      | Aerodynamic Data Department (EFD)                 |
| Dasa Airbus | Huenefeldstrasse 1-5     D-28199 Bremen (Germany) |

- Raw text -


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