Convert a binary image into ROM format (QNX)
mkrec [option | imagefilename] …
QNX Neutrino, Linux, Microsoft Windows
The default is srec. When using binary, the file's offset is printed to stderr.
The mkrec utility converts a binary image into either Motorola S records or Intel hex records, which are suitable input for most Flash/EPROM programmers. Most ICEs also expect these formats. The format defaults to Motorola S records but may be changed using the -f format option. Note that the Intel format is limited to 1M offsets.
By default, mkrec assumes the image contains code that is the initial program loader (IPL), which is connected to the power-on reset vector of the processor. The mkrec utility locates the image such that it's placed in the address space where it will end at the reset vector. A record is then output for the reset vector, which will do a 16-bit relative jmp to the start of the image.
The reset vector on an Intel (e.g. 486) processor is located at linear address 0xFFFFFFF0 (16 bytes below 4 Gigabytes). The offsets used for the records by default address this area. It's as though you had a 4-Gigabyte ROM and needed to load code into the top of it. This is what most ICEs expect. If you're sending your output to a small Flash/EPROM programmer, it may wish the offsets to be relocated to the top of the the Flash/EPROM alone. You can do this by using the -s size option.
If the -r option is set, it indicates that the image shouldn't be considered a power-on IPL. The record offsets for the image start at zero; a jmp isn't be programmed at the top of the device. You can use the -o option to change the record offset. Note that you can use the -o option only if you use -r.
For compatibility with most devices that accept these records, each record is limited to a maximum of 32 bytes. You can use the -l option to increase this limit to a maximum of 255 bytes. Larger records have less overhead and result in slightly faster downloads.
The following converts the binary image explr2 into Motorola S records. The offset used in the records starts the image such that it ends at the reset vector 0xFFFFFFF0. A 16-bit relative jmp is programmed at 0xFFFFFFF0 to jmp to the start of the image.
The following converts the binary image ipl into Intel hex records. The offset used in the records starts the image such that it ends at the reset vector in the 256K ROM (0x3FFF0). A 16-bit relative jmp is programmed at 0x3FFF0 to jmp to the start of the image.
mkrec -f i -s 256k ipl
The following converts the binary image notipl into Motorola S records. The offset used in the records starts at 0; a reset vector jmp isn't output.
mkrec -r notipl