打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Getting a QNX machine into network
userphoto

2008.03.28

关注

Setting up a QNX4.x machine for networking.


Author: Vilas Kumar Chitrakaran, Aug 2001

Follow this page to configure a PC running QNX Operating System into the Mechatronics QNX Network. This page guides you with an example configuration of a machine with the IP address crb14.ces.clemson.edu.

You need to be logged in as 'root' to make all the changes. You will need to modify the following files.

/etc/hosts
/etc/resolv.conf
/etc/config/network
/etc/config/sysinit

The steps......

  1. Modify your /etc/hosts file to add your IP address. An example hosts file configured for crb14 is given below.

    #
    # Host Database
    # This file should contain the addresses and aliases
    # for local hosts that share this file.
    # It is used only for "ifconfig" and other operations
    # before the nameserver is started.
    #
    #
    #127.1 localhost localhost.my.domain
    #
    # Imaginary network.
    #10.2 myname.my.domain myname
    #10.3 myfriend.my.domain myfriend
    130.127.172.24 crb14 crb14.ces.clemson.edu

    Change the values in bold typeface to reflect the IP address of your machine. Remember that the IP address for all machines here is of the form 130.127.172.xxx where xxx is a value that is 10 higher than the crb number. For example, the IP address for crb24.ces.clemson.edu would be 130.127.172.34 .

  2. Modify the /etc/resolv.conf file to add the 'domain name' and the 'nameservers'. An example file that will work with machines in our labs is shown below.

    #resolv.conf
    domain ces.clemson.edu
    nameserver 130.127.200.15
    nameserver 130.127.8.8

  3. The /etc/config/network is a shell script that starts up the network. Here is the file. Modify the machine address where required. Remember that the 'gateway' is always 130.127.172.2 for all machines.

    Net &
    Net.tulip -vvv -H 9 &
    sleep 2
    #netmap -f
    #netmap -F //1/etc/config/netmap
    #nameloc -k 1

    /usr/ucb/Socket crb14 &
    /usr/ucb/ifconfig en1 crb14 up broadcast 130.127.172.255 netmask 255.255.255.0
    /usr/ucb/route add default 130.127.172.2 #this is the gateway
    /usr/ucb/inetd&
    /usr/ucb/portmap

    Notice that the third, fourth and the fifth line in the file are commented out. We shall uncomment it in step 7.

  4. Now make this file executable. Issue the following command.

    chmod +x /etc/config/network

  5. Check the network. Type

    slay Net
    /etc/config/network

    Do
    • ping 130.127.172.2

      You should be able to see the results of pinging into another machine, as shown below...


      Ctrl c to quit pinging.

    • ping crb01

    • Try 'voyager' to browse some webpage. Type voyager in the terminal for opening the web browser.

    The network should now be up and running...hopefully.

  6. The /etc/config/sysinit may not need any changes to be made. This file can be copied or FTP'd from another machine and renamed to sysinit.1, after backing up any sysinit.1 files already present. Later on, while configuring the machine into the QNX network (this is different from TCP/IP network), a copy of this file shall be renamed into sysinit.node where the node is the node number of the machine...for crb14, it would be sysinit.14.

    cd /etc/config
    mv sysinit.1 sysinit.1.old
    mv sysinit sysinit.1

    Your sysinit.1 file should look something like this....

    export TZ=utc00
    rtc -l hw
    Dev &
    Dev.ansi -Q -n 4 &
    reopen
    Dev.ser &
    Dev.par &
    emu87 &
    tinit -t /dev/con1 -T /dev/con[2-4] &

    Now, append the lines '/etc/config/network' to this file if all checks of step 5 were successful. Adding that line enables the machine to get connected to the network during boot up.

  7. The machine is now configured for TCP/IP. Usually we want to make the machine part of the QNX network as well. Follow the steps given below..

    a) Copy sysinit.1 to sysinit.node

    cp sysinit.1 sysinit.node

    where the node is the node number of the machine...for crb14, it would be 14.

    b) FTP the directory /etc/licenses from node 1(server) to your machine and put it in the same location(/etc/).

    c) FTP the file /etc/config/netmap from node 1 to your machine and put it in the same location (/etc/config).

    Edit the 'netmap' file to make sure that the enrty for node 1 (that is the first entry) and the entry for your node exists.


     

    The machine has a network card that has it's 'MAC address' hardwired in it. The QNX server uses this MAC address to communicate with your machine. You must make sure that the MAC address of your machine matches with the entry for your node in the /etc/config /netmap file. Do the following :

    • Look for the MAC address of the network card in your machine. This can be found somewhere on the network card or during boot-up.

    • Open the netmap file and confirm that the MAC address for your node is the same in the 'netmap' file.

    • If the MAC addresses don't match, contact QNX Administrator so that he can make neccesary changes in the server.

      TO QNX ADMINISTRATOR : Open the /etc/config/netmap file and enter the right MAC address for the machine. Update the netmap with the command

      netmap -f

      A sample netmap file is shown below:


     

    c) Try the following commands from console.

    netmap -f
    netmap -F //1/etc/config/netmap
    nameloc -k 1


    After netmap -f command you should be able to see node 1 and our node with the command alive. After netmap -F //1/... command you should be able to see all nodes with the command alive. If everything works fine, uncomment the "netmap" and "nameloc" lines in the /etc/config/network script.

    d) Update the licenses. Type the following command

    license //1/etc/licenses
    license -r


    This will update the network licenses for all the components in the installed system.

  8. Make a copy of the current system's image. If changes to the default system image (/.boot) prevents the PC from booting properly, the user can then chose to boot from the alternate system image (./altboot) by holding down the ESCAPE key during the boot phase. In addition, ensure that there exists the file altsysinit file in the directory /etc/config which is used instead of sysinit.node in case of an alternate boot (i.e., when the ESCAPE key is pressed during booting, /.altboot and /etc/config/altsysinit are used to initialize QNX). To copy the current system image to .altboot, utilize the following commands:

    cp /.boot /.altboot

  9. In order to ensure that Proc32 is executing at priority 26, a new QNX system image must be constructed. QNX build files are stored in /boot/build. The default QNX installation procedure will create a build file called install.node where node is the QNX node number of the PC. To build the proper system image, the following commands should be executed:

    cd /boot/build
    ls


    The output of the list command should look something like:

    ./     hard.ata.1    ws.arcxir ws.ether503  ws.ether8003 ws.tr164a    ../    hard.macros.1 ws.arc20  ws.ether1000 ws.ether509  ws.ether9000    floppy install.1     ws.arcnet ws.ether2100 ws.ether7231 ws.fddidfe
  10. Now perform the following:

    cp install.1 crb14.

    Type the right node name in lieu of 'crb14'. (note: other QNX build files are present in /boot/build).

  11. Edit the file crbxx (note: any text editor will suffice. For example. type "ped crb14"). The text file 'crbxx' should appear as follows

    /boot/sys/boot    $ /boot/sys/boot -v    /boot/sys/Proc32    $ /boot/sys/Proc32 -l 1    /boot/sys/Slib32    $ /boot/sys/Slib32    /boot/sys/Slib16    $ /boot/sys/Slib16    /bin/Fsys    $ /bin/Fsys    /bin/Fsys.eide    $ /bin/Fsys.eide fsys -Ndsk0 -n0=hd0. -n5=cd0. eide -a1f0 -i14    /bin/mount    $ /bin/mount -p /dev/hd0.0 /dev/hd0.0t77 /    /bin/sinit    $ /bin/sinit TERM=qnxm

     

    Note: the user's build file may appear different than above depending on which base build file (e.g., install.1, hard.1, hard.ata.1, etc.) was selected. To reduce potential errors, the user should select the build file that most resembles the above script.

  12. The following line of crbxx should be amended to appear as:

     

    $ /boot/sys/Proc32 -l 14 -i 5 -P 26 (note: the file system is case sensitive. Also note that the number in bold is the node number. Type the correct node number for your machine.The - p will set Proc32 to execute at priority 26. The option -i 5 sets IRQ 5 as the most important IRQ in the system (this will be the IRQ triggered by the hardware timer on the MultiQ or STG board).

  13. Save and exit crbxx. The operating system image corresponding to the build file for example crb14 now needs to be built with the following commands:

     

    cd /boot    buildqnx build/crb14 images/crb14    cp images/crb14 /.boot

    The 2nd line builds the system image, and the 3rd copies it to the directory /.boot, making it the image that will be loaded by default when the system boots.

  14. Now reboot the machine for the changes to take effect. If an error occurs with the new system image (recently saved to /.boot), then press ESCAPE key during the boot phase to utilize the original system image /.altboot).

  15. After the PC has rebooted, check to see if Proc32 is actually running at priority 26 with the following command:

     

    sin -P Proc32

    which should return the following:

    SID   PID PROGRAM                 PRI  STATE   BLK   CODE   DATA    0    1   /boot/sys/Proc32        26f  READY   ---   122k  3264k
  16. Check the network to make sure it is working fine. Ping a machine in the network, or use voyager to browse some webpage.

  17. See QNX Administrator to update all links to this machine.

    TO QNX ADMINISTRATOR : Run the following commands as root to update all nodes from the QNX server CRB01.
    cd /usr/net/admin
    update_all_nodes


  18. You are all set.


Back to Documentation index
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
QNX的启动
鞋业、装饰品等英语专业术语
VxWorks引导启动过程
Escape
自制简单的Linux
Linux启动时报错bash:no job control in this shell
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服