This is the core of the minidriver development.
To implement a minidriver, the following steps are required:
(On your development host, this file is located in your workspace as part of your BSP files in a directory that ends with libstartup).
By default, this value is set to 16KB (with a standard QNX 6.3.0 Board Support Package) and is the amount of data that is copied at one time when the boot image is copied from flash to RAM. The minidriver callout will be called after each copy. For example:
minidriver callout copy next 16K minidriver callout copy next 16K etc.
It may be necessary to modify this value. For example, on a MPC5200 running at 396 MHz, the time needed to copy 16KB is around 8 milliseconds. This will vary depending on the speed of the processor and the speed of the flash. If the mdriver_max is modified to be a 1KB copy value, then the time needed to copy this 1KB drops to less than 1 millisecond. The value of mdriver_max will need to be set based on experimentation.
If mdriver_max.c is modified, be sure to recompile the libstartup.a library. Also, relink your startup code with this new library.
The following files are modified in your startup code. They all exist in the same directory as your BSP startup code. For example, if you are building a BSP for the Media5200b board, you will have imported the BSP into QNX Momentics IDE (in to your workspace). The following files will change:
See the examples in the Sample Drivers for Instant Device Activation chapter of this guide.
Here are the highlights:
extern int mini_data(int state, void *data);
//Global paddr_t mdriver_addr; // allocate 64K of memory // for use by the minidriver mdriver_addr = alloc_ram(~0L, 65536, 1);
//Code to add a sample minidriver function //called "mini-data" for irq=81 mdriver_add("mini-data", 81, mini_data, mdrvr_addr, 65536);
Try out one of the samples that is included with this package and build the new startup program (e.g. startup-mgt5200).