QNX Lab Introduction for QNX6.2.1

 

Overview.. 1

Getting Started. 1

I want to browse the web! 2

Your Password. 2

Your home directory (and files) 2

Transferring files from your home directories. 2

How come code from last year doesn't compile properly?. 2

Accessing QNX from home. 3

Printing. 3

Problems with QNX and NFS. 3

Getting Help & Reporting Problems. 4

Running QNX at home. 4

Accessing a floppy. 4

Misc. questions and answers. 4

                 

Overview

 
  The lab is made up of QNX desktop machines (workstations) running QNX operating
  system and mounting various file systems from ENCS servers.
 
  You can use QNX workstation in Lab H803 (for coen320) and Lab H867 (for coen421).
  You can also access the QNX system from outside CONCORDIA UNIVERSITY, please
  refer the following sections.
 

Getting Started

 
   In the lab, you may choose any machine and use it interchangeably with the others.
   Your home directory will be the same everywhere.
 
   Once you've logged in, start a "Terminal" from the menu on the right. From there
   you'll have access to the gcc and g++ compiler and editors.
   Currently you have a choice of vim, vi, pico, jed, and the QNX graphical editor.
  (available from the menu on the right)
 
   The powerful IDE, Monmentics, is now available for edit, compile, and  debug your
   c, c++ and Java programs. You can launch it from:
   Launch->Development->Integrated Development Environment.
 
   GNU compiler and maker are also installed and available for your use.
 
   To compile a program using gcc, type up your code using an editor and save it as
   a .cpp file.  Then use g++ to compile it.
 
   g++ hello.cpp
 
   The newly created binary will be called a.out and you can run it by typing
 
   ./a.out
 
   If you want g++ to call the binary something else than a.out, use the -o option
   to g++.
 
   g++ hello.cpp -o hello
 
   will compile your hello.cpp program and call the final executable hello. You can
   run it by typing
 
   ./hello
 
   You will need to learn more about gcc and make as your projects get more 
   complicated than a single source file.  The 'Help" button on the right brings
   up a help viewer with all kinds of useful information.
 
   For for help with your programming work refer to the on-line documentation
   using the help viewer and go through the examples given.
 
 

I want to browse the web!

 
   Open Mozilla, then click on "Edit" and "Preferences". Click the "Advanced", 
   and select "Proxies", select the "Manual proxy configuration" in the HTTP 
   Proxy field put ‘proxy-realtime.encs.concordia.ca’ and port 3128.
 
   You should be able to browse the web using the ENCS proxy web server.
 

Your Password

 
   Your QNX account is mostly same as your ENCS account except the different home
   directory.  Your initial password is the same as your current ENCS password,
   but that was only for the purposes of creating your account. 
   Note that if you change you password on any QNX workstation the change will be
   valid on only that workstation, and even that will be lost the next time the
   workstation reloads a fresh copy of the password file from Unzen2.
 

Your home directory (and files)

 
  Once you log in QNX network, you will be your QNX home directory. This home
  directory is not your ENCS home. 
  To access your ENCS home from QNX workstation, use the command 
     ssh login.encs.concordia.ca’ 
  to login the ENCS server. In this case, you will be at your ENCS home,
  and you can access your QNX home from here. See next section.
 
 

Transferring files from your home directories

 
   Start by transferring your files from home onto your regular ENCS account. 
   Then just copy them to your QNX home directory: /teaching/realtime/j/j_smith 
   (where j_smith is  your username of course:
   To do these, you can follow the nextb steps:
        - login to an ENCS system (e.g. ssh login.ENCS.concordia.ca)
        - cd /teaching/realtime/home/j/j_smith
        - cp <filename> ~/
 
   They are now in your QNX home directory.
 
   You can do the same task to transfer the files in QNX home to your ENCS home.
 

How come code from last year doesn't compile properly?

 
 
   What are you doing with last year's code????  :-)
 
 
   Possibly you are using the old C/C++ header files.
 
   QNX 6.1 comes with the Dinkumware STL lib and the headers files must be
   written like this, following the new Stricter C++ standard:
 
   #include 
   #include 
   #include 
   #include 
   #include 
   #include 
   //...
 
   becomes
 
   #include 
   #include 
   #include 
   #include 
   #include 
   #include 
 
   using namespace std;
 
   If you're still having trouble (if it seems like the "using" statement is
   not working) you can try to always specify std::printf(""), or make some
   macros like this:
 
   #define strlen( s )     std::strlen( s )
   #define strcpy( d, s )  std::strcpy( d,s )
   #define memcpy( d,s,l ) std::memcpy( d,s,l )
   #define exit( c )       std::exit()
 
  
   (Now you know you're supposed to be writing your own code, not using
    someone's from last year, right?)
 
   (And thanks to Fred for helping me with this one.)
 
 

Accessing QNX from home

 
To access QNX network from home, please follow the next steps:
     1)  Ssh login.encs.concordia.ca     
         Log in with your ENCS username and password.
