Help: Creation of RTEMS Message Queue hangs up computer

Alex kbyte at iol.pt
Tue Dec 21 21:46:37 UTC 2004


Hi,
I am trying to use posix message queues in RTEMS. I have a little program that only creates a message queue, nothing else. But when the mq_open() posix function is executed all the system blocks forever. I already “debug” the kernel and what I saw was the _RTEMS_Lock_allocator() function, in regiongetsegment.c file, which blocks forever but I can't see why...

ENV: pc686, mandrake linux 9.2, rtems 4.6, i686 bsp

Could you help me please?
Any advices?

By the way, why do we need regions in rtems? Which is the main aim of regions? In rtems the memeory is completly flat isn't it? So, why regions?

Many thanks,

Alex
(RTEMS Beginner)


This is my little rtems posix program:

#define CONFIGURE_INIT
#include <rtems.h>
#include <bsp.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h> 
#include <limits.h>
#include <unistd.h>  
#include <errno.h>
#include <sched.h> 
#include <sched.h>
#include <fcntl.h>
#include <time.h>  
#include <signal.h>
#include <mqueue.h>
#include <rtems/posix/mqueue.h>
#include <rtems/posix/time.h>
#define CONFIGURE_INIT_TASK_ENTRY_POINT   POSIX_Init

void *POSIX_Init(void *argument)
{
mqd_t               mq;

puts( "\n\n-- POSIX MESSAGE QUEUE --" );
//CREATING / OPENING MESSAGE QUEUE
mq = mq_open("Q_Write", O_CREAT | O_RDWR, 0x777,NULL);
if(mq==-1)
{
         printf("\nError opening message queue Q_Write...");
         exit(0);
}
else
{
         printf("\nQueue Q_Write successfully opened...");
}

   puts( "-- END OF POSIX MESSAGE QUEUE PROGRAM --");
   exit(0);
}

#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
#define CONFIGURE_MAXIMUM_POSIX_THREADS               2
#define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES  10
#define CONFIGURE_MAXIMUM_POSIX_TIMERS                   4
#define CONFIGURE_MAXIMUM_POSIX_MUTEXES              20
#define CONFIGURE_MAXIMUM_REGIONS                    4
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
#define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE  (RTEMS_MINIMUM_STACK_SIZE * 4)
#define CONFIGURE_EXTRA_TASK_STACKS  (5 * RTEMS_MINIMUM_STACK_SIZE)
#include <confdefs.h>
 


________________________________________________________________________________
Finalmente uma Caixa de Correio com todos os Extras: 21 MB + Anti-vírus + Filtro de
mensagens indesejadas + Attachs 7MB + Bloqueador IOL + Conteúdos IOL + Ícones dinâmicos…
Crie aqui a sua: http://www.iol.pt/correio/rodape.php?dst=0411151




More information about the users mailing list