Mail Archives: djgpp/2007/09/01/04:16:22
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 -