bringing up telnetd on embedded sys

Hi All:

I have been trying to bring up a telnetd and ftpd server on a PC a test
platform. I am running RTP 6.1 NC (so that I can play with mkifs) and
booting my image from floppy.

I originally started off with a buildfile example from the deeply
embedded section of the Help file. I have included the modified version
below.

Problem: When I start telnetd (i.e., telnetd -debug -D report) manually
from a shell on the test platform I get the message “going down on
signal 18” from the slog file. I disabled inetd to narrow the problem
down. What am I missing in my buildfile? Any suggestions?

Thanks in advance for the help.

Regards,
–Jeff Strickrott

====== Buildfile

Svr Builfile

Aim: To make a network-enabled debug server using telnet, ftp to

pdebug

Target: x86,bios

[virtual=x86,bios +compress] .bootstrap={
startup-bios -s 64k
PATH=/proc/boot LD_LIBRARY_PATH=/proc/boot:/usr/lib procnto
}

[+script] startup-script = {
display_msg Welcome to QNX on a PC-compatible BIOS system
seedres

display_msg “Starting slogger”
slogger &
waitfor /dev/slog

display_msg “Starting PCI BIOS”
pipe &
pci-bios &
waitfor /dev/pci

put in your actual IP,netmask and gateway

display_msg “Starting Network Driver”
io-net -dne2000 -ptcpip
waitfor /dev/io-net/en0
waitfor /dev/socket

ifconfig en0 192.168.0.200 netmask 255.255.255.0
route add default 192.168.0.1

display_msg “Starting inetd”

inetd &

pdebug needs devc-pty and esh

devc-pty &
waitfor /dev/ttyp0

display_msg “Starting Console”
devc-con -n1 &
reopen /dev/con1
[+session] HOME=/ TERM=qansi-m ksh &

[+session] esh &

}

file links

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

[type=link] /tmp=/dev/shmem # tmp points to shared memory

binary files to include in image

libc.so
libsocket.so
npm-tcpip.so
devn-ne2000.so
pci-bios
seedres

devc-con
io-net
pipe
devc-pty
inetd
ftpd
telnetd
pdebug
# esh
ksh
ping
ls
more
hostname
ifconfig
route
/etc/hosts=/etc/hosts
/etc/termcap=/etc/termcap
/bin/login=/bin/login
/bin/termdef=/bin/termdef
/etc/passwd=/etc/passwd
/etc/group=/etc/group
# /etc/shadow=/etc/shadow
/ect/shells=/etc/shells
slay
ps
telnet
ftp
slogger
sloginfo

# Data files are created in the named  directory.
# /etc/hosts = {
# 127.0.0.1 localhost
# 192.168.0.200 Qdebug
# 192.168.0.1 scrunch
# 192.168.0.25 Q1
#}

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

/etc/inetd.conf = {
ftp     stream    tcp    nowait    root    /bin/fdtpd      fdtpd
telnet  stream    tcp    nowait    root    /bin/telnetd    telnetd
pdebug  stream    tcp    nowait    root    /bin/pdebug     pdebug -
}

/etc/resolv.conf = {
nameserver 131.94.128.2
nameserver 131.94.64.4
}


