User Tools

Site Tools


dryos:nameservice

Differences

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

Link to this comparison view

dryos:nameservice [2021/02/20 12:07] – created coondryos:nameservice [2021/02/24 22:21] (current) coon
Line 5: Line 5:
  
 The inner workings are not well understood yet and needs some research. The inner workings are not well understood yet and needs some research.
 +
 +Code to dump all registred event functions with function pointer:
 +
 +<code c>
 +typedef struct {
 +  void* pStaticArg;
 +  void* pFunction;
 +} EventProc;
 +
 +typedef struct {
 +  struct EventProcList* pNext;
 +  EventProc* pProc;
 +  char pName[64];
 +} EventProcList;
 +
 +typedef struct {
 +  char* pName;
 +  int numElements;
 +  uint32_t semaphore;
 +  uint32_t numLists;
 +  uint32_t unknown_16;
 +  uint32_t unknown_20;
 +  struct EventProcList* pList;
 +} Service;
 +
 +Service* pService = 0xc80080;
 +
 +uart_printf("Service Name: %s\n", pService->pName);
 +uart_printf("number of lists: %d\n", pService->numLists);
 +
 +int traversedElems = 0;
 +
 +for (int i = 0; i < pService->numLists; ++i) {
 +  EventProcList* pCurListItem = (&pService->pList)[i];
 +
 +  while (pCurListItem) {
 +    uart_printf("[list: %d]: 0x%08X: [%s]\n", i, pCurListItem->pProc->pFunction, pCurListItem->pName);
 +    pCurListItem = pCurListItem->pNext;
 +
 +    ++traversedElems;
 +  }
 +}
 +
 +uart_printf("Expected functions: %d\n", pService->numElements);
 +uart_printf("Items traversed: %d\n", traversedElems);
 +</code>
dryos/nameservice.txt · Last modified: 2021/02/24 22:21 by coon