Boot Image--Permission denied

I make a boot image. It can boot normal on X86 machine.
and I write a program , it can run normal on the QNX host.
But I want the program run on the Boot Image on the x86 machine.
Follow is my image:

[virtual=x86,bios +compress] .bootstrap = {

startup-bios -Nnode120 -vvvv -D8250..115200 -K8250..115200
PATH=/proc/boot procnto -smp

}

[+script] startup-script = {

 display_msg "Welcome to QNX Neutrino on an PC compatible BIOS system for SMP"

 #serial prot driver
devc-ser8250 -e -b115200 & 
waitfor /dev/ser1
 reopen /dev/ser1
 
 display_msg " Open serial port " 

# Start 1 keyboard console
devc-con -n4 &
# Start serial A driver
waitfor /dev/con1
reopen /dev/con1

seedres 
pci-bios &
waitfor /dev/pci
pipe
syslogd
slogger
# scan IDE machine
[b]devb-eide 
waitfor /dev/hd0
mount /dev/hd0 /[/b]
devc-pty &
/USB driver*/

display_msg “Start USB driver…”
io-usb -duhci -dohci -dehci
waitfor /dev/io-usb/io-usb 4

 reopen /dev/con2 
[+session] esh & 
reopen /dev/con3 
[+session] esh & 

 reopen /dev/ser1 
[+session] esh & 

 waitfor /dev/con1
reopen /dev/con1
[+session] esh &

display_msg " Startup"

}

Make /tmp point to the shared memory area…

[type=link] /tmp=/dev/shmem

[type=link] /dev/console = /dev/ser1

Programs require the runtime linker (ldqnx.so) to be at

a fixed location

[type=link] /usr/lib/ldqnx.so.2=/proc/boot/libc.so
[type=link] /bin/sh=/bin/esh

We use the “c” shared lib (which also contains the

runtime linker)

libc.so
libm.so
libsocket.so
npm-tcpip.so
npm-tcpip-v4.so
libcpp.so.3
#D-link net card LIB
devn-via-rhine.so

#RTL net card LIB
devn-rtl.so

devn-i82544.so
devn-speedo.so
io-blk.so
fs-qnx4.so
fs-dos.so
cam-disk.so
libcam.so

#####/uncomment for USB driver/
libusbdi.so
devu-uhci.so
devu-ohci.so
devu-ehci.so
devn-asix.so
######/end USB driver/

The files above this line can be shared by multiple

processes

[data=c]
devc-con
devc-ser8250
devc-pty
pci-bios
seedres
mqueue
pipe
io-net
echo
stty
#/dev/socket=/dev/socket
cat
tail
pci
#chat
ifconfig
ping
syslogd
#touch
slogger
ls
qconn
pidin
pdebug
slay
mount
devb-eide
ftp
inetd
shutdown
sin
use
esh
mount
umount
sloginfo
telnet
mkdir
rm
cp
#####/USB/
io-usb
usb
devb-umass
#####/end USB/

#program_name
/root/program_name=/root/FCS2000/program_name

#Services (telnetd etc) config

/usr/sbin/telnetd=telnetd
/usr/sbin/ftpd=ftpd
/bin/login=login
/bin/sh=esh

/etc/ppp/chap-secrets = {

Client Server Secret Addrs

#########################################

  •       *           "password"  *
    

}
/etc/syslog.conf = {
. /tmp/syslog
. /…/…
}

Inetd config Files

/etc/services= /etc/services
/etc/protocols= /etc/protocols
/etc/termcap= /etc/termcap
/etc/passwd= /etc/passwd
/etc/default/login= /etc/default/login
/etc/resolv.conf= /etc/resolv.conf
/etc/shadow = /etc/shadow

/etc/inetd.conf = {
telnet stream tcp nowait root /usr/sbin/telnetd in.telnetd
ftp stream tcp nowait root /usr/sbin/ftpd in.ftpd
-l
}

/etc/services={
ftp 21/tcp
telnet 23/tcp
}

/etc/ftpusers={

}

/etc/shadow={
root:CDIdxOja3k5lk:1166770462:0:0
}

/etc/passwd={
root::0:0:Superuser:/:/bin/sh
ftp:x:14:80:FTP User:/:
ftplogin:x:0:0::/:/bin/sh
}

I[b] run the program , the error message:

#./program_name
   Permossion denied
  1. I don’t know the message
  2. If I want "mkdir " a path in the /root , How do I make?[/b]
  3. “mkdir” in the “bin” path in the QNX host
    My Boot image “mkdir” in the “/proc/boot” path why?

If My program must run in the path “/root” , and I must create some shmem memories and some io-net , now I have some Q.

  1. I can make path in the “root”
  2. If I have the person lib.so , where is it when I create a boot image?
    I take it for “/root” , can this idea run the lib.so? :question: :exclamation:

PS: My program run normal in the QNX Host now. I munst create a boot image for these programs.

Milk_2000kimo,

  1. If I have the person lib.so , where is it when I create a boot image?
    I take it for “/root” , can this idea run the lib.so

Everything in the boot image is located in /proc/boot (which is a RAM drive).

  1. I can make path in the “root”

I don’t know what question your trying to ask here.

Do you have an actual harddrive/CF card on your target system where /root is located?

Are you really trying to make a directory in shared memory called root and then run your program from that?

The ‘Permission denied’ error you got in your first post sound like you did not set the execute bit on your program.

Tim

Tim:
Thanks your answer! about the 1. question
If My image is
# scan IDE machine
devb-eide
waitfor /dev/hd0
mount /dev/hd0 /

I can make a directory in the " / " but I can’t make a directory in the “/root”

If My image is
# scan IDE machine
devb-eide
waitfor /dev/hd0
mount /dev/hd0 /root

I can make a directory in the " /root " but I can’t make a directory in the “/”

Because I run the “mkdir” the error message is “no such file or directory”,
the "mkdir " file in the “proc/boot”.

Milk_2000kimo,

mount /dev/hd0

This is your problem.

Your trying to mount the raw harddrive. What you want to do is mount the QNX partition:

mount /dev/hd0t79 /

Take a look at the mount command and the examples it shows at the end (esp for mounting a QNX4 filesystem which is what QNX6 also uses)

Tim

Dear Tim :
This solution can’t mount.
The error: can’t accesss “/dev/hd0t79”
Can I do what when I dinit the hd0?
this is my flowchar:

mkifs mybuild.build myifs.ifs
dinit -h -R -f myifs.ifs /dev/hd1
dloader /dev/hd1 /usr/qnx630/target/qnx6/x86/boot/sys/ipl-diskpc2

so my boot image reboot is /dev/hd0 .
I can’t find the /dev/hd0t79, so it can’t access.

Milk_2000kimo,

I don’t understand.

Do you have a hard drive on hd1 or hd0? Those are 2 different hard drive locations. Your flowchart shows hd1. If you really are on hd1, then you have to set the mount to be on hd1, not hd0.

So if your really on hd1 the command is:

mount /dev/hd1t79 /

Also, the t79 part assumes that is the partition type you gave for the QNX partition. t79 is the standard default but you can use t78 for example. If you used t78, then you’d have to change to /dev/hd1t78.

Tim

First of all, there is nothing wrong with not using partition table, you don’t have to partition your media. So, your workflow is correct. I assume you connect you flash drive as hd1 to development host, and reconnect as primary (hd0) on target.

Have you created directory “root” in “/” before making a directory in “/root” ?

Obviously, because all disk space is under “/root” you just mounted hd0 in that way.