> Is there some doc available addressing the problem of
> accessing this above-linux area and using it in both user / kernel space?


To use/access a set-aside region above linux, I put the following in the
linux lilo.conf file:

image=/boot/rtl3.0-2.2.18
        append="mem=252M"
        label=rtl2218
        read-only
        root=/dev/hda2


Then you run lilo, and reboot.  In a linux user program you then 
to set some pointer variables to the physical and virtual above-linux
area.  For example:

  if ((fd = open("/dev/mem", O_RDWR)) < 0) {
    perror("main() opening /dev/mem");
    return -1;
  }

// Establish a pointer to the reserved memory above linux
  pram_above_linux = (void *) (LINUX_MEGS * MEGABYTE);
  vram_above_linux = (void *) ((UI32) mmap(0,
                                   (4 * MEGABYTE),
                                   PROT_WRITE | PROT_READ,
                                   MAP_SHARED | MAP_FILE,
                                   fd,
                                   (unsigned int) (pram_above_linux)));




The address space needs to begin on a page boundary.  If it doesn't your
user-space program will core dump.  I use the following code to insure a
page boundary:

// compute pbar0 4096 boundry
  pb = (void *) ((unsigned int) digitizer[dig].pbar0 & 0xfffff000);
// determine the offset from the 4096 boundry
  off = (int) digitizer[dig].pbar0 - (int) pb;
  digitizer[dig].vbar0 = (void *) ((UI32) mmap(0, 4096, PROT_WRITE |
     PROT_READ, MAP_SHARED | MAP_FILE, fd, (unsigned int) pb) + off);


To work with the PCI dma, you will need both physical and virtual pointers
in your code.  Us the victuals to access variables programatically, and
the the physical pointers for dma.

-Wayne

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to