2)   ssh mackay.realtime.private  or
   ssh peel.realtime.private 
 
 
   "peel" and “mackay” are the remote access QNX servers in the machine room
   without console access.  

Printing

 
   You can print your files from the the ENCS network, from your usual ENCS
   account.
 
   Your QNX home directory will be available in
        /teaching/realtime/home/j/j_smith 
 
   Just print them from there to whichever printer you have access to.
 

Problems with QNX and NFS

 
   There are some quirks that arise from bugs in the QNX implementation of
   NFS.  Here is what you have to know.
 
   Due to a QNX problem with NFS mounted volumes, you have to make sure that
   all the directories in the path leading up to your executable are group
   and world executable. This should be automatically done for you, but if
   you've messed with the permissions, you'll need to know this. (chmod 711
   for correct permissions)
 
   Also, you may not be able to execute a file if the group ownership is not
   correct.  All your files should be owned by a group corresponding to your
   course number.  (ie qcoen320 or qcoen421)
 
   You might also get the "Permission Denied" message even if your groups
   and permissions are set properly.  Try copying the executable file to
   another name - after you've done that both the copy and the original
   should work.  You could also try doing
 
      cat mybinary > /dev/null
 
   That should also make it runnable.  (But I haven't tried this yet.)
 
   If you're getting a "Permission Denied" message for your executables and
   you are having trouble setting the permissions correctly,
   e-mail helpdesk@ENCS and we'll help you.
 
   You may also come by H-927 during office hours.  (11am-12pm, 4pm-5pm)
 

Getting Help & Reporting Problems

 
   Visit www.qnx.com for related information about QNX.
 
   Send e-mail to helpdesk@ENCS.
 
   You may also come to EV-007.105 during office hours.  
   (Mon. to Fri. 11am-12pm, 4pm-5pm) or 
   the Helpdesk office (H-960) at almost any time. They have very long 
   opening hours, including weekends.
 
 

Running QNX at home

 
   QNX is free for personal use and downloadable from get.qnx.com.
 
   You can install it either as a stand-alone operating system on its
   own partition (not extended though, you must have a free primary
   partition) or as a package under Windows.
 
   The QNX web site provides information on how to install each version.
   A searchable "Knowledge Database" is also available at qdn.qnx.com,
   and human help can be found on various newsgroups available at the
   news server inn.qnx.com.  
  (A good group to start with is qdn.public.qnxrtp.newuser)
 
 

Accessing a floppy

 
  The floppy needs to be mounted to be used, and unmounted once you're
   done with it.
 
   The command "dosflopmount" will mount a DOS-formatted floppy in the
   directory /floppy.  You may then read and write file to the floppy
   using regular unix commands.  (cp, mv, ls)
 
   When you're done, type "dosflopunmount" to clean up and make sure
   all the data was written to the disk.  (As opposed to being in the
   buffers and not written out to your disk yet.)
 
   Be careful, other students can read/write your floppy while it's
   mounted.
 
 

Misc. questions and answers

 
 
  Q. Is there a better shell than ksh?
     - You can use bash.
 
  Q. How do I view a pdf file?
     - You can use xpdf.
 
  Q. How come do my files missing?
     I've logged in and everything is weird and my files are missing.
     - Log out and reboot the machine.  (The NFS filesystem did not mount
       properly.)