Ejemplo n.º 1
0
Archivo: init.c Proyecto: 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
}
Ejemplo n.º 2
0
/*! @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;
}