Bug? Initializing rtems "rtems_pty_maximum_ptys" ? (v4.8.0)

Chris Johns chrisj at rtems.org
Tue Sep 16 00:03:22 UTC 2008


Joel Sherrill wrote:
> It can now process scripts (no conditional logic yet).

The ability to run scripts is a powerful system level feature for RTEMS. The 
scripts are called "joel" files. Just like a shell script in a Unix box you 
add to start of a text file the line:

   #! joel
   #
   # Mount the various file systems
   #
   mkdir /net
   mount -t nfs server:/opt/work /net
   mkdir /fd
   mount -t msdos /dev/flashdisk0 /fd
   msdosfmt /dev/ramdisk0
   mkdir /rd
   mount -t msdos /dev/randisk0 /rd

You can pass various options to the script. For example '-v' as:

   #! joel -v
   #

This will print the commands in the script as they are executed. The shell 
will check a file to see if the joel line is present and run it.

You can add code to your application to run a script at initialisation time. 
The code is something like:

void
shell_init_script ()
{
   rtems_status_code sc;
   printf ("Running /shell-init....\n\n");
   sc = rtems_shell_script ("fstst", 10 * 1024, 160, "/shell-init", "stdout",
                            0, 1, 1);
   if (sc != RTEMS_SUCCESSFUL)
     printf ("error: running shell script: %s (%d)\n",
             rtems_status_text (sc), sc);
}

I embed the script into the program and place in the IMFS to do this. See:

http://www.rtems.org/ftp/pub/rtems/people/chrisj/file-system/filesystem-test-20080729.tar.gz

for an example program that does this.

Regards
Chris



More information about the users mailing list