Modifying the startup

You can modify the startup code, or even create a new startup program.

If you need to make changes to the startup code, either because you need to implement custom functionality or behavior, or because you need a startup program for 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 for 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 platforms' 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 program 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 chapter Working with QNX BSPs in this guide. For more information about the make utility and its options, see the make entry in the Utilities Reference.