Per-task file descriptors and eventually a "real" shell

Isaac Gutekunst isaac.gutekunst at vecna.com
Fri Oct 2 20:24:34 UTC 2015


Hey,

I've been trying to figure out whether RTEMS would support a real shell with IO redirection, 
signals (at least Ctrl-C), and launching of "processes".

Processes can simply be functions added to a table, like the current shell, or loaded using the 
run-time linker.

What seems to be lacking (or maybe I'm wrong), is per task file descriptors. In order to do IO 
redirection, you would want to spawn a task and open and close file descriptors for IO 
redirection. Since RTEMS does not support multiple addresses spaces, and therefore fork(), the 
traditional fork() method would not work.

Perhaps, there could be a new variant of rtems_task_create or rtems_task_start that provides 
alternative file descriptors for stdin, stdout, and stderr.

The task creation process would close stdout and stderr for the task, and then dup2 the passed 
in file descriptors performing the IO redirection.

The hack would be that file descriptors 0,1 and 2 are not part of a global namespace of file 
descriptors, and potentially refer to different actual IO devices on a per task basis.

The motivation here would be creating a more functional shell and support easy IO redirection 
for logging, and running multiple shell instances, perhaps via multiple telnet and serial 
sessions.

Thoughts?

Isaac
-- 
Isaac Gutekunst
Embedded Systems Software Engineer
isaac.gutekunst at vecna.com
www.vecna.com

Cambridge Research Laboratory
Vecna Technologies, Inc.
36 Cambridge Park Drive
Cambridge, MA 02140
Office: (617) 864-0636 x3069
Fax: (617) 864-0638
http://vecna.com

Better Technology, Better World (TM)


More information about the devel mailing list