mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-13 02:58:57 +00:00
rework note about endianity
This commit is contained in:
parent
4b9d3bffc6
commit
250e35348e
@ -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 |
|
||||
|
10
docs/toif.md
10
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 |
|
||||
|----|----|----|----|----|----|---|---|---|---|---|---|---|---|---|---|
|
||||
|
Loading…
Reference in New Issue
Block a user