Results 1 to 5 of 5

Thread: Qnx 4.25

  1. #1
    Join Date
    Mar 2002

    Qnx 4.25

    Some of you might remember me some not anyway this is Sysop_fb. I saw a few people writing posts and asking questions in regards to QNX, although some of what I discuss could in essence be used on one of the newer versions I haven't had an oportunity to look at the newer versions.

    QNX 4.25 is a Real-Time OS and is in my own opinion a unix flavor, it's very stable and very reliable. You can pretty much design the system to meet your own needs although it is not open source and up until 6.0 was release a development studio for QNX 4.25 would cost in the thousands of dollars. Since it's not open source it does have its limitations.
    QNX is mostly used in the business world as it is not free, you have to buy a licsense to install QNX, although there is free trials available.
    QNX 4.25 uses a similiar networking type structure as a router, it requires hard routes to be placed in the sysinit.1 file to designate how you want QNX to get to one subnet from it's current subnet.
    Now to get the box on your home lan, you will need to know the mac address of the NIC, the ip of the gateway(depends on your network setup, if you have dsl your modem will be your gateway), and an ip address for your QNX box and ofcourse the ip address(s) of your nameservers.
    vedit /etc/hosts and add the ip address of your box in with whatever name you prefer as so <tab> thisboxsucks

    vedit /etc/config/netmap
    add the mac address of the card as so
    1 1 00E778 87EFE2

    vedit /etc/config/sysinit.1
    Make sure the appropriate drivers are in for your NIC
    such as

    Net &
    Net.ether82557 <-- the driver that pertains to my NIC
    next go down to below where the script initializes netstart and below it write in the route.
    /usr/ucb/route add default <gateway ip goes here>
    such as
    /usr/ucb/route add default

    vedit /etc/resolv.conf
    uncomment the nameserver lines and add in the appropriate ip's for your nameservers.

    vedit /etc/netstart
    replace node$NODE with whatever you called your box
    such as
    /usr/ucb/Socket thisboxsucks &

    /usr/ucb/ifconfig en1 thisboxsucks up

    Next make sure an ethernet cable is plugged into the NIC and reboot the box
    shutdown -f
    I might have forgot something feel free to correct me this is mainly geared towards simple home networks.

  2. #2
    Join Date
    Mar 2002
    Now some simple tips

    How to add a second NIC

    vedit /etc/netstart
    Now you need to tell what card is which node. Change the following lines to look like the new(with the assumption your box is called thisboxsucks):
    /usr/ucb/Socket thisboxsucks &
    /usr/ucb/ifconfig en1 thisboxsucks up

    /usr/ucb/Socket -d forward thisboxsucks &
    /usr/ucb/ifconfig en1 thisboxsucks up
    /usr/ucb/ifconfig en2 netmask whatever netmask that pertains to which subnet it will be talking to) thisboxsucks2 up

    vedit /etc/hosts
    Need to assign this new NIC a name <tab> thisboxsucks2

    vedit /etc/config/sysinit.1
    Change the following lines to look like the new
    Net.ether82557 &
    sleep 10

    Net.eth82557 -l1 & (change the driver to match your card type)
    Net.eth905 -i11 -l2 & (change the driver to match your card type)
    sleep 30

    vedit /etc/config/netmap
    Change the lines to match
    1 1 000255 1E4B2C

    1 1 000255 1E4B2C
    1 2 000475 D9D7C8 (New NIC mac address)

    Shutdown the system
    shutdown -fb
    Put the new NIC into the proper slot and start it back up.

  3. #3
    Join Date
    Mar 2002
    How to make a QNX recovery Disk

    Insert a QNX boot disk in your floppy drive

    Copy the image to a temporary file on your hard disk:
    dd if=/dev/fd0 of=/tmp/floppy_image

    Insert a blank floppy in the drive
    Format the floppy:
    fdformat –k0 –z2 /dev/fd0

    Copy the image to the floppy:
    dd if=/tmp/floppy_image of=/dev/fd0

    Run dcheck to check the new floppy:
    dcheck /dev/fd0

    Now remove disktrap
    rm /dev/fd0/bin/disktrap

    Now copy some utils to the floppy:
    cp /bin/sin /dev/fd0/bin/sin
    cp /bin/zap /dev/fd0/bin/zap
    cp /bin/rm /dev/fd0/bin/rm
    cp /bin/ls /dev/fd0/bin/ls
    cp /bin/spatch /dev/fd0/bin/spatch
    cp /bin/chkfsys /dev/fd0/bin chkfsys
    cp /usr/bin/elvis /dev/fd0/bin/elvis

    mkdir /dev/fd0/etc
    cp /etc/termcap /dev/fd0/etc/termcap

    cd /dev/fd0/bin
    ln –s elvis vi
    ln –s fcat melt

    Now edit the /dev/fd0/etc/config/sysinit file
    And has these lines

    Dev –n 10 &
    Dev.con –n 4 –O 256 &
    reopen /dev/con1
    export PATH=/ram:. :/bin:/usr/bin
    export HOME=/
    dinit /dev/ram
    mount /dev/ram /ram
    prefix –A /pipe=/ram
    prefix –A /tmp=/ram
    fcat /util.tar.F | pax –vr
    cp /bin/esh /ram/sh
    melt –z </etc/logo.F
    rtc hw
    echp Welcome to QNX 4.25
    ontty /dev/con1 /bin/sh
    ontty /dev/con2 /bin/sh

    Maybe more to come.
    On a side note:

    Photon is a widely use GUI for QNX but there are others including XFree
    There was even a ported version of FVWM which is a highly configurable window manager.
    They can be found here:

    QNX website

    QNX discussion group

    QNX programmer discussion group

  4. #4
    Join Date
    Mar 2002
    Diagnosis of a build file before it's built along with a tip on how to ease the trouble.

    This is basically what I do to build a boot image. I wrote this in relation to a QNX 4.25 box running Photon.

    I create a file called hard4.scr which is basically a script file that will run commands for us.
    Inside the .scr file are my commands

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

    Now this is useless until you have written the file which is a build file. Once it's all said and done we will merely goto the root directory / and issue a
    'sh hard4.scr' command

    The reason I do this? It saves me time in my job because I install alot of PC's with QNX so all I have to do is figure out what type of drivers they need whether IDE SCSI or whatever and just run my script for the appropriate build file, the script basically turns the build file into a boot image. which is a build file, I will explain a little.
    Each program you want included in the created image is specified using three lines in the build file:
    First line – pathname of the program you want to include, pathnames are assumed to start at /boot
    Second line – starts with an & followed by a command
    Third line – must be blank to separate one entry from the next
    $ boot -v

    This next listing will be an explanation of the various commands issued within a boot image file.
    boot -v : runs the boot program with argument -v
    -v : tells the boot program to report boot image information
    Initializing the boot program MUST be on the first line of the boot image file.

    Proc32 -l1 -p 1000 -r 4000 -n 500 -t 1000
    Proc32 is the Process Manager/Microkernel
    -l1 is the argument that sets the logical node number of the machine, which in this case would be node 1
    -p 1000 is the argument that sets the maximum number of processes allowed
    -r 4000 is the argument that sets the size of the systems prefix space
    -n 500 is the argument that sets the maximum number of names allowed
    -t 1000 is the argument that sets the maximum number of timers

    Slib32 - 32bit system shared library, needed to run 32bit programs
    Slib16 - 16bit system shared library, needed to run 16bit programs
    Fsys - FileSystem Manager
    Fsys.driver - driver that is required to access the drive properly, finding the right driver
    needed can be a pain(dell servers with scsi adapters can be a nightmare)
    mount - command used to mount filesystems and partitions
    mount -p/dev/hd0 /dev/hd0t77 / :
    This mount command is saying to mount /dev/hd0(hard drive) as a t77(QNX 4 partition) filesystem as starting directory /
    QNX considers hardware drives such as floppy-drive, cd-rom, and hard drive as device files. As in Windows C: is normally your hard drive and D: your CD-ROM and A: your floppy-drive, that is a windows filesystem. In QNX /dev/hd0 is your first hard drive, /dev/cd0 is your CD-ROM and /dev/fd0 is your floppy-drive but you can’t just go to /dev/cd0 to access a CD you have to mount it as a directory.
    sinit TERM=qnx : this command is merely setting your pterminals emulation type as QNX, this is also a good way to make sure your hard file are run correctly simply open up a pterm by clicking on the small computer like icon on your toolbar(done from phindows) right click the terminal window and click properties down on the left side you should see “Terminal Emulation” with the QNX box checked(the square on the button will be green dignifying that it is checked) you can also issue a 'sin info' command and look at the procs and timers to make sure they are at where you set them to be in the build file.
    Have fun.

  5. #5
    Join Date
    Mar 2002
    Major Security hole

    Please put a password on the user 'bin' if you are running QNX 4.25
    It takes a good 5 seconds to gain access to root through bin.
    There's more but that's the biggest one.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts