delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/10/13/05:32:36

From: Corelli Marco <mcorelli AT gtwparc DOT padova DOT ccr DOT it>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Accesing from 0xFFFF:F000 to 0xFFFF:FFFF physical memory address
Date: Fri, 13 Oct 2000 10:03:55 +0200
Organization: IUnet
Lines: 101
Message-ID: <39E6C1EB.58AED5F3@gtwparc.padova.ccr.it>
References: <39E5E00A DOT 39A80E46 AT gtwparc DOT padova DOT ccr DOT it> <7263-Thu12Oct2000193356+0300-eliz AT is DOT elta DOT co DOT il>
NNTP-Posting-Host: proxy.iperv.it
Mime-Version: 1.0
X-Trace: serv1.iunet.it 971423920 28937 151.4.122.158 (13 Oct 2000 07:58:40 GMT)
X-Complaints-To: newsmaster AT iunet DOT it
NNTP-Posting-Date: 13 Oct 2000 07:58:40 GMT
X-Mailer: Mozilla 4.75 [en] (Win98; U)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi,

this messagge appear:

-----------------------------
Exiting due to signal SIGSEV
Page fault at eip=00003cda, error=0004
eax=000000c7 ebx=00010000 exc=00000000 edx=00000000 esi=00000054
edp=00091ba8 esp=00091ba8 program=xxxx

cs : sel=00a7 base=10000000 limit=0009ffff
ds : sel=00a7 base=10000000 limit=0009ffff
es : sel=00c7 base=10000000 limit=0009ffff
fs : sel=00a7 base=ffff0000 limit=0000ffff
gs : sel=00bf base=00000000 limit=0010ffff
ss : sel=00af base=10000000 limit=0009ffff

call frame traceback EIPc:
0x00003cda
0x00001c4d
0x00001906
0x00003512
-----------------------------

and a little piece of code:

-----------------------------


...

 unsigned char   byte_read ;
 unsigned long  physaddr ;
 unsigned long  i ;
 int     count ;
 int     selector ;
 __dpmi_meminfo  mem ;

...

//* Open file in write mode

...
  mem.address = 0xFFFF0000 ;
  mem.size = 0x10000 ;
  selector_physical_address( &selector, &mem ) ;

  for ( i=0; i<FLASH_LEN; i++ )
     {

   byte_read = _farpeekb ( selector, i % FLASH_SEG ) ;

   //* Attempt to write byte
   if ( ( count = fwrite( &byte_read, sizeof( char ), 1, hFile ) ) != 1)

    break ;

        //* for
        }

  free_selector_physical_address ( &selector, &mem ) ;


...

void selector_physical_address ( int *selector, __dpmi_meminfo *mem )
//* Begin
{
 //* Mapping physical address...
 if ( __dpmi_physical_address_mapping( mem ) == -1 )
     printf ( "\nERR: __dpmi_physical_address_mapping" ) ;

 //* Create new selector to access physical address
 *selector = __dpmi_allocate_ldt_descriptors ( 1 ) ;
 if ( *selector == -1 )
     printf ( "\nERR:  __dpmi_allocate_ldt_descriptors\n" ) ;

 //* Set current base segment
 if ( __dpmi_set_segment_base_address ( *selector, mem->address ) == -1
)
     printf ( "\nERR:  __dpmi_set_segment_base_address\n" ) ;

 //* Set segment limit
 if ( __dpmi_set_segment_limit ( *selector, mem->size - 1 ) == -1 )
     printf ( "\nERR:  __dpmi_set_segment_limit\n" ) ;

//* End
}


void free_selector_physical_address ( int *selector, __dpmi_meminfo *mem
)
//* Begin
{
 __dpmi_free_ldt_descriptor ( *selector ) ;
 __dpmi_free_physical_address_mapping ( mem ) ;

//* End
}


- Raw text -


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