lib/aos/paging3.c
errval_t paging_init(void)
{
    debug_printf("paging_init\n");
    // TODO (M2): Call paging_init_state for &current
    // TODO (M4): initialize self-paging handler
    // TIP: use thread_set_exception_handler() to setup a page fault handler
    // TIP: Think about the fact that later on, you'll have to make sure that
    // you can handle page faults in any thread of a domain.
    // TIP: it might be a good idea to call paging_init_state() from here to
    // avoid code duplication.
    set_current_paging_state(&current);

    struct capref l1_pt = {
        .cnode = cnode_page,
        .slot = 0,
    };

    struct slot_allocator *default_allocator = get_default_slot_allocator();
    // TODO (M2): Set start_vaddr to the appropriate address
    paging_init_state(&current, (1 << 25), l1_pt, default_allocator); 
    return SYS_ERR_OK;
}
/**
 * \brief This function initializes the paging for this domain
 * It is called once before main.
 */
\brief This function initializes the paging for this domain
It is called once before main.
\ brief This function initializes the paging for this domain It is called once before main .
errval_t paging_init(void)
{
    debug_printf("paging_init\n");
    set_current_paging_state(&current);
    struct capref l1_pt = {
        .cnode = cnode_page,
        .slot = 0,
    };
    struct slot_allocator *default_allocator = get_default_slot_allocator();
    paging_init_state(&current, (1 << 25), l1_pt, default_allocator); 
    return SYS_ERR_OK;
}
errval_t paging_init ( void ) { debug_printf ( " \n " ) ; set_current_paging_state ( & current ) ; struct capref l1_pt = { . cnode = cnode_page , . slot = 0 , } ; struct slot_allocator * default_allocator = get_default_slot_allocator ( ) ; paging_init_state ( & current , ( 1 << 25 ) , l1_pt , default_allocator ) ; return SYS_ERR_OK ; }
\brief This function initializes the paging for this domain
 It is called once before main.
\ brief This function initializes the paging for this domain It is called once before main .
// TODO (M2): Call paging_init_state for &current // TODO (M4): initialize self-paging handler // TIP: use thread_set_exception_handler() to setup a page fault handler // TIP: Think about the fact that later on, you'll have to make sure that // you can handle page faults in any thread of a domain. // TIP: it might be a good idea to call paging_init_state() from here to // avoid code duplication. // TODO (M2): Set start_vaddr to the appropriate address