delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/12/06:34:59

Message-Id: <199908111517.SAA18161@ankara.Foo.COM>
From: "S. M. Halloran" <mitch AT duzen DOT com DOT tr>
Organization: User RFC 822- and 1123-compliant
To: djgpp AT delorie DOT com
Date: Wed, 11 Aug 1999 19:22:44 +0200
MIME-Version: 1.0
Subject: Re: Accessing memory above an adress of 1MB
In-reply-to: <37AEBCD0.52AE@surfsouth.com>
X-mailer: Pegasus Mail for Win32 (v3.11)
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On 9 Aug 99, Chris Holmes was found to have commented thusly:

> Martin Czamai wrote:
> > I want to access the memory space given from a BAR (base adress
> > register) of a PCI controller. (the adress is dynamic allocated by the
> > system) Therefore I wrote a function that returns the (absolute) adress
> > that has to be accessed. Usually it is around 0xFFFFF000 . I used
> > __djgpp_map_physical_memory (mappedBAR, NoBytes, BaseAdr) for mapping
> > the device to a created memory block named 'mappedBAR'; the number of
> > bytes to map (NoBytes) is a multiple of a mem-page found with
> > __dpmi_get_page_size(&NoBytes)  (4096 bytes) and the base adress
> > (BaseAdr) is equal the absolute address of the BAR. My problem is, that
> > the __djgpp_map_physical_memory (mappedBAR, NoBytes, BaseAdr) returns
> > EACCES as errno, wich is a rejection of the request to the  DPMI server.
> > What does this message exactly mean? Who could help me getting started
> > to access this memory? I am using RHIDE 1.4. Please send your reply to
> > Martin_Czamai AT peak-service DOT com . Thank you!
> 
>   Wow... FFFFF000 is pretty near the 4 gig limit.  Unless you have 
> 4 gig of ram, I think the PCI controller is lying to you.
> 
>   Chris

He does have 4 GB of logical address space, and the page/memory manager can 
organize that address space however it wants to in virtual or physical memory.  
The whole amount of memory doesn't have to exist physically or even virtually, 
just so long as the memory management system knows how much physical and 
virtual RAM it has and how and when it wants to organize the addresses of its 
pages.  I think whatever passes for memory management in MS' W9x actually puts 
sys code starting at 0x0000000, and app code, data, and stack somewhere above 
0x40000000 (?).  It doesn't mean that the machine has at least 1 GB physical or 
virtual RAM, and that those addresses translate into *physical* addresses.
I don't think it's impossible for the manager to map certain parts of (locked)  
linear memory to the physical memory addresses that correspond to doing I/O 
with hardware, for the benefit of the application.

I know I'll be corrected if I am wrong.



Mitch Halloran
Research (Bio)chemist
Duzen Laboratories Group
Ankara       TURKEY

- Raw text -


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