int main(int argc, char **argv) { pvr_init_defaults(); printf("kosh starting\n"); /* initialize the conio service */ conio_init(CONIO_TTY_PVR, CONIO_INPUT_LINE); // conio_init(CONIO_TTY_SERIAL, CONIO_INPUT_LINE); /* initialize kosh */ kosh_init(); /* Add a test builtin */ kosh_builtin_add("test", "This is a test command.", test_builtin); /* wait for the user to exit */ kosh_join(); /* shutdown kosh */ kosh_shutdown(); /* shutdown console i/o */ conio_shutdown(); printf("kosh is done\n"); return 0; }
int main(int argc,char* argv[]) { dj_vm * vm; dj_object * obj; conio_init(); // initialise timer dj_timer_init(); initLed(); // initialise memory manager dj_mem_init(mem, HEAPSIZE); // Create a new VM vm = dj_vm_create(); // tell the execution engine to use the newly created VM instance dj_exec_setVM(vm); dj_named_native_handler handlers[] = { { "base", &base_native_handler }, { "darjeeling2", &darjeeling2_native_handler }, }; int length = sizeof(handlers)/ sizeof(handlers[0]); dj_archive archive; archive.start = (dj_di_pointer)di_archive_data; archive.end = (dj_di_pointer)di_archive_data_end; dj_vm_loadInfusionArchive(vm, &archive, handlers, length); // pre-allocate an OutOfMemoryError object obj = dj_vm_createSysLibObject(vm, BASE_CDEF_java_lang_OutOfMemoryError); dj_mem_setPanicExceptionObject(obj); // start the main execution loop while (dj_vm_countLiveThreads(vm)>0) { dj_vm_schedule(vm); if (vm->currentThread!=NULL) if (vm->currentThread->status==THREADSTATUS_RUNNING) dj_exec_run(RUNSIZE); } dj_vm_schedule(vm); dj_mem_gc(); dj_vm_destroy(vm); conio_shutdown(); return 0; }
/* get all our abi's and then start our main loop */ int main(int argc, char **argv) { pvr_init_defaults(); printf("kosh starting\n"); /* initalize the conio service */ //conio_init(CONIO_TTY_PVR, CONIO_INPUT_LINE); conio_init(CONIO_TTY_SERIAL, CONIO_INPUT_LINE); conio_printf(" **** KOSH v1.4, The KallistiOS Shell ****\n"); /* change directory to the default */ chdir("/"); /* this is the meat */ while (!kosh_exit) input_oneloop(); /* shutdown console i/o */ conio_shutdown(); printf("kosh is done\n"); return 0; }