Re: Application starting from boot-up
- From: Juergen Beisert <jbeisert@xxxxxxxxxxxx>
- Date: Fri, 18 Jan 2008 18:06:46 +0100
Robert Scott wrote:
So far I have been testing my application on this Embest ARM board by
starting it up from the Shell port. (Linux comes pre-installed on this
board.) Today I tried to make it start automatically on boot-up, and it
worked, but I'm
not sure I'm doing it the right way. Here is what I did:
There is a start-up script in /etc/init.d/rcS. I edited that start-up
include an invocation of my application. As a test, I included within the
application an initial call to printf:
printf("\r\nWe are starting up\r\n");
When the application is started manually, this message appears on the
port, which is the main serial port on the board. But when my application
is started from /etc/init.d/rcS script, then this message does not appear.
This is an inconvenience, because I have several startup error messages
that might be generated from my application if certain inits fail. These
messages will not be very useful if they never appear.
The second problem is of more concern to me. I don't know how to
interrupt the boot process in case my application bombs. And even if it
doesn't bomb, and I want to copy in an update (using the cp command from a
flash memory stick), I can't do it while the program is running because
the executable is busy.
I was able to issue a killall Shell command for my application and stop it
so I could unlock the executable for updating. So I can make do. But I
wonder if this is the usual recommended way to develop an application for
a system that has Linux pre-installed and where I do not want to make any
changes to the underlying pre-installed system.
That is why the scripts in /etc/init.d are understanding parameters. So rcS
will start the other scrips with parameter "start" and you can stop
them "/etc/init.d/myjob stop"
Other way would be (if "/bin/exec" is your currently running program):
$ mv -f /bin/saved_excec
$ mv /bin/exec /bin/saved_excec
$ mv updated/exec /bin/exec
- Prev by Date: Re: Arm Interrupt Controller
- Next by Date: Re: Application starting from boot-up
- Previous by thread: Arm Interrupt Controller
- Next by thread: Re: Application starting from boot-up