clear command + build file

Hello,

when I type the ‘clear’ command in my terminal window after booting from the CF disk … i get the following message
‘qansi’: unkown terminal type

Also i get this message on bootup

Unable to access “/x86/bin” (2)
Path=0 - Intel 82371AB
target=0 lun=0 Direct-Access(0)- SanDisk SDCFB-12 Rev: dV g
sh: j_init: tcgetpgrp() failed: Inappropriate I/O control operation
sh: warning: won’t have full job control

I am attaching my “build” file so you could help me and tell me what I am doing wrong.

I would really appreciate your help.

ashu

###########################################################################
#
# Neutrino on an PC BIOS compatible system
#
# Note that the default image links at 4M. If you have 4M or less,
# uncomment the line below
# [image=1m]
#
###########################################################################

[virtual=x86,bios +compress] boot = {
	startup-bios -Nmachine-name
	PATH=/proc/boot:/x86/bin LD_LIBRARY_PATH=/proc/boot:/dev/shmem:/x86/lib:/x86/dll procnto
}

[+script] startup-script = {
# Start up some consoles
	devc-con -n4 &
	reopen /dev/con1

	display_msg " "
	display_msg "Welcome to QNX Neutrino for GCTS based Control Systems" 
	display_msg "Image Created by Ashu"
	
# Start the pci server
	seedres	
	pci-bios &
	waitfor /dev/pci

#  Network drivers and filesystems
	io-net -drtl -pttcpip if=en0:169.254.5.3 &
	waitfor /dev/socket
# Wait for a bin for the rest of the commands
	waitfor /x86/bin

# Some common servers
	pipe &
	devc-ser8250 &
	devc-pty &
	devb-eide &

# Start a debug server for debugging programs
	waitfor /dev/ser1
	[+session] pdebug /dev/ser1 &

# Mount filesystem and cdrom
# Uncomment the following lines to mount hd0 and cd0 automatically
#	waitfor /dev/hd0
#	mount -tqnx4 /dev/hd0t79 /hd
#	waitfor /dev/cd0
#	mount -tcd /dev/cd0 /cd

# 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
	[+session] sh
	
# Start the program
    cd /proc
#   cd boot    
#  ./r 
    
#
#/bin ->hd1t77/bin    
#/sbin ->hd1t77/sbin
#/etc ->hd1t77/etc
#/lib ->hd1t77/lib
#/opt ->hd1t77/opt
#/tmp ->hd1t77/tmp
	
}

# Cheat and make the /temp point to the shared memory area...
[type=link] /tmp=/dev/shmem

# Programs require the runtime linker (ldqnx.so) to be at a fixed location
[type=link] /usr/lib/ldqnx.so.2=/proc/boot/libc.so

# We use the "c" shared lib (which also contains the runtime linker)
#libc.so
libcpp.so.2a
libm.so.2
libc.so.2
libsocket.so.2


# Just incase someone needs floating point...
fpemu.so.2

# Include filesystem libs
libcam.so.2
cam-disk.so
cam-cdrom.so
io-blk.so
fs-qnx4.so
fs-cd.so

# Include the socket library
libsocket.so

# Include the network files so we can access files across the net
devn-rtl.so
npm-ttcpip.so

# The files above this line can be shared by mutiple processes
[data=c]
# Executables must currently be below this line

# Include a console driver
devc-con

# Include the network executables.
io-net

# Other binaries
pci-bios
seedres
devc-ser8250
devc-pty
devb-eide
pipe
sh
#qconn ?
pdebug
cat
ls
pidin
ping
mount
clear
ifconfig
/usr/bin/clear
/sbin/fdisk
/bin/dfloppy
/root/Apurva/interrupts/r
/boot/build/hello
/boot/build/hello2

#Explicitly specifying destination and source
/x86/usr/bin/clear

Why the waitfor /x86/bin - there’s no chance it be available?
Also, the qansi message is because you don’t have /usr/lib/terminfo/q/qansi (it needs to be in that location)
I’m not sure why you are getting the ksh message - you appear to be starting thing in their own sessions.

  1. How would I do that ??

2.) How would I make it run a program of my choice as soon as the Image is loaded ? [say a Hello World Program or anything]

Thanks

I have seen this shell error before, but I forget :blush: what the exact cause was. I think that it was something to do with the ksh having only read-only filesystems available to it…

With the terminal stuff, we also add (but you might be able to get away without it?) /usr/lib/terminfo/terminfo.src

(Just add the file in that location to your image, but it MUST go in that exact location, as must the actual terminal definitions like /usr/lib/terminfo/q/qansi as cburgess noted)

To start a process you can either start it outside of a shell by simply putting the command into the script part of the build file, or pass the command onto sh using its command line options, or use a script with a #!/bin/sh or equivalent in the top of it in the script part of the build to invoke a shell and execute the other commands it contains. (We use the third option three times in the boot script to start: basic services (network etc… - allowing us to reconfigure the system without rebuilding the image as the script lives on the CF card in a secondary partition), background managers (device drivers etc) on a dedicated console, and finally, the programs we want to run in the “foreground” console)

tahnks for the information.

If you look at my build file

...
...
# Start the main shell 
   reopen /dev/con1 
   [+session] sh 
    
# Start the program 
    cd /proc 
#   cd boot    
#  ./r 
....    

I tried to atleast go inside the proc directory if not be able to run my program “r” … thats why commented it.

But it still does not go inside that directory when a terminal shell starts up.

However I once tried to have a “ls” command instead of “cd /proc”. This also did not work when the shell started. However, when I did a CTRL+D or EXIT then i could see a listing of the files.

I would need some more help. Sorry if my questions are really dumb. I really apprecaite all your help.

Thanks
ashu