comparison bootrom.notes @ 17:d2206cb5f8b4

boot ROM re: got through the <w handler
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Thu, 25 Apr 2013 04:07:10 +0000
parents 383a4ef12551
children 123cb5021b64
comparison
equal deleted inserted replaced
16:383a4ef12551 17:d2206cb5f8b4
45 for another '<'. 45 for another '<'.
46 46
47 Commands: 47 Commands:
48 48
49 <a 49 <a
50
51 Seems to be a reset command that throws everything back to the initial state.
52 Does not seem to produce a response.
50 53
51 <b 54 <b
52 55
53 Followed by 4 bytes, giving a 32-bit value in MSB-first order. The value is 56 Followed by 4 bytes, giving a 32-bit value in MSB-first order. The value is
54 written to 80052C, and the 0x2c8 function returns code 6. 57 written to 80052C, and the 0x2c8 function returns code 6.
98 4 bytes: load address for this block (MSB first) 101 4 bytes: load address for this block (MSB first)
99 data 102 data
100 103
101 for a single block (both bytes after <w set to 01), the maximum allowed 104 for a single block (both bytes after <w set to 01), the maximum allowed
102 payload length is 1015 (0x3F7) bytes. 105 payload length is 1015 (0x3F7) bytes.
106
107 The checksum of each block is computed as a simple ripple-carry sum
108 (in a 32-bit ARM register) of:
109 + the word-sized payload byte count from the command
110 + each of the 4 bytes of the load address
111 + constant 5
112 + each byte of the payload data
113
114 The code then takes a one's complement of the least significant byte
115 of the above sum, and adds that (plain ripple-carry addition)
116 to the accum in 800528 (a 16-bit variable).
117
118 Good response: >w
119 Error response: >W <err code byte from 800531>
103 120
104 RAM layout: 121 RAM layout:
105 122
106 800000 7 words: 123 800000 7 words:
107 soft-vector pointers: by default the following 7 words at 124 soft-vector pointers: by default the following 7 words at
153 80052C: 32-bit var init to 0 by 0x11c ('<i' handler) 170 80052C: 32-bit var init to 0 by 0x11c ('<i' handler)
154 word holds the argument of the '<b' command 171 word holds the argument of the '<b' command
155 800530: byte indicates validity of the received '<w' command: 172 800530: byte indicates validity of the received '<w' command:
156 0 means valid, 1 means something bad 173 0 means valid, 1 means something bad
157 init to 0 by 0x11c 174 init to 0 by 0x11c
175 800531: byte error code to return to host as the 3rd (and last) byte
176 of the >W message
177 set to 02 if the 800530 flag was set
178 set to 01 if the 0x730 routine detects bad address
158 179
159 800534: byte initialized to 0x00, then may be set to 1 by the 0xfb4 180 800534: byte initialized to 0x00, then may be set to 1 by the 0xfb4
160 routine if it selects /1 clock mode. 181 routine if it selects /1 clock mode.
161 182
162 8005C0: appears to be the intended low address (bottom) of the stack 183 8005C0: appears to be the intended low address (bottom) of the stack