====== Trace of debug from MS Windows Telent client
td: send do TERMINAL TYPE
td: send do TSPEED
td: send do XDISPLOC
td: send do OLD-ENVIRON
td: ttloop
td: netflush 118 chars
td: ttloop read 6 chars
td: recv will TERMINAL TYPE
td: recv will NAWS
td: send do NAWS
td: ttloop
td: netflush 107 chars
td: ttloop read 9 chars
td: recv wont TSPEED
td: recv wont XDISPLOC
td: recv wont OLD-ENVIRON
td: ttloop
td: netflush 116 chars
td: ttloop read 12 chars
td: recv will NAWS
td: netflush 46 chars
td: recv suboption NAWS 0 80 (8
td: netflush 45 chars
td: ttloop
td: netflush 12 chars
td: ttloop read 10 chars
td: netflush 26 chars
td: recv suboption TERMINAL-TYP
td: ttloop
td: netflush 62 chars
td: ttloop read 11 chars
td: netflush 26 chars
td: recv suboption TERMINAL-TYP
td: ttloop
td: netflush 63 chars
td: ttloop read 10 chars
td: netflush 26 chars

==> the the terminal stops at this point (no login prompt) and will drop
the conection when I hit return.

Connection to host lost.

C:\WINNT\system32>

I suspect the problem is the missing the terminfo files. The
following build file allows you to telnet to the system.

Regards,
Barry F.

[virtual=x86,bios +compress] boot = {
startup-bios
PATH=/proc/boot procnto
}

[+script] startup-script = {

Start up some consoles

devc-con -n4 &
reopen /dev/con1

display_msg Minimal telnet image on a PC compatible BIOS system

Start the pci server

seedres
pci-bios &
waitfor /dev/pci

Start network driver and tcpip

io-net -dne2000 -pttcpip if=en0:10.12.1.44 &
waitfor /dev/io-net

Start inetd

inetd -d &

Some common servers

devc-pty &

\

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
}

Cheat and make the /temp point to the shared memory area…

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

Redirect console messages for syslog

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

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

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

inetd requires telnetd to be at a fixed location

[type=link] /usr/sbin/telnetd=/proc/boot/telnetd

[type=link] /bin=/proc/boot

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

libc.so

Other libs

npm-ttcpip.so
devn-el900.so
libsocket.so.2

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 pci server

pci-bios
seedres

Use the “public domain korn shell” as the default shell “sh”

sh=ksh

Include files for telnet capability

/etc/passwd = /etc/passwd
/etc/shadow = /etc/shadow
/etc/services = /etc/services
/etc/inetd.conf = /etc/inetd.conf
/usr/lib/terminfo = /usr/lib/terminfo

Other executables

devc-pty
ls
cat
pidin
io-net
inetd
ping
telnetd
telnet
login



Jeff Strickrott <jstric01@cs.fiu.edu> wrote in message
news:3F451FE1.E5A0BE8C@cs.fiu.edu

Hi All:

I have been trying to bring up a telnetd and ftpd server on a PC a test
platform. I am running RTP 6.1 NC (so that I can play with mkifs) and
booting my image from floppy.

I originally started off with a buildfile example from the deeply
embedded section of the Help file. I have included the modified version
below.

Problem: When I start telnetd (i.e., telnetd -debug -D report) manually
from a shell on the test platform I get the message “going down on
signal 18” from the slog file. I disabled inetd to narrow the problem
down. What am I missing in my buildfile? Any suggestions?

Thanks in advance for the help.

Regards,
–Jeff Strickrott

====== Buildfile

Svr Builfile

Aim: To make a network-enabled debug server using telnet, ftp to

pdebug

Target: x86,bios

[virtual=x86,bios +compress] .bootstrap={
startup-bios -s 64k
PATH=/proc/boot LD_LIBRARY_PATH=/proc/boot:/usr/lib procnto
}

[+script] startup-script = {
display_msg Welcome to QNX on a PC-compatible BIOS system
seedres

display_msg “Starting slogger”
slogger &
waitfor /dev/slog

display_msg “Starting PCI BIOS”
pipe &
pci-bios &
waitfor /dev/pci

put in your actual IP,netmask and gateway

display_msg “Starting Network Driver”
io-net -dne2000 -ptcpip
waitfor /dev/io-net/en0
waitfor /dev/socket

ifconfig en0 192.168.0.200 netmask 255.255.255.0
route add default 192.168.0.1

display_msg “Starting inetd”

inetd &

pdebug needs devc-pty and esh

devc-pty &
waitfor /dev/ttyp0

display_msg “Starting Console”
devc-con -n1 &
reopen /dev/con1
[+session] HOME=/ TERM=qansi-m ksh &

[+session] esh &

}

file links

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

[type=link] /tmp=/dev/shmem # tmp points to shared memory

binary files to include in image

libc.so
libsocket.so
npm-tcpip.so
devn-ne2000.so
pci-bios
seedres

devc-con
io-net
pipe
devc-pty
inetd
ftpd
telnetd
pdebug

esh

ksh
ping
ls
more
hostname
ifconfig
route
/etc/hosts=/etc/hosts
/etc/termcap=/etc/termcap
/bin/login=/bin/login
/bin/termdef=/bin/termdef
/etc/passwd=/etc/passwd
/etc/group=/etc/group

/etc/shadow=/etc/shadow

/ect/shells=/etc/shells
slay
ps
telnet
ftp
slogger
sloginfo

Data files are created in the named directory.

/etc/hosts = {

127.0.0.1 localhost

192.168.0.200 Qdebug

192.168.0.1 scrunch

192.168.0.25 Q1

#}

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

/etc/inetd.conf = {
ftp stream tcp nowait root /bin/fdtpd fdtpd
telnet stream tcp nowait root /bin/telnetd telnetd
pdebug stream tcp nowait root /bin/pdebug pdebug -
}

/etc/resolv.conf = {
nameserver 131.94.128.2
nameserver 131.94.64.4
}

====== Trace of debug from MS Windows Telent client
td: send do TERMINAL TYPE
td: send do TSPEED
td: send do XDISPLOC
td: send do OLD-ENVIRON
td: ttloop
td: netflush 118 chars
td: ttloop read 6 chars
td: recv will TERMINAL TYPE
td: recv will NAWS
td: send do NAWS
td: ttloop
td: netflush 107 chars
td: ttloop read 9 chars
td: recv wont TSPEED
td: recv wont XDISPLOC
td: recv wont OLD-ENVIRON
td: ttloop
td: netflush 116 chars
td: ttloop read 12 chars
td: recv will NAWS
td: netflush 46 chars
td: recv suboption NAWS 0 80 (8
td: netflush 45 chars
td: ttloop
td: netflush 12 chars
td: ttloop read 10 chars
td: netflush 26 chars
td: recv suboption TERMINAL-TYP
td: ttloop
td: netflush 62 chars
td: ttloop read 11 chars
td: netflush 26 chars
td: recv suboption TERMINAL-TYP
td: ttloop
td: netflush 63 chars
td: ttloop read 10 chars
td: netflush 26 chars

==> the the terminal stops at this point (no login prompt) and will drop
the conection when I hit return.

Connection to host lost.

C:\WINNT\system32
[/quote]

>

Hello Barry:

I had a chance to try your script last evening. I had to make some minor
modifications to when I started dev-con (as the system would hang) to get your
build file too work on my system (see below). I am manually starting telnetd
versus using inetd.

When I manually start “telnetd -debug” I get a login prompt from the telnet
client, but immediately the QNX host closes the connection. Here are the logs.

From syslog the telnetd process generates a log message that

  • setsocketopt (SO_KEEPALIVE): Operation not supported and then terminates
  • going down on signal 18

The windows client:
login: root
No home directory.
Logging in with home = “/”.
login: /bin/sh:

Connection to host lost.

Do you see anything that I am missing? telnetd works fine on my development
platform.

Regards,
–Jeff Strickrott

====== the modified build file
[virtual=x86,bios +compress] .bootstrap={
startup-bios -s 64k
PATH=/proc/boot procnto
}

[+script] startup-script = {

Start up some consoles

devc-con -n2 &

reopen /dev/con1

display_msg “Minimal telnet image on a PC compatible BIOS system”
seedres

display_msg “Starting slogger”
slogger &
waitfor /dev/slog

display_msg “Starting PCI BIOS”
pipe &
pci-bios &
waitfor /dev/pci

put in your actual IP,netmask and gateway

display_msg “Starting Network Driver”
io-net -dne2000 -pttcpip if=en0:192.168.0.200:255.255.255.0
default=192.168.0.1
waitfor /dev/socket

display_msg “Starting pty server”
devc-pty &
waitfor /dev/ttyp0

These env variables inherited by all the programs which follow

SYSNAME=nto
TERM=qansi
HOME=/

Start some extra shells on other consoles

display_msg “Starting Console”

devc-con -n2 &
reopen /dev/con2
[pri=25 +session] sh &

reopen /dev/con1
[+session] sh &
}

file links

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

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

Cheat and make the /temp point to the shared memory area…

[type=link] /tmp=/dev/shmem # tmp points to shared memory

Redirect console messages for syslog

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

inetd requires telnetd to be at a fixed location

[type=link] /usr/sbin/telnetd=/proc/boot/telnetd

I had problems with this, if link defined then telnetd could not find

termdef as it was looking in /proc/boot versus the bin directory

[type=link] /bin=/proc/boot

binary files to include in image

libc.so
libsocket.so
npm-ttcpip.so
devn-ne2000.so

[data=copy] # All executables that can be restarted go below.

Use the “public domain korn shell” as the default shell “sh”

sh = ksh

Include files for telnet capability

/etc/hosts=/etc/hosts
/etc/termcap=/etc/termcap
/bin/login=/bin/login
/bin/termdef=/bin/termdef
/etc/passwd=/etc/passwd
/etc/group=/etc/group

/etc/shadow=/etc/shadow, I have no shadow file

/ect/shells=/etc/shells
/usr/lib/terminfo = /usr/lib/terminfo
/etc/inetd.conf = /etc/inetd.conf
/etc/services = /etc/services

Include a console driver

devc-con

Include pci server

pci-bios
seedres

Other executables

io-net
pipe
devc-pty
inetd
ftpd
telnetd
pdebug
ksh
ping
ls
more
hostname
ifconfig
route
slay
ps
telnet
ftp
slogger
sloginfo

=========

OS Support wrote:

I suspect the problem is the missing the terminfo files. The
following build file allows you to telnet to the system.

Regards,
Barry F.

[virtual=x86,bios +compress] boot = {
startup-bios
PATH=/proc/boot procnto
}

[+script] startup-script = {

Start up some consoles

devc-con -n4 &
reopen /dev/con1

display_msg Minimal telnet image on a PC compatible BIOS system

Start the pci server

seedres
pci-bios &
waitfor /dev/pci

Start network driver and tcpip

io-net -dne2000 -pttcpip if=en0:10.12.1.44 &
waitfor /dev/io-net

Start inetd

inetd -d &

Some common servers

devc-pty &

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
}

Cheat and make the /temp point to the shared memory area…

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

Redirect console messages for syslog

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

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

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

inetd requires telnetd to be at a fixed location

[type=link] /usr/sbin/telnetd=/proc/boot/telnetd

[type=link] /bin=/proc/boot

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

libc.so

Other libs

npm-ttcpip.so
devn-el900.so
libsocket.so.2

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 pci server

pci-bios
seedres

Use the “public domain korn shell” as the default shell “sh”

sh=ksh

Include files for telnet capability

/etc/passwd = /etc/passwd
/etc/shadow = /etc/shadow
/etc/services = /etc/services
/etc/inetd.conf = /etc/inetd.conf
/usr/lib/terminfo = /usr/lib/terminfo

Other executables

devc-pty
ls
cat
pidin
io-net
inetd
ping
telnetd
telnet
login

Jeff Strickrott <> jstric01@cs.fiu.edu> > wrote in message
news:> 3F451FE1.E5A0BE8C@cs.fiu.edu> …
Hi All:

I have been trying to bring up a telnetd and ftpd server on a PC a test
platform. I am running RTP 6.1 NC (so that I can play with mkifs) and
booting my image from floppy.

I originally started off with a buildfile example from the deeply
embedded section of the Help file. I have included the modified version
below.

Problem: When I start telnetd (i.e., telnetd -debug -D report) manually
from a shell on the test platform I get the message “going down on
signal 18” from the slog file. I disabled inetd to narrow the problem
down. What am I missing in my buildfile? Any suggestions?

Thanks in advance for the help.

Regards,
–Jeff Strickrott

====== Buildfile

Svr Builfile

Aim: To make a network-enabled debug server using telnet, ftp to

pdebug

Target: x86,bios

[virtual=x86,bios +compress] .bootstrap={
startup-bios -s 64k
PATH=/proc/boot LD_LIBRARY_PATH=/proc/boot:/usr/lib procnto
}

[+script] startup-script = {
display_msg Welcome to QNX on a PC-compatible BIOS system
seedres

display_msg “Starting slogger”
slogger &
waitfor /dev/slog

display_msg “Starting PCI BIOS”
pipe &
pci-bios &
waitfor /dev/pci

put in your actual IP,netmask and gateway

display_msg “Starting Network Driver”
io-net -dne2000 -ptcpip
waitfor /dev/io-net/en0
waitfor /dev/socket

ifconfig en0 192.168.0.200 netmask 255.255.255.0
route add default 192.168.0.1

display_msg “Starting inetd”

inetd &

pdebug needs devc-pty and esh

devc-pty &
waitfor /dev/ttyp0

display_msg “Starting Console”
devc-con -n1 &
reopen /dev/con1
[+session] HOME=/ TERM=qansi-m ksh &

[+session] esh &

}

file links

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

[type=link] /tmp=/dev/shmem # tmp points to shared memory

binary files to include in image

libc.so
libsocket.so
npm-tcpip.so
devn-ne2000.so
pci-bios
seedres

devc-con
io-net
pipe
devc-pty
inetd
ftpd
telnetd
pdebug

esh

ksh
ping
ls
more
hostname
ifconfig
route
/etc/hosts=/etc/hosts
/etc/termcap=/etc/termcap
/bin/login=/bin/login
/bin/termdef=/bin/termdef
/etc/passwd=/etc/passwd
/etc/group=/etc/group

/etc/shadow=/etc/shadow

/ect/shells=/etc/shells
slay
ps
telnet
ftp
slogger
sloginfo

Data files are created in the named directory.

/etc/hosts = {

127.0.0.1 localhost

192.168.0.200 Qdebug

192.168.0.1 scrunch

192.168.0.25 Q1

#}

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

/etc/inetd.conf = {
ftp stream tcp nowait root /bin/fdtpd fdtpd
telnet stream tcp nowait root /bin/telnetd telnetd
pdebug stream tcp nowait root /bin/pdebug pdebug -
}

/etc/resolv.conf = {
nameserver 131.94.128.2
nameserver 131.94.64.4
}

====== Trace of debug from MS Windows Telent client
td: send do TERMINAL TYPE
td: send do TSPEED
td: send do XDISPLOC
td: send do OLD-ENVIRON
td: ttloop
td: netflush 118 chars
td: ttloop read 6 chars
td: recv will TERMINAL TYPE
td: recv will NAWS
td: send do NAWS
td: ttloop
td: netflush 107 chars
td: ttloop read 9 chars
td: recv wont TSPEED
td: recv wont XDISPLOC
td: recv wont OLD-ENVIRON
td: ttloop
td: netflush 116 chars
td: ttloop read 12 chars
td: recv will NAWS
td: netflush 46 chars
td: recv suboption NAWS 0 80 (8
td: netflush 45 chars
td: ttloop
td: netflush 12 chars
td: ttloop read 10 chars
td: netflush 26 chars
td: recv suboption TERMINAL-TYP
td: ttloop
td: netflush 62 chars
td: ttloop read 11 chars
td: netflush 26 chars
td: recv suboption TERMINAL-TYP
td: ttloop
td: netflush 63 chars
td: ttloop read 10 chars
td: netflush 26 chars

==> the the terminal stops at this point (no login prompt) and will drop
the conection when I hit return.

Connection to host lost.

C:\WINNT\system32
[/quote]

>

I don’t seems see “/bin/sh” exist in your build file.
Shouldn’t you do a /bin/sh = ksh there ?

-xtang

Jeff Strickrott <jstric01@cs.fiu.edu> wrote in message
news:3F4FB1FE.49021466@cs.fiu.edu

Hello Barry:

I had a chance to try your script last evening. I had to make some minor
modifications to when I started dev-con (as the system would hang) to get
your
build file too work on my system (see below). I am manually starting
telnetd
versus using inetd.

When I manually start “telnetd -debug” I get a login prompt from the
telnet
client, but immediately the QNX host closes the connection. Here are the
logs.

From syslog the telnetd process generates a log message that

  • setsocketopt (SO_KEEPALIVE): Operation not supported and then terminates
  • going down on signal 18

The windows client:
login: root
No home directory.
Logging in with home = “/”.
login: /bin/sh:

Connection to host lost.

Do you see anything that I am missing? telnetd works fine on my
development
platform.

Regards,
–Jeff Strickrott

====== the modified build file
[virtual=x86,bios +compress] .bootstrap={
startup-bios -s 64k
PATH=/proc/boot procnto
}

[+script] startup-script = {

Start up some consoles

devc-con -n2 &

reopen /dev/con1

display_msg “Minimal telnet image on a PC compatible BIOS system”
seedres

display_msg “Starting slogger”
slogger &
waitfor /dev/slog

display_msg “Starting PCI BIOS”
pipe &
pci-bios &
waitfor /dev/pci

put in your actual IP,netmask and gateway

display_msg “Starting Network Driver”
io-net -dne2000 -pttcpip if=en0:192.168.0.200:255.255.255.0
default=192.168.0.1
waitfor /dev/socket

display_msg “Starting pty server”
devc-pty &
waitfor /dev/ttyp0

These env variables inherited by all the programs which follow

SYSNAME=nto
TERM=qansi
HOME=/

Start some extra shells on other consoles

display_msg “Starting Console”

devc-con -n2 &
reopen /dev/con2
[pri=25 +session] sh &

reopen /dev/con1
[+session] sh &
}

file links

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

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

Cheat and make the /temp point to the shared memory area…

[type=link] /tmp=/dev/shmem # tmp points to shared memory

Redirect console messages for syslog

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

inetd requires telnetd to be at a fixed location

[type=link] /usr/sbin/telnetd=/proc/boot/telnetd

I had problems with this, if link defined then telnetd could not find

termdef as it was looking in /proc/boot versus the bin directory

[type=link] /bin=/proc/boot

binary files to include in image

libc.so
libsocket.so
npm-ttcpip.so
devn-ne2000.so

[data=copy] # All executables that can be restarted go below.

Use the “public domain korn shell” as the default shell “sh”

sh = ksh

Include files for telnet capability

/etc/hosts=/etc/hosts
/etc/termcap=/etc/termcap
/bin/login=/bin/login
/bin/termdef=/bin/termdef
/etc/passwd=/etc/passwd
/etc/group=/etc/group

/etc/shadow=/etc/shadow, I have no shadow file

/ect/shells=/etc/shells
/usr/lib/terminfo = /usr/lib/terminfo
/etc/inetd.conf = /etc/inetd.conf
/etc/services = /etc/services

Include a console driver

devc-con

Include pci server

pci-bios
seedres

Other executables

io-net
pipe
devc-pty
inetd
ftpd
telnetd
pdebug
ksh
ping
ls
more
hostname
ifconfig
route
slay
ps
telnet
ftp
slogger
sloginfo

=========

OS Support wrote:

I suspect the problem is the missing the terminfo files. The
following build file allows you to telnet to the system.

Regards,
Barry F.

[virtual=x86,bios +compress] boot = {
startup-bios
PATH=/proc/boot procnto
}

[+script] startup-script = {

Start up some consoles

devc-con -n4 &
reopen /dev/con1

display_msg Minimal telnet image on a PC compatible BIOS system

Start the pci server

seedres
pci-bios &
waitfor /dev/pci

Start network driver and tcpip

io-net -dne2000 -pttcpip if=en0:10.12.1.44 &
waitfor /dev/io-net

Start inetd

inetd -d &

Some common servers

devc-pty &

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
}

Cheat and make the /temp point to the shared memory area…

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

Redirect console messages for syslog

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

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

location
[type=link] /usr/lib/ldqnx.so.2=/proc/boot/libc.so

inetd requires telnetd to be at a fixed location

[type=link] /usr/sbin/telnetd=/proc/boot/telnetd

[type=link] /bin=/proc/boot

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

libc.so

Other libs

npm-ttcpip.so
devn-el900.so
libsocket.so.2

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 pci server

pci-bios
seedres

Use the “public domain korn shell” as the default shell “sh”

sh=ksh

Include files for telnet capability

/etc/passwd = /etc/passwd
/etc/shadow = /etc/shadow
/etc/services = /etc/services
/etc/inetd.conf = /etc/inetd.conf
/usr/lib/terminfo = /usr/lib/terminfo

Other executables

devc-pty
ls
cat
pidin
io-net
inetd
ping
telnetd
telnet
login

Jeff Strickrott <> jstric01@cs.fiu.edu> > wrote in message
news:> 3F451FE1.E5A0BE8C@cs.fiu.edu> …
Hi All:

I have been trying to bring up a telnetd and ftpd server on a PC a
test
platform. I am running RTP 6.1 NC (so that I can play with mkifs) and
booting my image from floppy.

I originally started off with a buildfile example from the deeply
embedded section of the Help file. I have included the modified
version
below.

Problem: When I start telnetd (i.e., telnetd -debug -D report)
manually
from a shell on the test platform I get the message “going down on
signal 18” from the slog file. I disabled inetd to narrow the problem
down. What am I missing in my buildfile? Any suggestions?

Thanks in advance for the help.

Regards,
–Jeff Strickrott

====== Buildfile

Svr Builfile

Aim: To make a network-enabled debug server using telnet, ftp to

pdebug

Target: x86,bios

[virtual=x86,bios +compress] .bootstrap={
startup-bios -s 64k
PATH=/proc/boot LD_LIBRARY_PATH=/proc/boot:/usr/lib procnto
}

[+script] startup-script = {
display_msg Welcome to QNX on a PC-compatible BIOS system
seedres

display_msg “Starting slogger”
slogger &
waitfor /dev/slog

display_msg “Starting PCI BIOS”
pipe &
pci-bios &
waitfor /dev/pci

put in your actual IP,netmask and gateway

display_msg “Starting Network Driver”
io-net -dne2000 -ptcpip
waitfor /dev/io-net/en0
waitfor /dev/socket

ifconfig en0 192.168.0.200 netmask 255.255.255.0
route add default 192.168.0.1

display_msg “Starting inetd”

inetd &

pdebug needs devc-pty and esh

devc-pty &
waitfor /dev/ttyp0

display_msg “Starting Console”
devc-con -n1 &
reopen /dev/con1
[+session] HOME=/ TERM=qansi-m ksh &

[+session] esh &

}

file links

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

[type=link] /tmp=/dev/shmem # tmp points to shared memory

binary files to include in image

libc.so
libsocket.so
npm-tcpip.so
devn-ne2000.so
pci-bios
seedres

devc-con
io-net
pipe
devc-pty
inetd
ftpd
telnetd
pdebug

esh

ksh
ping
ls
more
hostname
ifconfig
route
/etc/hosts=/etc/hosts
/etc/termcap=/etc/termcap
/bin/login=/bin/login
/bin/termdef=/bin/termdef
/etc/passwd=/etc/passwd
/etc/group=/etc/group

/etc/shadow=/etc/shadow

/ect/shells=/etc/shells
slay
ps
telnet
ftp
slogger
sloginfo

Data files are created in the named directory.

/etc/hosts = {

127.0.0.1 localhost

192.168.0.200 Qdebug

192.168.0.1 scrunch

192.168.0.25 Q1

#}

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

/etc/inetd.conf = {
ftp stream tcp nowait root /bin/fdtpd fdtpd
telnet stream tcp nowait root /bin/telnetd telnetd
pdebug stream tcp nowait root /bin/pdebug pdebug -
}

/etc/resolv.conf = {
nameserver 131.94.128.2
nameserver 131.94.64.4
}

====== Trace of debug from MS Windows Telent client
td: send do TERMINAL TYPE
td: send do TSPEED
td: send do XDISPLOC
td: send do OLD-ENVIRON
td: ttloop
td: netflush 118 chars
td: ttloop read 6 chars
td: recv will TERMINAL TYPE
td: recv will NAWS
td: send do NAWS
td: ttloop
td: netflush 107 chars
td: ttloop read 9 chars
td: recv wont TSPEED
td: recv wont XDISPLOC
td: recv wont OLD-ENVIRON
td: ttloop
td: netflush 116 chars
td: ttloop read 12 chars
td: recv will NAWS
td: netflush 46 chars
td: recv suboption NAWS 0 80 (8
td: netflush 45 chars
td: ttloop
td: netflush 12 chars
td: ttloop read 10 chars
td: netflush 26 chars
td: recv suboption TERMINAL-TYP
td: ttloop
td: netflush 62 chars
td: ttloop read 11 chars
td: netflush 26 chars
td: recv suboption TERMINAL-TYP
td: ttloop
td: netflush 63 chars
td: ttloop read 10 chars
td: netflush 26 chars

==> the the terminal stops at this point (no login prompt) and will
drop
the conection when I hit return.

Connection to host lost.

C:\WINNT\system32

[/quote]

>

Thanks all for the help. I though I would post my working script file for any
future users.

Regards,
–Jeff Strickrott

===================

Svr Buildfile

Aim: To make a network enabled debug server using telnet, ftp to pdebug

Target: x86,bios

Approach: To make this type of image you’ll need an NIC driver with a TCP/IP

stack. Telnet/ftp can easily work with the tiny stack. I’ll assume that

you have an NE2000 compatible PCI NIC. If the PC doesn’t have a PCI bus

and card is ISA, you have to exclude “pci-bios.” Select the appropriate

driver for your card.

[virtual=x86,bios +compress] .bootstrap={
startup-bios -s 64k -N node1
PATH=/proc/boot:/bin LD_LIBRARY_PATH=/proc/boot:/usr/lib procnto
}

[+script] startup-script = {

display_msg " "
display_msg “Welcome to QNX on a PC-compatible BIOS system”
seedres

display_msg “Starting slogger”
slogger &
waitfor /dev/slog

display_msg “Starting PCI BIOS”
pipe &
pci-bios &
waitfor /dev/pci

put in your actual IP, netmask and gateway

display_msg “Starting Network Driver”

for small tcpip stack

io-net -dne2000 -pttcpip if=en0:192.168.0.200:255.255.255.0

default=192.168.0.1

or full stack

io-net -dne2000 -ptcpip
waitfor /dev/io-net/en0
waitfor /dev/socket
ifconfig en0 192.168.0.200 netmask 255.255.255.0
route add default 192.168.0.1

staring the dhcp client

display_msg “Starting DHCP”

dhcp.client -h vision &

if_up en0

display_msg “Starting inetd”
inetd &

pdebug needs devc-pty and esh

devc-pty &
waitfor /dev/ttyp0

display_msg “Starting Console”
devc-con -n1 &
reopen /dev/con1
[+session] HOME=/ TERM=qansi-m ksh &
}

file links

[type=link] /usr/lib/ldqnx.so.2=/proc/boot/libc.so
[type=link] /tmp=/dev/shmem # tmp points to shared memory
[type=link] /bin=/proc/boot
[type=link] /proc/boot/sh = /proc/boot/ksh

\

binary files to include in image

libc.so
libsocket.so
npm-tcpip.so
devn-ne2000.so

  # All executables that can be restarted go
below.

# config files for telnetd, inetd, ... uncomment if you want to use hosts
inetd.conf files, etc...
# note must fix up links to properly point to telentd and other files
# /etc/hosts=/etc/hosts
# /etc/inetd.conf = /etc/inetd.conf
# /etc/services = /etc/services
/etc/passwd=/etc/passwd
/etc/group=/etc/group
/usr/lib/terminfo = /usr/lib/terminfo

# Include a console driver
devc-con

# Include pci server
pci-bios
seedres
pci

# other servers
pipe
devc-pty
slogger
sloginfo

# debug
pdebug

# shell support
ksh
termdef
login
logout

# network
ping
hostname
ifconfig
route
inetd
ftpd
telnetd
io-net
# telnet
# ftp

# process control
slay
ps
shutdown

# file system
ls
more
mv
cp
rm

# other options
# dhcp.client
# if_up
# stty
# devc-ser8250


# Data files are created in the named  directory.
/etc/hosts = {
127.1 localhost.localdomain localhost
192.168.0.200 node1
192.168.0.1 node2
192.168.0.25 node3
}

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

/etc/inetd.conf = {
ftp     stream    tcp    nowait    root    /proc/boot/fdtpd      fdtpd
telnet  stream    tcp    nowait    root    /proc/boot/telnetd    telnetd
pdebug  stream    tcp    nowait    root    /proc/boot/pdebug     pdebug -
}

# put your DNS names here
/etc/resolv.conf = {
nameserver 131.94.128.2
nameserver 131.94.64.4
}