diff --git a/docs/bootloader.md b/docs/bootloader.md index aeba4347..634cd8a9 100644 --- a/docs/bootloader.md +++ b/docs/bootloader.md @@ -1,6 +1,8 @@ #TREZOR OS Bootloader -##Firmware file format +All multibyte integer values are big endian! + +##Firmware File Format TREZOR OS firmware file consists of 3 parts: @@ -13,7 +15,7 @@ TREZOR OS firmware file consists of 3 parts: | offset | length | name | description | |-------:|-------:|------|-------------| | 0x0000 | 4 | magic | firmware magic `TRZV` | -| 0x0004 | 4 | hlen | length of the vendor header (big endian) | +| 0x0004 | 4 | hlen | length of the vendor header | | 0x0008 | 1 | vsig_m | number of signatures needed to run the firmware from this vendor | | 0x0009 | 1 | vsig_n | number of pubkeys vendor wants to use for signing | | 0x000A | 1 | vstr_len | vendor string length | diff --git a/docs/toif.md b/docs/toif.md index 9535d4b2..cd6b9e84 100644 --- a/docs/toif.md +++ b/docs/toif.md @@ -1,14 +1,16 @@ #TREZOR Optimized Image Format +All multibyte integer values are big endian! + ##Header | offset | length | name | description | |-------:|-------:|------|-------------| | 0x0000 | 3 | magic | `TOI` | | 0x0003 | 1 | fmt | data format: `f` or `g` (see below) | -| 0x0004 | 2 | width | width of the image (big endian) | -| 0x0006 | 2 | height | height of the image (big endian) | -| 0x0008 | 4 | datasize | length of the compressed data (big endian) | +| 0x0004 | 2 | width | width of the image | +| 0x0006 | 2 | height | height of the image | +| 0x0008 | 4 | datasize | length of the compressed data | | 0x000A | ? | data | compressed data (see below) | ##Format @@ -20,7 +22,7 @@ TOI currently supports 2 variants: ###Full-color -For each pixel a big endian 16-bit value is used. First 5 bits are used for red component, next 6 bits are green, final 5 bits are blue, so it looks like this: +For each pixel a 16-bit value is used. First 5 bits are used for red component, next 6 bits are green, final 5 bits are blue, so it looks like this: | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |----|----|----|----|----|----|---|---|---|---|---|---|---|---|---|---|