Mail Archives: djgpp/2004/09/26/15:00:41
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
- Raw text -