Modifying the startup program

Updated: April 19, 2023

You can modify a startup program or even create a new one.

If you need to modify a startup program, either because you need to implement custom functionality, or because you need to support a new hardware platform, you should start with an existing startup program, which you can copy and modify. Start with the startup program from the BSP for the platform closest to your new platform.

To create a new startup program, make a new directory under bsp_working_dir/src/hardware/startup/boards, then copy the files from an existing startup program directory to your new directory.

For example, if you need to modify the startup code for the imaginary DK Elsinore Ghost 8, you might start with the source code from the BSP for the (also) imaginary DK Elsinore Ghost 7, which is in bsp_working_dir/src/hardware/startup/boards/dkelsinoreghost7:

  1. Go to the BSP boards subdirectory:

    cd bsp_working_dir/src/hardware/startup/boards
  2. Create a new directory for your new hardware platform's startup code:

    mkdir dkelsinoreghost8
  3. Copy the contents of the original directory to your new directory:

    cp -r dkelsinoreghost7/* dkelsinoreghost8
  4. Go to your new directory:

    cd dkelsinoreghost8
  5. Rename everything to reflect the name of your new platform.
  6. Build a new copy of your BSP:

    make clean

You should now have a copy of the startup source code that you can modify, as well as freshly built binaries, in your new dkelsinoreghost8 directory. You can now identify the parts of the startup code you need to modify, change them, and rebuild. It is a good idea to start by making sure you can get debug information; for example, through a serial port.

For more information about building BSPs, see the Working with QNX BSPs chapter. For more information about the make utility and its options, see the make entry in the Utilities Reference.