Chapter 3 MOTLoad Firmware
Valid Boot Images
Valid boot images whether POST, USER, or MCG, are located on 1MB boundaries within flash. The image may exceed 1MB in size. An image is determined valid through the presence of two "valid image keys" and other sanity checks. A valid boot image begins with a structure as defined in the following table:
Name | Type | Size | Notes |
UserDefined | unsigned integer | 8 | User defined |
|
|
|
|
ImageKey 1 | unsigned integer | 1 | 0x414c5420 |
|
|
|
|
ImageKey 2 | unsigned integer | 1 | 0x424f4f54 |
|
|
|
|
ImageChecksum | unsigned integer | 1 | Image checksum |
|
|
|
|
ImageSize | unsigned integer | 1 | Must be a multiple of 4 |
|
|
|
|
ImageName | unsigned character | 32 | User defined |
|
|
|
|
ImageRamAddress | unsigned integer | 1 | RAM address |
|
|
|
|
ImageOffset | unsigned integer | 1 | Offset from header start to entry |
|
|
|
|
ImageFlags | unsigned integer | 1 | Refer to MOTLoad Image Flags on page 32 |
|
|
|
|
ImageVersion | unsigned integer | 1 | User defined |
|
|
|
|
Reserved | unsigned integer | 8 | Reserved for expansion |
|
|
|
|
Checksum Algorithm
The checksum algorithm is a simple unsigned word add of each word (4 byte) location in the image. The image must be a multiple of 4 bytes in length
Unsigned int checksum(
Unsigned int *startPtr,/* starting address */
Unsigned int endPtr/* ending address */
) {
unsigned int checksum=0; while (startPtr < endPtr) {
checksum += *startPtr; startPtr++;
}
return(checksum);
}
MVME6100 Installation and Use (V6100A/IH2) | 31 |