cant create network daemon 'ntwk': 'too many'

Mirko Markov mmarkov at dkts.co.yu
Mon Feb 25 07:27:45 UTC 2002


Vivek Vaid wrote:
> 
> Hi,
> 
> I am trying to run networking (simple echo server) with posix threads.
> 
> I have 2 posix threads. 1 thread will take care of some hardware i/o and
> print values on console & the other one will take care of the network
> link. (if the otherside makes a telnet connection, this thread will send
> the values to that machine).
> 
> I have been able to get the networking running based on netdemo, and
> i have also been able to get the posix threads working.
> but these two applications were seperate.
> 
> I get the following error when i combined the two:
> 
> "cant create network daemon 'ntwk': 'too many' "
> RTEMS: fatal error, exiting
> 
> I get this error when i call
>   rtems_bsdnet_initialize_network ();
>   rtems_bsdnet_show_inet_routes ();
> for the First time from a posix thread
> 
> does the network daemon run as an rtems task ? but i have combined the 2
> initializations as follows: (based on system.h in posix samples )
> 
> /* configuration information */
> #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
> #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
> 
> #define CONFIGURE_MAXIMUM_POSIX_THREADS              2
> #define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES  1
> #define CONFIGURE_MAXIMUM_POSIX_MUTEXES              2
> #define CONFIGURE_POSIX_INIT_THREAD_TABLE
> #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 20
> #include <confdefs.h>
> #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
> #define CONFIGURE_EXECUTIVE_RAM_SIZE    (512*1024)
> #define CONFIGURE_MAXIMUM_SEMAPHORES    20
> #define CONFIGURE_MAXIMUM_TASKS         20
> #define CONFIGURE_MICROSECONDS_PER_TICK 10000
> #define CONFIGURE_INIT_TASK_STACK_SIZE  (10*1024)
> #define CONFIGURE_INIT_TASK_PRIORITY    120
> #define CONFIGURE_INIT_TASK_INITIAL_MODES (RTEMS_PREEMPT | \
>                                            RTEMS_NO_TIMESLICE | \
>                                            RTEMS_NO_ASR | \
>                                            RTEMS_INTERRUPT_LEVEL(0))
> 
> I have not started or initialized any rtems_tasks, but only posix tasks.
> 
> Sincerely
> Vivek

First of all, be sure that you define all the macros before you include
confdefs.h, or else you will
use defaults (for example RAM_SIZE, MAXIMUM_SEMAPHORES etc in your
example are not used).

The message you are getting tells that the network subsystem can't
create task 'ntwk' 
(network daemon). In RTEMS 4.5.0 it is done in file rtems_glue.c.

	sc = rtems_task_create (rtems_build_name(nm[0], nm[1], nm[2], nm[3]),
		networkDaemonPriority,
		stacksize,
	
RTEMS_PREEMPT|RTEMS_NO_TIMESLICE|RTEMS_NO_ASR|RTEMS_INTERRUPT_LEVEL(0),
		RTEMS_NO_FLOATING_POINT|RTEMS_LOCAL,
		&tid);
	if (sc != RTEMS_SUCCESSFUL)
		rtems_panic ("Can't create network daemon `%s': `%s'\n", name,
rtems_status_text (sc));

I guess that you have low default number of tasks. Try to move #include
<confdefs.h> line at the very end 
of the file, and to increase maximum number of tasks.



More information about the users mailing list