On 9/4/2024 6:12 PM, Ben McCart wrote:
I have read the manual in section 9.2 about userImageFrames and how to infer the virtual address range for the pages being used for the userland image, which I frankly do not concretely understand. For example, I can take the address of main() and that leads me to believe my first user image frame (page frame actually I suspect) is probably at 0x40000, but it feels like guessing. (Not good!)
In addition, I like to know the address range used for the stack of the initial thread, as well as any other reserved regions (I read somewhere in the manual about reserved virtual address space for the kernel, but I can't remember where I read that and now I can't find it.) Are there any macros included in public header files that I can use in my project to get the starting addresses for any of these regions? Barring that, is there any straight-forward reliable way to find the starting address for these regions (or in the case of kernel reserved virtual address range is it documented anywhere?)
I am on version 12.0 of seL4 for my project.
<snip> I did find the following in boot.c: v_region_t ui_v_reg = { .start = ui_p_reg_start - pv_offset, .end = ui_p_reg_end - pv_offset }; And I found the following in boot.h: void init_kernel( paddr_t ui_p_reg_start, paddr_t ui_p_reg_end, sword_t pv_offset, vptr_t v_entry, paddr_t dtb_addr_p, uint32_t dtb_size #ifdef ENABLE_SMP_SUPPORT , word_t hart_id, word_t core_id #endif What I have not yet found is how the 'ui_p_reg_start' and 'pv_offset' parameters are derived/constructed to make the call to init_kernel().