Mail Archives: djgpp/2000/10/13/05:32:36
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 -