void jt_init() { lh_init(LayoutChromaticFixed); sth_init(); ksh_init(); th_init(); setup_defaults(); update_ui(); }
int main() { uint32 pkt[32]; uint32 sz; printf("[dconsole] initialized\n"); tps = getTicksPerSecond(); /* initialize v-messages structure */ vmsg_init(&vmsgs); lh_init(); lh_setdbgname("dconsole"); lh_setoptarg(0); lh_setpktarrived(&main_pktarrived); lh_setlinkreq(&main_linkreq); lh_setlinkdropped(&main_linkdropped); lh_setlinkestablished(&main_linkestablished); lh_setkmsg(&main_kmsg); sz = sizeof(pkt); pkt[0] = KMSG_ENUMSERVICE; pkt[1] = 0x11223344; pkt[2] = KSERVICE_DIRECTORY; while (1) { printf("[dconsole] sleeping for enum req reply\n"); er_waworr(&__corelib_tx, &__corelib_rx, &pkt[0], 5 * 4, 1, pkt[1], tps * 30); printf(" looking for reply packet - pkt[0]:%x pkt[1]:%x\n", pkt[0], pkt[1]); if (pkt[0] == KMSG_ENUMSERVICEREPLY && pkt[3] != 0) { printf(" got directory service at %x:%x\n", pkt[3], pkt[4]); /* establish connection to directory service */ dirproc = pkt[3]; dirthread = pkt[4]; break; } } /* request link to remote directory service */ if (!lh_establishlink(dirproc, dirthread, IPC_PROTO_ER, 2048, 2048, 16 * 4, 16 * 4, 0x12345678)) { printf("[dconsole] establish link failed\n"); return -1; } printf("[dconsole] going into main loop\n"); while (1) { lh_tick(); lh_sleep(0); } return 1; }