As mentioned at the beginning of this chapter (Customizing Image Startup Programs), one of the main jobs of the startup program is to initialize the system page.
The system page structure struct syspage_entry is defined in the include file <sys/syspage.h>. The structure contains a number of constants, references to other structures, and a union shared between the various processor platforms supported by the QNX Neutrino RTOS.
It's important to realize that there are two ways of accessing the data within the system page, depending on whether you're adding data to the system page at startup time or reading data from the system page later (as would be done by an application program running after the system has been booted). Regardless of which access method you use, the fields are the same.
Here's the system page structure definition, taken from <sys/syspage.h>:
/* * contains at least the following: */ struct syspage_entry { uint16_t size; uint16_t total_size; uint16_t type; uint16_t num_cpu; syspage_entry_info system_private; syspage_entry_info asinfo; syspage_entry_info hwinfo; syspage_entry_info cpuinfo; syspage_entry_info cacheattr; syspage_entry_info qtime; syspage_entry_info callout; syspage_entry_info callin; syspage_entry_info typed_strings; syspage_entry_info strings; syspage_entry_info intrinfo; syspage_entry_info smp; syspage_entry_info pminfo; union { struct x86_syspage_entry x86; struct arm_syspage_entry arm; } un; };
Note that some of the fields presented here may be initialized by the code provided in the startup library, while some may need to be initialized by code provided by you. The amount of initialization required really depends on the amount of customization that you need to perform.
Let's look at the various fields.