image_scan()

QNX SDP8.0Building Embedded SystemsConfigurationDeveloper

Scan memory for a valid system image

Synopsis:

unsigned long image_scan (unsigned long start,
                          unsigned long end)

Arguments:

start
The address in memory from which to start scanning
end
The address in memory at which to stop scanning

Description:

The image_scan() function scans memory for valid system images. As it scans memory, image_scan():

  • Examines only the specified address range. If an OS image is outside the specified search range, image_scan() won't find that OS image.
  • Looks on 4-byte boundaries for image header signatures (STARTUP_HDR_SIGNATURE).
  • When it finds a signature, authenticates it.
  • Verifies the checksums for the OS image and for the startup header.
  • Copies the startup header from the image to a startup_header data structure (see The startup header).

The image_scan() function assumes that more than one bootable image may be present on the medium, and can compile a list of valid OS images in order to pick the most recent image and return this image's start address. In practice, however, because image_scan() scans only the range you specify with its start and end arguments, and you can specify a small range (e.g., 256 or 512 bytes) in the area on your media where the bootable image should be located, the function won't waste time looking for more than one image.

Returns:

≥0
Success: the start address of the (most recent) valid image found
-1
Failure
Page updated: