X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Trace-PostClient-IP: 68.147.131.211 From: Brian Inglis Newsgroups: comp.os.msdos.djgpp Subject: Re: Strange VESA problem Organization: Systematic Software Message-ID: References: <20040926034158 DOT 24216 DOT 00001082 AT mb-m10 DOT aol DOT com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 44 Date: Sun, 26 Sep 2004 18:58:59 GMT NNTP-Posting-Host: 24.71.223.147 X-Complaints-To: abuse AT shaw DOT ca X-Trace: pd7tw1no 1096225139 24.71.223.147 (Sun, 26 Sep 2004 12:58:59 MDT) NNTP-Posting-Date: Sun, 26 Sep 2004 12:58:59 MDT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On 26 Sep 2004 07:41:58 GMT in comp.os.msdos.djgpp, jbs30000 AT aol DOT com (JBS30000) wrote: >I have a dual boot computer, I can either boot into Windows XP or DOS from >Windows 98 ( from http://newdos.yginfo.net/msdos71/index.htm). >Anyway, I'm messing around geting VBE info with function 0 and then printing it >out on the screen, and, under the DOS box from Windows XP, everything runs >fine, but try to run my program under pure DOS and none of the strings return >anything. >I called my VBE info block structure "vesainfo". For an exaple, using long >OEM_String_PTR I'll show how I get the string to print. It would help if you posted all the relevant parts of the real code. >I have variables char OEM_String[255]; and short Real_Mode_PTR; ^^^^^ Real_Mode_PTR needs to be at least 20 bits: use unsigned int or long. >To get the OEM String pointer: >Real_Mode_PTR = ((vesainfo.OEM_String_PTR >> 16) << 4) + >(vesainfo.OEM_String_PTR & 0xFFFF); > dosmemget(Real_Mode_PTR & 0xFFFF, 255, &OEM_String); ^^^^^^^^ The pointer's likely to be an address over 0xA0000, so this won't help, add another digit: 0xFFFFF and use in the previous statement, or mask the high half with 0xFFFF in the previous statement: Real_Mode_PTR = (((vesainfo.OEM_String_PTR >> 16) & 0xFFFF) << 4) + (vesainfo.OEM_String_PTR & 0xFFFF); OR Real_Mode_PTR = (((vesainfo.OEM_String_PTR >> 16) << 4) + (vesainfo.OEM_String_PTR & 0xFFFF)) & 0xFFFFF; >Now, if I >printf("Chipset or OEM %s \n", &OEM_String); >under Windows XP DOS box, it prints out the string, but under pure DOS, it >doesn't. Does anybody have any ideas why? Thanks. -- Thanks. Take care, Brian Inglis Calgary, Alberta, Canada Brian DOT Inglis AT CSi DOT com (Brian[dot]Inglis{at}SystematicSW[dot]ab[dot]ca) fake address use address above to reply