Wednesday, October 25, 2023

Enable SSH server on QNX 6.5

This is quick start guide how to run ssh server on QNX. Tested on QNX 6.5 (650SP1-VM.tar).

# ssh-keygen -t dsa -b 1024 -f /etc/ssh/ssh_host_dsa_key -N ''
# ssh-keygen -t rsa -b 1024 -f /etc/ssh/ssh_host_rsa_key -N ''

This is not security best practice but this is only a test machine. Enable direct root ssh login to the machine.
# sed -i 's/#PermitRootLogin no/PermitRootLogin yes/g' /etc/ssh/sshd_config

To start ssh service interactively, do:
# /usr/sbin/sshd

Use /usr/sbin/sshd -ddd to view debug output

To run sshd on start, add the following to /etc/rc.d/rc.local:
/usr/sbin/sshd &
Reference:
http://www.qnx.com/developers/docs/660/index.jsp?topic=%2Fcom.qnx.doc.neutrino.utilities%2Ftopic%2Fs%2Fsshd.html

Using INTEL PRO/1000 Gigabit driver in QNX 6.6 running on VMware ESXi

Using INTEL PRO/1000 Gigabit driver in QNX 6.6 running on VMware ESXi

When installing QNX 6.6 using VM-QNXSDP660-201402230339.iso on VMware ESXi (8.0 update 2) the default network apapter used is AMD Lance PCNet 32. The PCNet 32 driver reports to only support 10Mbps, for cases where higher network bandwidth is needed Intel PRO/1000 Gigabit is a good choice. To load Intel PRO/1000 Gigabit, edit /etc/rc.d/startup_aps.sh and comment out pcnet.so driver and add dirver for e1000, like:
#io-pkt-v4-hc -d /lib/dll/devn-pcnet.so &
io-pkt-v4-hc -d /lib/dll/devnp-e1000.so &

Saturday, October 14, 2023

Installing Vim 7.2 in QNX 6.5 using pkgsrc

Installing Vim 7.2 in QNX 6.5 using pkgsrc

QNX 6.5 self-hosted Neutrino host ships with vi but Vim 7.2 is a big imporovement over the default application. Below are the steps to install Vim 7.2 using pkgsrc.
  • Download the bootstrap package
    http://archive.netbsd.org/pub/pkgsrc-archive/packages/QNX/i386/6.5.0_head_20110826/bootstrap.tar.gz
  • Download Vim package and dependencies from the link below
    http://archive.netbsd.org/pub/pkgsrc-archive/packages/QNX/i386/6.5.0_head_20110826/All
    vim-share-7.2.446.tgz
    libiconv-1.14.tgz
    gettext-lib-0.18.1.1.tgz
    vim-7.2.446nb1.tgz
        
  • Copy the files into /tmp using ftp, Momentics IDE, sftp, etc
    #: ls /tmp
    bootstrap.tar.gz
    vim-share-7.2.446.tgz
    libiconv-1.14.tgz
    gettext-lib-0.18.1.1.tgz
    vim-7.2.446nb1.tgz
    
  • Install bootstrap package into the root folder
    #: tar -xvzf bootstrap.tar.gz -C /
    
  • Add pkgsrc utilities into the path
    #: echo 'export PATH=${PATH}:/usr/pkg/bin:/usr/pkg/sbin' >> ~/.profile
    
  • Modify /etc/rc.d/rc.local to update CS_LIBPATH system variable
    setconf CS_LIBPATH $(getconf CS_LIBPATH):/usr/pkg/lib
    
  • Logout and then log back in
  • Install dependencies and Vim
    #: pkg_add -v /tmp/libiconv-1.14.tgz
    #: pkg_add -v /tmp/gettext-lib-0.18.1.1.tgz
    #: pkg_add -v /tmp/vim-share-7.2.446.tgz
    #: pkg_add -v /tmp/vim-7.2.446nb1.tgz
    
  • Fix backspace not deleting the character by adding the following to ~/.vimrc
    set backspace=indent,eol,start
    
  • Run Vim!
    #: export TERM=ansi
    #: vim
    
Refs:
https://community.qnx.com/sf/wiki/do/viewPage/projects.pkgsrc/wiki/BinaryPackages

How to apply QNX 6.5 SP1 into an existing QNX self hosted installation

How to apply QNX 6.5 SP1 into an existing QNX self hosted installation

