Hi,

I am experiencing some problems with shared memory.

Since now out application runs on a PC104 Pentium Based hardware, and the
devlepment tools run on a different PC (pentium mmx).
As internela request I have been asked to have the application running on a
lower cost platform. This is why I am testing it on a 386 PC104 and an
AMD486 PC platform both equipped with 16M.

The RT task are running perfeclty but when I am trying to use and access
shared mem the module is not running. Actually it prompts an error and the
module is not inizialized and not running.

I was aware of the limit of the shared mem pool that is 1M for the non
Pentium class machine but the shared mem I am using is just 1M.

The following is the code I am trying to run.


#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/version.h>
#include <linux/cons.h>
#include <asm/io.h>

#include <rtl_sched.h>
#include "common.h"

#define BASE_ADDRESS (15 * 0x100000)

typedef struct
{
  long InUseFlag;
  long valueone;
} STRUCTTEST;

STRUCTTEST *sptr;

RT_TASK mytask;
RTIME interval;

long counter;
long missedaccess;


void xmainloop(int t) {
 while(1)
   {
     counter++;
     /*printk("Loop n:%ld\n", counter);*/
     if (sptr->InUseFlag != 0)
       {
  /* the shared mem has been accesed by some other process
     maybe we can increment a deferral counter so that we
     can make a delay statistics */
  printk ("Missed access.\n");
  missedaccess++;
       }
     else
       {
         missedaccess = 0;
         sptr->valueone = counter;
       }
     rt_task_wait();
   }
}


int init_module(void)
{
 RTIME now = rt_get_time();
 interval = (RT_TICKS_PER_SEC/100);
 sptr = (STRUCTTEST *) BASE_ADDRESS;
  sptr->InUseFlag = 0;

 rt_task_init(&mytask, xmainloop, 0xffff, 3000, 4);
 rt_task_make_periodic(&mytask, now + 1000, interval);
 return 0;
}


void cleanup_module(void)
{
 rt_task_delete(&mytask);
}

I hope someone could give me some advise.

Ciao
Giovanni


-- [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