Mail Archives: djgpp/1997/04/15/07:28:16
In article <334F9793 DOT 48A7 AT cornell DOT edu>, asu1 AT cornell DOT edu says...
>
In article <334F9793 DOT 48A7 AT cornell DOT edu>, asu1 AT cornell DOT edu says...
>i would recommend reading the section:
>17.7 What should I do with those "near" and "far" declarations?
>in the djgpp faq. it should be available in various formats (i prefer
>html) at the site you downloaded djgpp from.
I have, and 18.2, and the surrounding sections. It says to put the variable
address into di and ignore es. This I did, and successfully caused a
"SIGSEGV" program halt.
My original code (before alterations, in BC) looks like this:
struct{
byte buffer[256];
} VESA, *VESA_ptr=VESA;
int CheckVESA()
{
union REGS r;
union SREGS s;
r.h.ah=0x4f;
r.h.al=0;
s.es=FP_SEG(VESA_ptr);
r.x.di=FP_OFF(VESA_ptr);
int86x(0x10,&r,&r,&s); /* here's where it "crashes" with */
if(r.h.ah=0) return 0;
return 1;
}
Apparently DJGPP handles REGS and SREGS differently to Borland C, which is
why my program halts. I converted to _dpmi_regs and __dpmi_int, but they
don't support sending your own buffer (VESA in this case) to the interrupt.
[Actually, this isn't true. You can send your own buffer but it can't be
less than 2Mb, which defeats the purpose of a 256 byte struct]
Please help, as the information in the FAQ isn't very helpful (in this
instance at least).
+----------------------------------------+
| David Orme \/\ |
| phreadd AT powerup DOT com DOT au /\/ |
+----------------------------------------+
| "Striving for Excellence" |
+----------------------------------------+
- Raw text -