This was tested on VirtualBox with QNX 6.5.0 self-hosted Neutrino host.
Below are the quick steps
  • Mount the QNX 6.5 SP1 iso (qnxsdp-6.5.0SP1.iso)
  • Run the following command in QNX terminal
    Load CD/DVD-ROM driver
    devb-eide cdrom
    
    Mount the cd/dvd-rom
    mount -t cd /dev/cd0 /cd
    
    Install the update
    cd /cd
    sh ./qnxsdp-6.5.0SP1-201206270843-nto.sh
    

Building in QNX Momentics 6.5 SP1 throws "Couldn't reserve space for cygwin's heap, Win32 error 0"

Building in QNX Momentics 6.5 SP1 throws "Couldn't reserve space for cygwin's heap, Win32 error 0"

Buiding barebones QNX C++ program throws "Couldn't reserve space for cygwin's heap, Win32 error 0". See sample output below
C:\QNX650\host\win32\x86\usr\bin\make.exe -k CPULIST=x86 all --file=C:/Users/u1/AppData/Local/Temp/QMakefile169726255947317724.tmp 
      0 [main] us 0 init_cheap: VirtualAlloc pointer is null, Win32 error 487
AllocationBase 0x0, BaseAddress 0x71690000, RegionSize 0x330000, State 0x10000
C:\QNX650\host\win32\x86\usr\bin\sh.exe: *** Couldn't reserve space for cygwin's heap, Win32 error 0
C:/QNX650/host/win32/x86/usr/bin/make.exe -j 1 -Cx86 -fMakefile all
make.exe[1]: Entering directory `C:/ide-4.7-workspace/test1/x86'
C:/QNX650/host/win32/x86/usr/bin/make.exe -j 1 -Co -fMakefile all 
make.exe[2]: Entering directory `C:/ide-4.7-workspace/test1/x86/o'
make.exe[2]: Nothing to be done for `all'.
make.exe[2]: Leaving directory `C:/ide-4.7-workspace/test1/x86/o'
C:/QNX650/host/win32/x86/usr/bin/make.exe -j 1 -Co-g -fMakefile all
make.exe[2]: Entering directory `C:/ide-4.7-workspace/test1/x86/o-g'
make.exe[2]: Nothing to be done for `all'.
make.exe[2]: Leaving directory `C:/ide-4.7-workspace/test1/x86/o-g'
make.exe[1]: Leaving directory `C:/ide-4.7-workspace/test1/x86'
It seems like "C:\QNX650\host\win32\x86\usr\bin\msys-1.0.dll" needs to be loaded at specific address, to fix do the following: 
  • Install 32-bit version of Git for Windows - it ships with rebase.exe
  • Then run the following commands:

    Create a backup, just incase we need to revert back.
    cp "C:\QNX650\host\win32\x86\usr\bin\msys-1.0.dll" "C:\QNX650\host\win32\x86\usr\bin\msys-1.0.dll.bak"
    

    Change directory to the rebase.exe executable
    cd "C:\Program Files (x86)\Git\bin"
    

    Perform rebase
    rebase.exe -b 0x50000000 C:\QNX650\host\win32\x86\usr\bin\msys-1.0.dll
    

Refs:
https://www.qnx.com/support/knowledgebase.html?id=5011O000001OLXD

Thursday, September 28, 2023

InstallScript: How to use Kernel32 MoveFile

InstallScript: How to use Kernel32 MoveFile

MoveFile Kernel32 API function moves an existing file or a directory, including its children.
Below shows an example code how to use it in InstallScript

Sunday, September 10, 2023

Eclipse shortcut keys

This are some of the shortcut keys that I find useful while working with Eclipse.

Key Action
Ctrl+/ Comment out the current line
Ctrl+\ Uncomment the current line
Ctrl+D Delete the current line
Ctrl+M Maximize editor view
Ctrl+Alt+Arrow Up Duplicate current line, maintain caret location
Ctrl+Alt+Arrow Down Duplicate current line, move caret location down
Ctrl+Shift+p Find matching bracket
Window Navigation
Ctrl+F7 Move to different views.
Ctrl+F6 Move to different editor windows
Alt+Shift+Q+C Focus Console View
Alt+F7 Switch between different consoles
Misc
Ctrl+O Quick Outline

Installing QNX 6.4.1 on Ubuntu 20.04

Installing QNX 6.4.1 on Ubuntu 20.04 Install pre-requisites $: sudo dpkg --add-architecture i386 $: sudo apt update $: sudo apt install li...