delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/30/01:30:23.1

Date: Wed, 30 Aug 2000 08:28:48 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Gary Slaughenhaupt <gary DOT slaughenhaupt AT ia DOT nsc DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Newbie stuck.
In-Reply-To: <8ohd8o$rsp$1@voder.nsc.com>
Message-ID: <Pine.SUN.3.91.1000830082822.7235D-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Tue, 29 Aug 2000, Gary Slaughenhaupt wrote:

> int ShowXpressRomInfo()
> {
>     unsigned char * pBIOSTable = (unsigned char *)0xF0000000L;
>     unsigned char xpressStart[12]=
> {'X','p','r','e','s','s','S','t','a','r','t',0};
>     unsigned char xpressInfo[250];
>     int x = 0;
> 
>     // Get BIOS Info Table
>     do
>     {
>         if (memcmp((unsigned char *) &xpressStart,\
>                      pBIOSTable,\
>                     strlen((unsigned char *) &xpressStart))== 0)
>         {
>             pBIOSTable+=12;
>             break;
>         } else pBIOSTable++;
>     } while (pBIOSTable <= (unsigned char *) 0xF000FFF3L);
> 
>     But I get a segment violation when attempting to do the memcmp.

You cannot use this to access conventional memory from a
protected-mode program.  You need to rewrite this code.  One
possibility is to use dosmemget library function to copy the entire
block between 0xF0000000L and 0xF000FFF3L to a normal char array, then
use memcmp as usual.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019