Mail Archives: djgpp/2000/08/30/01:30:23.1
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 -