Mail Archives: djgpp/1999/08/12/06:34:59
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 -