<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://xinu.cs.mu.edu/index.php?action=history&amp;feed=atom&amp;title=TRX_header</id>
	<title>TRX header - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://xinu.cs.mu.edu/index.php?action=history&amp;feed=atom&amp;title=TRX_header"/>
	<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=TRX_header&amp;action=history"/>
	<updated>2026-06-15T16:16:25Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=TRX_header&amp;diff=3849&amp;oldid=prev</id>
		<title>Kpersohn at 20:45, 16 June 2011</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=TRX_header&amp;diff=3849&amp;oldid=prev"/>
		<updated>2011-06-16T20:45:51Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 20:45, 16 June 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l31&quot; &gt;Line 31:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 31:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;It is common to see an additional 32 byte header prepended to the TRX image as a way to tag certain firmware images specific to a particular hardware platform. The first 4 bytes correspond to an ASCII &amp;quot;Code Pattern&amp;quot; that makes this identification.  For example, the WRT54G series routers (including the [[WRT54GL]]) contain the characters &amp;lt;tt&amp;gt;W54G&amp;lt;/tt&amp;gt; as the first field in this additional header. Some methods of writing to flash, such as the Linksys Web GUI and TFTP, check for this pattern before actually writing the firmware. The flash process will error out when attempting to flash a router without the correct code pattern using these methods. When the code pattern header is present, filenames traditionally have the &amp;lt;tt&amp;gt;.bin&amp;lt;/tt&amp;gt; extension instead of &amp;lt;tt&amp;gt;.trx&amp;lt;/tt&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;It is common to see an additional 32 byte header prepended to the TRX image as a way to tag certain firmware images specific to a particular hardware platform. The first 4 bytes correspond to an ASCII &amp;quot;Code Pattern&amp;quot; that makes this identification.  For example, the WRT54G series routers (including the [[WRT54GL]]) contain the characters &amp;lt;tt&amp;gt;W54G&amp;lt;/tt&amp;gt; as the first field in this additional header. Some methods of writing to flash, such as the Linksys Web GUI and TFTP, check for this pattern before actually writing the firmware. The flash process will error out when attempting to flash a router without the correct code pattern using these methods. When the code pattern header is present, filenames traditionally have the &amp;lt;tt&amp;gt;.bin&amp;lt;/tt&amp;gt; extension instead of &amp;lt;tt&amp;gt;.trx&amp;lt;/tt&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Our TRX image creation process for Xinu uses the [[https://dev.openwrt.org/browser/trunk/tools/firmware-utils/src/addpattern.c addpattern]] utility from [[&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;OpenWrt&lt;/del&gt;]] to add the correct pattern to our TRX file. This utility also supports additional fields in the code pattern header: dates, versions, board ID, and flags.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Our TRX image creation process for Xinu uses the [[https://dev.openwrt.org/browser/trunk/tools/firmware-utils/src/addpattern.c addpattern]] utility from [[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;OpenWRT&lt;/ins&gt;]] to add the correct pattern to our TRX file. This utility also supports additional fields in the code pattern header: dates, versions, board ID, and flags.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Kpersohn</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=TRX_header&amp;diff=3848&amp;oldid=prev</id>
		<title>Kpersohn: /* Code Pattern */</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=TRX_header&amp;diff=3848&amp;oldid=prev"/>
		<updated>2011-06-16T20:45:21Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Code Pattern&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 20:45, 16 June 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l31&quot; &gt;Line 31:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 31:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;It is common to see an additional 32 byte header prepended to the TRX image as a way to tag certain firmware images specific to a particular hardware platform. The first 4 bytes correspond to an ASCII &amp;quot;Code Pattern&amp;quot; that makes this identification.  For example, the WRT54G series routers (including the [[WRT54GL]]) contain the characters &amp;lt;tt&amp;gt;W54G&amp;lt;/tt&amp;gt; as the first field in this additional header. Some methods of writing to flash, such as the Linksys Web GUI and TFTP, check for this pattern before actually writing the firmware. The flash process will error out when attempting to flash a router without the correct code pattern using these methods. When the code pattern header is present, filenames traditionally have the &amp;lt;tt&amp;gt;.bin&amp;lt;/tt&amp;gt; extension instead of &amp;lt;tt&amp;gt;.trx&amp;lt;/tt&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;It is common to see an additional 32 byte header prepended to the TRX image as a way to tag certain firmware images specific to a particular hardware platform. The first 4 bytes correspond to an ASCII &amp;quot;Code Pattern&amp;quot; that makes this identification.  For example, the WRT54G series routers (including the [[WRT54GL]]) contain the characters &amp;lt;tt&amp;gt;W54G&amp;lt;/tt&amp;gt; as the first field in this additional header. Some methods of writing to flash, such as the Linksys Web GUI and TFTP, check for this pattern before actually writing the firmware. The flash process will error out when attempting to flash a router without the correct code pattern using these methods. When the code pattern header is present, filenames traditionally have the &amp;lt;tt&amp;gt;.bin&amp;lt;/tt&amp;gt; extension instead of &amp;lt;tt&amp;gt;.trx&amp;lt;/tt&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Our TRX image creation process for Xinu uses the [[https://dev.openwrt.org/browser/trunk/tools/firmware-utils/src/addpattern.c&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;|&lt;/del&gt;addpattern]] utility from [[OpenWrt]] to add the correct pattern to our TRX file. This utility also supports additional fields in the code pattern header: dates, versions, board ID, and flags.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Our TRX image creation process for Xinu uses the [[https://dev.openwrt.org/browser/trunk/tools/firmware-utils/src/addpattern.c addpattern]] utility from [[OpenWrt]] to add the correct pattern to our TRX file. This utility also supports additional fields in the code pattern header: dates, versions, board ID, and flags.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Kpersohn</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=TRX_header&amp;diff=3847&amp;oldid=prev</id>
		<title>Kpersohn at 20:44, 16 June 2011</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=TRX_header&amp;diff=3847&amp;oldid=prev"/>
		<updated>2011-06-16T20:44:47Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 20:44, 16 June 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l27&quot; &gt;Line 27:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 27:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;After the TRX header, the data section begins.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;After the TRX header, the data section begins.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=Code Pattern=&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;It is common to see an additional 32 byte header prepended to the TRX image as a way to tag certain firmware images specific to a particular hardware platform. The first 4 bytes correspond to an ASCII &amp;quot;Code Pattern&amp;quot; that makes this identification.  For example, the WRT54G series routers (including the [[WRT54GL]]) contain the characters &amp;lt;tt&amp;gt;W54G&amp;lt;/tt&amp;gt; as the first field in this additional header. Some methods of writing to flash, such as the Linksys Web GUI and TFTP, check for this pattern before actually writing the firmware. The flash process will error out when attempting to flash a router without the correct code pattern using these methods. When the code pattern header is present, filenames traditionally have the &amp;lt;tt&amp;gt;.bin&amp;lt;/tt&amp;gt; extension instead of &amp;lt;tt&amp;gt;.trx&amp;lt;/tt&amp;gt;.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Our TRX image creation process for Xinu uses the [[https://dev.openwrt.org/browser/trunk/tools/firmware-utils/src/addpattern.c|addpattern]] utility from [[OpenWrt]] to add the correct pattern to our TRX file. This utility also supports additional fields in the code pattern header: dates, versions, board ID, and flags.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Kpersohn</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=TRX_header&amp;diff=3477&amp;oldid=prev</id>
		<title>Michael: Created TRX header page</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=TRX_header&amp;diff=3477&amp;oldid=prev"/>
		<updated>2009-07-29T18:33:23Z</updated>

		<summary type="html">&lt;p&gt;Created TRX header page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;TRX is the format used to store kernel images in [[Flash memory]] for [[CFE]] based (and possibly others) routers.  Unfortunately, not much is known about the format or what limitations and rules exist.  Currently, [[Embedded Xinu]] uses a simple utility from the [[OpenWRT]] repository to build TRX images.  However, the quality of our TRX images seems to vary between revisions of the operating system.  We do not yet know why.  Possible reasons include:&lt;br /&gt;
&lt;br /&gt;
* alignment problems,&lt;br /&gt;
* compression/extraction problems,&lt;br /&gt;
* incorrectly configuration at startup (differences between TFTP booting and booting from Flash), or a&lt;br /&gt;
* combination of above and some unknown problem.&lt;br /&gt;
&lt;br /&gt;
What we do know is the format of the 28 byte TRX header, it is as follows:&lt;br /&gt;
&lt;br /&gt;
  0                   1                   2                   3   &lt;br /&gt;
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 &lt;br /&gt;
 +---------------------------------------------------------------+&lt;br /&gt;
 |                     magic number ('HDR0')                     |&lt;br /&gt;
 +---------------------------------------------------------------+&lt;br /&gt;
 |                  length (header size + data)                  |&lt;br /&gt;
 +---------------+---------------+-------------------------------+&lt;br /&gt;
 |                       32-bit CRC value                        |&lt;br /&gt;
 +---------------+---------------+-------------------------------+&lt;br /&gt;
 |           TRX flags           |          TRX version          |&lt;br /&gt;
 +-------------------------------+-------------------------------+&lt;br /&gt;
 |                      Partition offset[0]                      |&lt;br /&gt;
 +---------------------------------------------------------------+&lt;br /&gt;
 |                      Partition offset[1]                      |&lt;br /&gt;
 +---------------------------------------------------------------+&lt;br /&gt;
 |                      Partition offset[2]                      |&lt;br /&gt;
 +---------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
After the TRX header, the data section begins.&lt;/div&gt;</summary>
		<author><name>Michael</name></author>
		
	</entry>
</feed>