예제 #1
0
파일: init.c 프로젝트: seL4/refos
void
refos_initialise_timer(void)
{
    /* Temporarily use seL4_DebugPutChar before printf is set up. On release kernel this will
       do nothing. */
    refos_seL4_debug_override_stdout();

    /* We first initialise the cspace allocator statically, as MMap and heap (which malloc 
       depend on) needs this. */
    csalloc_init_static(PROCCSPACE_ALLOC_REGION_START, PROCCSPACE_ALLOC_REGION_END,
            _refosUtilCSpaceStatic, REFOS_UTIL_CSPACE_STATIC_SIZE);

    /* Initialise dynamic MMap and heap. */
    refosio_init_morecore(refos_static_param_procinfo());

    /* Initialise userspace allocator helper libraries. */
    walloc_init(PROCESS_WALLOC_START, PROCESS_WALLOC_END);

    /* Write to the STDIO output device. */
    refos_override_stdio(NULL, NULL);
    refos_setup_dataspace_stdio(REFOS_DEFAULT_STDIO_DSPACE);

    /* Initialise file descriptor table. */
    filetable_init_default();

    /* Initialise default environment variables. */
    _refosEnv[0] = NULL;
    __environ = _refosEnv;
    setenv("SHELL", "/fileserv/terminal", true);
    setenv("PWD", "/", true);
    #ifdef CONFIG_REFOS_TIMEZONE
        setenv("TZ", CONFIG_REFOS_TIMEZONE, true);
    #endif
}
예제 #2
0
파일: file_server.c 프로젝트: gapry/RefOS-1
/*! @brief Main CPIO file server entry point. */
int
main() {
    SET_MUSLC_SYSCALL_TABLE;
    seL4_DebugPrintf("hi, I'm in file_server main!\n");
    refosio_setup_morecore_override(mmapRegion, MMAP_SIZE);
    seL4_DebugPrintf("hi, I'm in file_server main2!\n");
    refos_initialise_os_minimal();
    seL4_DebugPrintf("hi, I'm in file_server main3!\n");
    refos_setup_dataspace_stdio(REFOS_DEFAULT_STDIO_DSPACE);
    seL4_DebugPrintf("hi, I'm in file_server main4!\n");

    fileserv_init();
    seL4_DebugPrintf("hi, I'm in file_server main5!\n");
    fileserv_mainloop();
    seL4_DebugPrintf("hi, I'm in file_server main6!\n");

    return 0;
}