From: phreadd AT powerup DOT com DOT au (David Orme) Newsgroups: comp.os.msdos.djgpp Subject: Re: newbie doing a port from BC to DJGPP Date: 15 Apr 1997 08:44:15 GMT Organization: Power Up Lines: 53 Message-ID: <5ivf4v$of7$1@grissom.powerup.com.au> References: <5io1nm$t3c$1 AT grissom DOT powerup DOT com DOT au> <334F9793 DOT 48A7 AT cornell DOT edu> Reply-To: phreadd AT powerup DOT com DOT au NNTP-Posting-Host: ts1608.powerup.com.au Mime-Version: 1.0 Content-Type: Text/Plain; charset=US-ASCII To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp 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" | +----------------------------------------+