Home    Prev Next    
Contents
Programming For ISA Hardware
Overview
Programmers Guide
Scenario
I/O Ports control
Single read/write operations
Data array read/write operations
Accessing Physical Memory Addresses
Memory Mapping
Additional Functions
Hardware interrupts handling at user level
Common Functions
OpenRapidIsa
CloseRapidIsa
IsRapidIsaOpened
GetHardwareConfiguration
Direct Port I/O
GetPortByte
GetPortWord
GetPortLong
SetPortByte
SetPortWord
SetPortLong
ReadPortBuffer
WritePortBuffer
Memory Access
MapPhysToLinear
UnmapMemory
GetMem
GetMemW
GetMemL
SetMem
SetMemW
SetMemL
Hardware Interrupts
UnmaskIsaIrq
MaskIsaIrq
GetInterruptCounter
Memory Mapping
Go to RapidDriver Main Page

To access specified physical memory address you have to map this physical address to a linear memory of the current process' address space. RapidIsa includes the function MapPhysToLinear, which performs the above task and returns the pointer to the above linear memory defined by it's physical address and size. When the pointer is not needed by application any more, this physical memory area can and must be unmapped with the function UnmapMemory.
The following is an example how to get a pointer to the ROM BIOS area:

char *pBios;  
HANDLE hIsa = NULL;  
hIsa = OpenRapidIsa( 0 );  
if (IsRapidIsaOpened(hIsa))   
{  
 
  pBios = (char*)MapPhysToLinear(hIsa,0xF8000,256); //256 bytes, starting from 0xF8000  
       
  //...pBIOS session...  
 
  UnmapMemory(hIsa, 0xF8000,256); // undo mapping  
  hIsa = CloseRapidIsa(hIsa);     //  close the driver  
}  
else   
  ... // failed