delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2007/09/01/04:16:22

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: "Alexei A. Frounze" <alexfrunews AT gmail DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: 1] Problems with compiler 2] Problems with Rhide
Date: Sat, 01 Sep 2007 08:01:20 -0000
Organization: http://groups.google.com
Lines: 121
Message-ID: <1188633680.512067.168070@57g2000hsv.googlegroups.com>
References: <0JNN00HK280GQ110 AT mta1 DOT srv DOT hcvlny DOT cv DOT net>
NNTP-Posting-Host: 76.22.63.3
Mime-Version: 1.0
X-Trace: posting.google.com 1188633680 16281 127.0.0.1 (1 Sep 2007 08:01:20 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: Sat, 1 Sep 2007 08:01:20 +0000 (UTC)
In-Reply-To: <0JNN00HK280GQ110@mta1.srv.hcvlny.cv.net>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse AT google DOT com
Injection-Info: 57g2000hsv.googlegroups.com; posting-host=76.22.63.3;
posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Aug 30, 9:52 pm, Ethan Rosenberg <eth DOT  DOT  DOT  AT earthlink DOT net> wrote:
> Dear Group -
>
> Thank you for the help with the environment variable.
> I forgot to set the variable.  I added SET
> DJGPP=c:\D\DJGPP\DJGPP.ENV, and everything works.
>
> However... I respectfully request your advice on the following:
>
> 1] I am using my wife's Windows 2000 computer, but booting off a
> drive that has DOS 7.1 loaded.  I am not running a DOS shell off
> Windows 2000.
>
>   I wrote the following trivial program, to test if my
> installation of DJGPP would work with DOS 7.1
>
> #include <stdio.h>
>
> int main()
> {
>         printf("hello world");
>
> }
>
> I receive the  following message on an attempted compile:  Can't
> create d/djgpp/bin/tt.o  Permission denied (EACCES)
>
> 2] When I start Rhide, my screen looks like a blue and yellow checker
> board. When I open a program, it clears, but when I go to any other
> screen; eg, compile, the checker board reappears.
>
> Much thanks in advance.
>
> Ethan

Regarding the screen problems... I'm not exactly sure if it's that
problem or an additional one...
Apparently, RHIDE is using int 10h functions 1Cxxh to save/restore VGA
state. Either it's not using them correctly or they're not implemented
properly in the video BIOS or not supported properly under Windows. I
work around that by overriding the int 10h interrupt code and failing
those 1Cxxh functions.

Code for Turbo C/C++ 1.01 and NASM 0.98 (both are free and available
on the internet):

RHIDE.C
--------8<--------
// compile in tiny memory model (cs=ds)

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <dos.h>

#define RHIDE_EXE_NAME "RHIDE0.EXE"

extern void interrupt (*pOldInt10h)();
extern void interrupt NewInt10h();

int main (int argc, char* argv[])
{
  char s[256]=RHIDE_EXE_NAME;
  int i;
  for (i=1;i<argc;i++)
  {
    strcat (s, " ");
    strcat (s, argv[i]);
  }
  pOldInt10h = getvect (0x10);
  setvect (0x10, NewInt10h);
  if (system (s))
  {
    printf ("Tried to execute the following command:\n  %s\n", s);
    printf ("Error:\n  %s\n", sys_errlist[errno]);
  }
  setvect (0x10, pOldInt10h);
  return 0;
}
--------8<--------

RHIDEA.ASM
--------8<--------
BITS 16

; CS must be equal to DS!

GLOBAL _NewInt10h, _pOldInt10h

SEGMENT _TEXT PUBLIC CLASS=CODE

_NewInt10h:
        pushf
        cmp     ah, 0x1c
        jne     .OldInt
        xor     al, al
        popf
        iret

.OldInt:
        popf
        jmp     far [cs:_pOldInt10h]

        _pOldInt10h     resd    1
--------8<--------

How to build:
--------8<--------
tcc -1 -K -IC:\BC\INCLUDE -LC:\BC\LIB -c -k -mt rhide.c

nasm rhidea.asm -f obj

tlink /c c:\bc\lib\c0t rhide rhidea, rhide,, c:\bc\lib\cs.lib
--------8<--------

And yes, the above compiles to RHIDE.EXE and executes RHIDE0.EXE which
is the original RHIDE renamed.

HTH,
Alex

- Raw text -


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