Help in setting up a RAM Disk

Peter Dufault dufault at hda.com
Tue Mar 8 08:16:58 UTC 2011


On Mar 7, 2011, at 11:38 , Chris Johns wrote:

> Yes. One minor correction. From 4.10 you should be able to have 'main' 
> as an entry point.

Yes, and this will be a great help for me to setup an environment for beginners.  In one of my libraries I put a default init.c that sets up an RTEMS shell with basic commands and installs a call to "main()" for the command "main".  Then one can use e.g. the basic Lua Makefile and genererate a "lua" one can download:

[dufault at finny12 src]$ file /opt/rtems-4.11/powerpc-rtems4.11/phycore_mpc5554/bin/lua
/opt/rtems-4.11/powerpc-rtems4.11/phycore_mpc5554/bin/lua: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), statically linked, with unknown capability 0x41000000 = 0x13676e75, with unknown capability 0x10000 = 0xb0402, not stripped
[dufault at finny12 src]$ 

There are two problems -

1. The linker finds an init in one of the RTEMS libraries, so I use something like "-u force_load_my_main" in my Makefile and put:
- extern int force_load_my_main;
- int force_load_my_main;
in my init.c to be sure I get the one I want;

2. The main function is called with echo off and a record separator of newline, and no known way of entering a ^D/EOF to terminate the program.  Here's the results of entering 'print("where is my echo")<LF>' at the console to Lua, followed by ^D <LF>:

SMC91111 : driver has been attached
Device: /dev/pty0../dev/pty7 (8)pseudo-terminals registered.
telnetd started with stacksize = 8192 and priority = 100
RTEMS-RPCIOD $Release$, Till Straumann, Stanford/SLAC/SSRL 2002, See LICENSE file for licensing info.
RTEMS-NFS $Release$, Till Straumann, Stanford/SLAC/SSRL 2002, See LICENSE file for licensing info.
RTEMS SHELL (Ver.1.0-FRC):/dev/console. Mar  6 2011. 'help' to list commands.
[/] # help main
main         - Run the "main program".
[/] # main
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> where is my echo
> stdin:1: unexpected symbol near 'char(4)'                                                                                                                                                                                                
> 

The same issue exists with telnet, though at least then you can shutdown the shell and Lua gets the EOF.

Shall I enter those items as a bug report to be examined and/or ignored as appropriate?

Peter
-----------------
Peter Dufault
HD Associates, Inc.      Software and System Engineering





More information about the users mailing list