Hi,

I had a play with the MirBSD KORN Shell (https://www.mirbsd.org/main.htm) on RTEMS and have something running. The source is here:

http://www.rtems.org/ftp/pub/rtems/people/chrisj/mksh/mksh-R50-rtems.tar.xz

It is a waf build so using something like:

$ waf configure \
     --rtems-tools=$HOME/development/rtems/4.11 \
     --rtems=$HOME/development/rtems/bsps/4.11 \
     --rtems-bsp=sparc/sis
$ waf

with a git 4.11 RTEMS kernel built and installed should work. A run on the sparc/sis bsp is:

$ sparc-rtems4.11-run build/sparc-rtems4.11-sis/sh.exe
/bin/sh: No controlling tty: open /dev/tty: No such file or directory
# echo $KSH_VERSION
@(#)MIRBSD KSH R50 2014/06/29
# task
  ID       NAME      PRI  STATE MODES   EVENTS    WAITID  WAITARG  NOTES
-------------------------------------------------------------------------
0a010001   UI1         1 READY  P:T:nA    NONE
# ^D

I have hacked the code so the RTEMS shell commands are builtins. Not everything works, eg ls seems to end up in a heap corruption, and pipes need help from us, eg:

$ sparc-rtems4.11-run build/sparc-rtems4.11-sis/sh.exe
/bin/sh: No controlling tty: open /dev/tty: No such file or directory
# arrname[1]=4
# print ${arraname[1]}

# print ${arrname[*]}
4
# print ${#arrname[*]}
1
# x=$(echo "Me")
/bin/sh: can't create pipe - try again

The shell might be usable in RTEMS but it would need to work to clean up the global symbols and global data to it can be RTEMS multi-user and multi-threaded. Having it would give us a nice way to provide proven shell scripting.

Chris
_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to