关于自启动程序的问题

请教Mr xtang,comquter等高手一个关于自启动程序的问题:
看过这里的帖子,讨论自起动程序的放置和运行。可是如果在image里将可执行程序列入,是不是起到相同的效果呢?
最近看了很多关于image 的帖子,觉得很少有人把自己编的可执行程序放到image里,请问是不是这么做有很大的缺点呢?
我的server程序自起动后还要spawn 一个client程序,那么是不是只把可执行的server 程序放到image 的script里面就行了,而不需放入client的程序名?
问题很愚,感谢你们的指点和帮助!!!

在image里放可执行程序很正常,没有什么大的问题.只是有的板子对image的大小有限制,可执行程序放得太多影响启动速度。

你的情况,client也必须包含在image中,否则spawn()会找不到那个client。

典型的做法是在image里通过某种方式启动一个脚本,在脚本里启动自己的程序。

今天才有时间来网上之家看看
谢谢MR xtang & wsforever先!!

这几天多看了看,搞懂一些如何做image, 问题也出来了,谢谢你们的继续帮助:
1。 看了tech article 说: Specifying the “PATH” and “LD_LIBRARY_PATH” variables makes every spawned process inherit them. 可是在6.21 IDE环境下如何自行指定呢? 我import bios.ide.ifs做蓝本,找遍各处也无法修改path…

  1. 这是我的srartup script (基本是X86的bios.ide.ifs,改了一点)

Start up some consoles

devc-con -n1 &
reopen /dev/con1

display_msg Welcome to Neutrino on an PC compatible BIOS system

Start the pci server

display_msg "start sedres pci-bios "
seedres
pci-bios &
waitfor /dev/pci

Disk drivers (The default one and some fun others for your pleasure…)

display_msg “auto mount hd0t77”
devb-eide blk automount=hd0t77:/,automount=hd0t79:/usr/qnx6 &

devb-eide blk automount=hd0t79:/,cache=2m,delwri=5 &

Wait for a bin for the rest of the commands (up to 60 secs)

display_msg “waitfor /UAV”
waitfor /UAV 200

Some common servers

display_msg “some drivers strats”
pipe &
mqueue &
devc-ser8250 &
devc-pty &

Start a debug server for debugging programs

waitfor /dev/ser1
[+session] pdebug /dev/ser1 &
display_msg “after pdebug”

These env variables inherited by all the programs which follow

SYSNAME=nto
TERM=qansi

Start some extra shells on other consoles

reopen /dev/con2

[+session] sh &

reopen /dev/con3

[+session] sh &

Start a high priority shell just in case…

reopen /dev/con4

[pri=25 +session] sh &

Start the main shell

#reopen /dev/con1
display_msg “start main shell”
[+session] sh &

#[+session] login -p

不明白为什么在最后总会出现:

sh:j_init: tcgetpgrp() failed: Imappropriate I/O control operation
sh:warning: wont have full job control
请问怎么办呢?

3。 能否提几句思路:如何实现: host发出特定遗传字符串,一个循环运行的接到后退出,并自动关机

谢谢你们的热心帮助

1、[+compress]
[virtual=x86,bios] .bootstrap = {
startup-bios -NTargetName
PATH=/proc/boot:/bin:/sbin:/usr/bin:/usr/sbin:/usr/photon/bin LD_LIBRARY_PATH=/proc/boot:/dev/shmem:/lib:/lib/dll:/usr/lib:/usr/lib/dll procnto
}
[+script] .script = {

Start up some consoles


2、我也遇到了,但不影响我们系统的功能就没在意。不明白为什么。
3、可以利用消息传递实现。比如在接受消息的进程里:
while(1)
{
// Receive the message
iReceiveIdentifier = MsgReceive(g_naHmiAttach->chid, &mmMessage, sizeof(PROC_MESSAGE), NULL);
// Send the reply
if(MsgReply(iReceiveIdentifier, 1, &mmMessage, sizeof(PROC_MESSAGE)) == -1)
{
fprintf(stdout,“Error sending reply: %s\n”, strerror(errno));

}
// Check if the message was valid
if(iReceiveIdentifier != -1)
{

switch(mmMessage.iMsgType)
{
case Type1: //

break;
case Type2: //

break;

case SHUTDOWN: // 关机

break;

default:
break;
}
}