0 Replies Latest reply on May 25, 2009 6:28 AM by 807557

    UnsupportedPhysicalMemoryException whenPhysicalMemoryManager.IO_PAGEis used

      I'm trying to read PCI configuration memory and when instance of RawMemoryAccess is created, UnsupportedPhysicalMemoryException is thrown for below java code:

      public class pcix extends RealtimeThread {

           public void start() {
                Object ioPage = PhysicalMemoryManager.IO_PAGE;
                memoryAccess = new RawMemoryAccess(ioPage, 0x0CF8, 4096);
           public static void main(String[] args) {
                new pcix().start();

      Used envioroment:
      Ubuntu 8.04 with kernel 2.6.24-23-rt SMP PREEMPT RT
      Installed evaluation SUN's Java RTS 2.1_fcs
      Java application was started with user "rt" belongs on realtime group with following permission in /etc/security/limits.conf:
      @realtime soft cpu unlimited
      @realtime - rtprio 100
      @realtime - nice 40
      @realtime - memlock unlimited

      As alternative I used native C application to start my test java application as root with I/O port access permissions :

      #include <stdio.h>
      #include <stdlib.h>
      #include <unistd.h>

      #include <sys/types.h>
      #include <sys/stat.h>
      #include <sys/io.h>

      int main(int argc, const char* argv[])
      setuid( 0 );
      int perm = iopl(3);
      if (perm == 0){
      char *newargv[] = { " -cp./ ", "pcix", NULL };
      char *newenviron[] = { NULL };

      execve("/usr/lib/jvm/jrts/jrts2.1/jre/bin/java", newargv, newenviron );

      printf("iopl = %d\n",perm);
      return 0;

      The same I/O port address for PCI bus are accessible with standard low-level outl/inl functions.

      Any idea what can be wrong?