How does the minidriver work?

A minidriver is a function that you link to the QNX Neutrino startup program, so that it runs before the system becomes operational and the kernel is initialized. A minidriver can access hardware and store data in a RAM buffer area where a full (process-time) driver can then read this buffered information.

To notify startup and procnto about the presence of a minidriver, the startup code must register the minidriver by adding an entry to the SYSPAGE's minidriver section.

During system startup, the minidriver handler function is periodically called (or polled) to find out where the minidriver is invoked throughtout the system initialization sequence. You can adapt this periodic/polled interval to suit your device's timing requirements with minor changes to the startup program.

As soon as procnto can handle interrupts, any minidriver's handler with a specified interrupt value is attached to the interrupt. The handler is called with a state variable, so the handler knows why it was called.

Once a resource driver attaches to the same interrupt as a minidriver, the minidriver is notified. Then, the minidriver asks to be disabled by returning a non-zero value, and procnto detaches it from the interrupt.