User Tools

Site Tools



Dryos has some Name Service where objects functions and probably more can be accessed by name.

This is used by call_by_name for example.

The inner workings are not well understood yet and needs some research.

Code to dump all registred event functions with function pointer:

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;
uart_printf("Expected functions: %d\n", pService->numElements);
uart_printf("Items traversed: %d\n", traversedElems);
dryos/nameservice.txt · Last modified: 2021/02/24 22:21 by coon