Startup Script
/flash/config/autorun.ini & /flash/config/autorun-dbg.ini
After system initialization, similar to DOS
AUTOEXEC.BAT, the user program starts from the shell script file:
/flash/config/autorun.in – normal startup script
/flash/config/autorun-dbg.ini – debug mode startup script
The typical contents look like:
etmd& program1 arg1
arg2 & program2 arg1
arg2 & |
This script can be modified with text
editor and updated via FTP.
Important:
All programs must start in background with "&".
In Unix and Linux, the symbol
"&" after the command, means "run in background". Since
the programs in the script are executed in series, with the "&"
modifier, program2 thus can be executed in parallel with program2.
The script itself is invoked from sys_service which waits the script to finish its job. If
any program in the script is running in foreground, the script will not be
finished, and the system will not start normally.
The program search path has been set to
/bin and /flash/bin. Since user programs are stored in /flash/bin, you don't
need to specify the path explicitly.
#
Ok but unnecessary
/flash/bin/program1 &
#
Ok
program1 &
Select the Startup Script
It is quite often to generate a program by
mistake to make the system hang, especially in uClinux
which does not have MMU to protect system resources. If the malfunctioned program
is started automatically by startup script, the system will repeat the
boot-reset cycles by its internal watchdog. Therefore, users do not have the
chance to remove the program or modify the script.
To solve the problem, instead of running
"autorun.ini", we let sys_service run “autorun-dbg.ini”
if the debug-mode jumper is set (see
1.2 Hardware Setting. With the help of debug mode,
you can easily remove the problematic program or modify the script.