User Tools

Site Tools


digic:processors:lime

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
digic:processors:lime [2021/03/06 21:13] – created jack001214digic:processors:lime [2021/03/16 12:01] (current) coon
Line 2: Line 2:
 Lime core is the networking processor which was found to be present in DIGIC 7 and above. The main motive behind this was to ease debugging by using a network-based debugger [[https://github.com/CheckPointSW/Scout|Scout]] which can possibly run on the camera. Lime core is the networking processor which was found to be present in DIGIC 7 and above. The main motive behind this was to ease debugging by using a network-based debugger [[https://github.com/CheckPointSW/Scout|Scout]] which can possibly run on the camera.
  
-All the investigations below were done under 200D(SL2) at version 1.0.1.+All the investigations below were done under 200D (SL2) at version 1.0.1.
  
 +[[https://en.wikipedia.org/wiki/ESP32|ESP32]] 
 ==== LIME Shell ==== ==== LIME Shell ====
-The networking processor was found to have a dryos implementation with an interactive shell which can be accessed from the ICU through UART. +The networking processor was found to have a DryOS implementation with an interactive shell which can be accessed from the ICU through UART. 
-Now before accessing it, the lime core needs to be powered on. This can simply be done from the canon GUI where the WIFI can be enabled from(WPS led blinking).+Now before accessing it, the Lime core needs to be powered on. This can simply be done from the Canon GUI where the WIFI can be enabled (WPS led blinking).
 Interestingly enough a new category is added to the ICU dry shell help command(''?'') named ''NetDomain'' when the networking processor is on. Interestingly enough a new category is added to the ICU dry shell help command(''?'') named ''NetDomain'' when the networking processor is on.
 <code> <code>
Line 22: Line 23:
 ... ...
 </code> </code>
-This log most likely showed the interactions from the ICU to the LIME core on the lower level as it was filled with ''leave_drv'' and ''enter_drv'' messages and nothing more.+This log most likely showed the interactions from the ICU to the Lime core on the lower level as it was filled with ''leave_drv'' and ''enter_drv'' messages and nothing more.
  
 Now from the dry shell(ICU), executing ''uart_change'' when LIME was active changed the shell from ''Dry[MusaPUX]>'' to ''Dry[LIME]>''. Now from the dry shell(ICU), executing ''uart_change'' when LIME was active changed the shell from ''Dry[MusaPUX]>'' to ''Dry[LIME]>''.
Line 56: Line 57:
 |ram:0x01800730  | Ram segment start| LIME |0x431063| |ram:0x01800730  | Ram segment start| LIME |0x431063|
 ==== Musa(ICU) & LIME communication ==== ==== Musa(ICU) & LIME communication ====
-''PComNetSocket'' is the 'api' which transfers commands from the ICU to LIME and vice versa.+''PComNetSocket'' is the 'api' which transfers commands from the ICU to Lime and vice versa.
  
-Every registered function which can be called from the ICU to LIME has the prefix of ''Invoke'' in LIME.+Every registered function which can be called from the ICU to Lime has the prefix of ''Invoke'' in Lime.
 === Lime ===  === Lime === 
 Approximately 53 functions can be 'invoked' the from ICU from the ''PComNetSocket'' API for the ''CommonSyncWrite'' table. Approximately 53 functions can be 'invoked' the from ICU from the ''PComNetSocket'' API for the ''CommonSyncWrite'' table.
  
-There are multiple tables but ''CommonSyncWrite'' is the most useful one since it exposes **some** of the the higher level sockets.+There are multiple tables but ''CommonSyncWrite'' is the most useful one since it exposes **some** of the higher level sockets.
  
 Every function which can be called is on a table at **0x01a9f9a5**(CommonSyncWrite) and the first one being ''InvokeSocket''. Every function which can be called is on a table at **0x01a9f9a5**(CommonSyncWrite) and the first one being ''InvokeSocket''.
Line 79: Line 80:
 |ram:01a9f9c5|c8 0a 02 a0|9|InvokeSendto| |ram:01a9f9c5|c8 0a 02 a0|9|InvokeSendto|
  
-=== Musa(ICU) === +=== Musa (ICU) === 
-function **FUN_E07146B8** takes in three parameters which apparently lookup the table on the lime core and processes the function on the lime core and returns the result back to the ICU.+function **FUN_E07146B8** takes in three parameters which apparently lookup the table on the Lime coreprocesses the function on the Lime core and returns the result back to the ICU.
  
 <code>FUN_E07146B8(int index,int *parameterArray,int parameterArraySize)</code> <code>FUN_E07146B8(int index,int *parameterArray,int parameterArraySize)</code>
  
-Canon already has many 'filler' functions for LIME functions which should be called instead and they can be found by looking up the xrefs of **0xe07146b8** with the parameters passed in.+Canon already has many 'filler' functions for Lime functions which should be called instead and they can be found by looking up the xrefs of **0xe07146b8** with the parameters passed in.
  
 For example ''socket_bind'' which is ''InvokeBindConnectCommon'' with an index of ''2'' is passed to **0xe07146b8** like this: For example ''socket_bind'' which is ''InvokeBindConnectCommon'' with an index of ''2'' is passed to **0xe07146b8** like this:
Line 92: Line 93:
  
 Here are the common networking stubs found: Here are the common networking stubs found:
-^     Networking stubs for 200D 1.0.1   ^^^ +^     Networking stubs for 200D 1.0.1   ^^^^ 
-^Address ^Name ^Info^  +^Address ^Name ^Signatures ^Info^  
-|0xe0110cc4|socket_convertfd|(found from xrefs of FUN_E07146B8)| +|0xe0110cc4|socket_convertfd|int socket_convertfd(int sockfd) |(found from xrefs of FUN_E07146B8)| 
-|0xe071d880|socket_create|translation from ICU to lime is needed with resolvesock+|0xe071d880|socket_create|int socket_create(int domain, int type, int protocol); |translation from ICU to lime is needed with socket_convertfd
-|0xe071d8b8|socket_bind|found from index, CommonSyncWrite| +|0xe071d8b8|socket_bind|int socket_bind(int sockfd, void *addr, int addrlen) |found from index, CommonSyncWrite| 
-|0xe071d8f2|socket_connect|found from index, CommonSyncWrite| +|0xe071d8f2|socket_connect|int socket_connect(int sockfd, void *addr, int addrlen) |found from index, CommonSyncWrite| 
-|0xe071d92c|socket_listen|found from index, CommonSyncWrite| +|0xe071d92c|socket_listen|int socket_listen(int sockfd, int backlogl) |found from index, CommonSyncWrite| 
-|0xe071d960|socket_accept|found from rpc_accept| +|0xe071d960|socket_accept|int socket_accept(int sockfd, void *addr, int addrlen) |found from rpc_accept| 
-|0xe071d99a|socket_recv|found from 'rpc_recv'| +|0xe071d99a|socket_recv|int socket_recv(int sockfd, void *buf, int len, int flags) |found from 'rpc_recv'
-|0xe071d9d8|socket_recvfrom|found from 'rpc_recvfrom'| +|0xe071da20|socket_send|socket_send(int sockfdvoid *buf, int len, int flags) |found from index, CommonSyncWrite| 
-|0xe071da20|socket_send|found from indexCommonSyncWrite| +|0xe071da80|socket_setsockopt|socket_setsockopt(int socket, int level, int option_name, const void *option_value, int option_len) |found from 'rpc_setsockopt'
-|0xe071da3a|socket_sendto|found from index, CommonSyncWrite| +|0xe071db7a|socket_shutdown|socket_shutdown(int sockfd, int flag) |found from index, CommonSyncWrite
-|0xe071da80|socket_setsockopt|found from 'rpc_setsockopt'+|0xe0714a20|socket_close|socket_close(int sockfd) |found from index, CommonSyncWrite. needs converted fd
-|0xe071dac4|socket_getsockopt|found from 'rpc_getsockopt'+|0xe010608e|socket_select_caller| socket_select_caller(int convertedsock, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)|found from 'rpc_select' ****|
-|0xe071db7a|socket_shutdown|found from index, CommonSyncWrite| +
-|0xe010608e|socket_select_caller|found from 'rpc_select' ****|+
  
 ''socket_select_caller'' is not the actual socket_select function since this function needs the descriptors to be converted by the ''socket_convertfd'' function and the ''fd_set'' used must also be converted by ''socket_convertfd''. ''socket_select_caller'' is not the actual socket_select function since this function needs the descriptors to be converted by the ''socket_convertfd'' function and the ''fd_set'' used must also be converted by ''socket_convertfd''.
Line 147: Line 146:
 </code> </code>
 ==== Misc ==== ==== Misc ====
 +^   Socket  ^^^
 +^Option^Value^Info^
 +|AF_INET    |0x1|Internet IP Protocol|
 +|SOCK_STREAM|0x1|TCP Protocol        |
 +
 ^   Socket Options   ^^^ ^   Socket Options   ^^^
 ^Option^Value^Info^ ^Option^Value^Info^
 |SOL_SOCKET|0xffff|options at the socket level| |SOL_SOCKET|0xffff|options at the socket level|
 |SO_REUSEADDR| 0x2|allow reuse of local addresses| |SO_REUSEADDR| 0x2|allow reuse of local addresses|
 +
 +''socket_bind'' and ''socket_connect'' takes in three parameters. The array which is passed in should look like this:
 +<code>
 +char sockaddr[8];
 +
 +// 1 = IPv4, 2 = IPv6, 3 = Ethernet
 +sockaddr[0] = 0x00;
 +sockaddr[1] = 0x01;
 +
 +// port 25565
 +sockaddr[2] = 0x63; // low byte
 +sockaddr[3] = 0xdd; // high byte
 +
 +// ip address: 192.168.10.22
 +sockaddr[4] = 192;
 +sockaddr[5] = 168;
 +sockaddr[6] = 10;
 +sockaddr[7] = 22;
 +</code>
 +<code>
 +socket_bind(sock,sockaddr, 0x8)
 +socket_connect(sock,sockaddr, 0x8)
 +</code>
 +
 +
 +
  
digic/processors/lime.1615061621.txt.gz · Last modified: 2021/03/06 21:13 by jack001214