Question about DTB in Mini-OS on ARM
Hi Ian,
I've turned to arm32 porting of Mini-OS as you suggested. Right now, I've finished most of entry header, which setups an initial page table, saves DTB pointer (from r2 which arm booting protocol defines), setups the stack before jumping to start_kernel, and includes the exception's entry.
At this stage, I could get the DTB's address in arch_init(), parse it and translate it to fill start_info structure Mini-OS used. In order to implement this logic, I was seeking and reading DTB's related codes of arm guest creation and found that the DTB used in domU in arm is thought to be appended with the guest kernel:
/*
* ATAGS/DTB: We currently require that the guest kernel to be
* using CONFIG_ARM_APPENDED_DTB. Ensure that r2 does not look
* like a valid pointer to a set of ATAGS or a DTB. */
In this case, I cannot get the DTB's phys address to fill start_info from r2 currently. Does it means we need to wrap the mini-os kernel together with a DTB?
Any ideas?
Thanks.
Baozi
Quoted 6 lines · Chen Baozi
Hi Ian,
I've turned to arm32 porting of Mini-OS as you suggested. Right now, I've finished most of entry header, which setups an initial page table, saves DTB pointer (from r2 which arm booting protocol defines), setups the stack before jumping to
start_kernel, and includes the exception's entry.
Awesome!
Quoted 12 lines
At this stage, I could get the DTB's address in
arch_init(), parse it and translate it to fillstart_infostructure Mini-OS used. In order to implement this logic, I was seeking and reading DTB's related codes of arm guest creation and found that the DTB used in domU in arm is thought to be appended with the guest kernel:/*
* ATAGS/DTB: We currently require that the guest kernel to be
* usingCONFIG_ARM_APPENDED_DTB. Ensure that r2 does not look
* like a valid pointer to a set of ATAGS or a DTB. */
Quoted 3 lines
In this case, I cannot get the DTB's phys address to fill
start_infofrom r2 currently. Does it means we need to wrap the mini-os kernel together with a DTB?
At the moment yes, this is because we have not yet implemented support in the toolstack for generating (or even accepting a pregenerated binary) a DTB. This is
http://wiki.xen.org/wiki/Xen_ARM_TODO#Autogenerate_DomU.27s_device_trees.
Assuming you don't want to tackle that head on (if you do please let me know!) then the best short term solution is probably to either implement some variant of the APPENDED_DTB strategy or to simply link a DTB into your mini-os kernel.
Ian.