Calculating the size of target images and partitions

To customize the size of an image or partition, you need to modify the following variant-specific configuration file:

%QNX_CAR_DEPLOYMENT%/<board>/<platform>/
sd-boot/config/<platform>-<image_variant>.cfg

Example

The configuration file for omap5uevm-emmc.cfg is as follows:

[disk]
heads=64
sectors_per_track=32
cylinders=3724
sector_size=512

[boot]
path=/dos
type=12
num_sectors=1048576
order=1

[base]
path=/base
type=179
num_sectors=1048576
order=3

[data]
path=/
type=178
num_sectors=4194304
order=4

The [boot] section in the configuration file specifies the first partition. A target image can support at most four partitions.

Calculating the maximum size of a target image

To calculate the total size of the image, you must multiply the values given in the [disk] section of the configuration file.

Note: The disk section doesn't specify a partition; it provides important size information and must appear at the top of the configuration file, before any partitions are specified.
     heads
   x sectors_per_track
   x cylinders
   x sector_size
------------------------------
 total maximum size of image

Therefore, for the OMAP5432 example for the emmc variant above, the maximum size of the image would be 3.9 GB (3.63 GB actual) and would be calculated as follows:

     64 heads
   x 32 sectors_per_track
   x 3724 cylinders
   x 512 sector_size
--------------------------------------
 3904897024 bytes for a total of 3.63 GB for the total maximum size 
 of the image
Note:

Limitations:

  • The total size of all partitions can't exceed the total size of the image.
  • The maximum number of heads is 255.
  • The maximum number of sectors_per_track is 63.

Calculating the size of a partition

To calculate the size of a partition in the example above:

heads x sectors_per_track x cylinders = number_of_sectors
number_of_sectors x sector_size = partition size
64 x 32 x 3724 = 7626752
7626752 x 512 = 3904897024 bytes

Therefore, the size of this specific partition is 3724 MB.