ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/10/12/12:45:13

From: Corelli Marco <mcorelli AT gtwparc DOT padova DOT ccr DOT it>
Newsgroups: comp.os.msdos.djgpp
Subject: Accesing from 0xFFFF:F000 to 0xFFFF:FFFF physical memory address
Date: Thu, 12 Oct 2000 18:00:10 +0200
Organization: IUnet
Lines: 43
Message-ID: <39E5E00A.39A80E46@gtwparc.padova.ccr.it>
NNTP-Posting-Host: proxy.iperv.it
Mime-Version: 1.0
X-Trace: serv1.iunet.it 971366103 16412 151.4.122.158 (12 Oct 2000 15:55:03 GMT)
X-Complaints-To: newsmaster AT iunet DOT it
NNTP-Posting-Date: 12 Oct 2000 15:55:03 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 All,

I need to access from 0xFFFC:0000 to 0xFFFF:FFFF physical addess to
program a Flash device but when I try to map the address 0xFFFF:F000 to
0xFFFF:FFFF  my program crash !!!!

I use this code for map physical address to linear memory

int selector;
__dpmi_meminfo mem;

mem.address = 0xFFFF0000L;
mem.size = 0x10000;

 //* 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" ) ;


and access the location :

byte_read = _farpeekb ( selector, offset ) ;

at this time my program crash !!!!

Bye Marco

N.B.
If I run my program in a DOS window under Win98 all is OK !!!!

- Raw text -


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