www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/10/18/04:30:14

Message-ID: <E1FF8239A075D311AF7200A0C9D60AE30F9FFD@probe-2.acclaim-euro.net>
From: Shawn Hargreaves <SHargreaves AT acclaimstudios DOT co DOT uk>
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>, djgpp-workers AT delorie DOT com
Cc: Shawn Hargreaves <SHargreaves AT acclaimstudios DOT co DOT uk>
Subject: RE: exit() makes my program crash!!!! (FINAL comment) (fwd)
Date: Mon, 18 Oct 1999 09:26:24 +0100
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2448.0)
Reply-To: djgpp-workers AT delorie DOT com

Eli Zaretskii writes:
> Regarding the one below: is it a good idea to add code to the exit
> code that switches the display to mode 3 (after v2.03 is released)?

I would say not: IMHO it is the responsibility of whoever changed the
video mode to put it back when they are done. For instance Allegro does
try to do this automatically, hooking into atexit() and various signal
handlers to deal with abnormal terminations, but I don't think this code
belongs in libc.

One practical consideration is that it can be surprisingly hard to
correctly reset the mode, as a simple BIOS call is often not sufficient
for this. I've found several buggy VESA implementations that are
unable to select a text mode directly after using a truecolor SVGA 
resolution, so you have to use a VESA call to select a 640x480x8 mode, 
and then go from there to mode 3. Also, if the program is using more
unusual video systems like a VBE/AF hardware accelerator driver, it may 
be left in an unusable state unless that system is closed down gracefully
(waiting for accelerator idle, disabling the linear framebuffer, etc).

> Do other DOS compilers do that?

Not that I'm aware of.


	Shawn Hargreaves.

- Raw text -


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