280 likes | 418 Views
Multi-OS Project. How to work with Multi-OS. on BF561. Presenter: Tang-Hsun Tu. National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu. ◇ Loader File Structure. ◇ Multi-DXE Loader. ◇ Second Stage Loader. ○ Multi-OS. ○ Communication. ○ Conclusion.
E N D
Multi-OS Project How to work with Multi-OS on BF561 Presenter: Tang-Hsun Tu National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu
◇ Loader File Structure ◇ Multi-DXE Loader ◇ Second Stage Loader ○ Multi-OS ○ Communication ○ Conclusion ○ Further Work • Outlines ○ Introduction National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu
◇ Loader File Structure ◇ Multi-DXE Loader ◇ Second Stage Loader ○ Multi-OS ○ Communication ○ Conclusion ○ Further Work • Outlines ○Introduction National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu
Motivation • a porting uC/OS-II dxe • System Architecture National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu
Motivation (Cont.) National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu
Compiler / Linker / Loader Visual DSP++ .doj(s) .dxe(s) .ldf .o(s) executable .lds Linux National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu
Loader File and Flash National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu
Second Stage Loader Management of Two dxe(s) National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu
◇ Loader File Structure ◇ Multi-DXE Loader ◇ Second Stage Loader ○ Multi-OS ○ Communication ○ Conclusion ○ Further Work • Outlines ○ Introduction National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu
BF561 Multi-DXE Loader National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu
Loader File Structure National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu
10-Byte Header • Address(4 bytes) – the block will be booted within mem • Count(4 bytes) – number of bytes in the block • Flag(2 bytes) – block type and control commands National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu
Loader File With Init -NoSecondStageKernel Single Boot Stream -NoFinalTag National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu
SICA_SYSCR Register How to start coreB ? *pSICA_SYSCR &= 0xFFDF National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu
◇ Loader File Structure ◇ Multi-DXE Loader ◇ Second Stage Loader ○ Multi-OS ○ Communication ○ Conclusion ○ Further Work • Outlines ○ Introduction National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu
Compiler / Linker / Loader Visual DSP++ .doj(s) .dxe(s) .ldf National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu
Linker Section (L2) • L2_sram: map code and data into L2 for non-multicore parts that have L2 SRAM • L2_sram_a: map code and data into the part of L2 memory reserved for core A on a multicore system • L2_sram_b: map code and data into the part of L2 memory reserved for core B on a multicore system • l2_sram: be used on multicore system to map code and data into L2 for parts which have L2 memory • l2_shared: map code and data into the part of L2 memory shared between core A and core B National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu
L2 Share memory section 128K 0xFEB2 0000 l2_shared l2_sram L2 SRAM (64K) 0xFEB1 0000 L2_sram_a L2 SRAM A (32K) 0xFEB0 8000 L2_sram_b L2 SRAM B (32K) 0xFEB0 0000 section L2_sram National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu
Memory Architecture Core A Memory Core B Memory National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu
Memory Architecture (Cont.) L2 Share Memory (128 K) L3 Share Memory (SDRAM)Max is 256 / 512 MB National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu
Linker Section (SDRAM / L3) • 1. sdram0: map code or data into external memory, this can be used to place large, infrequently used data or functions into external memory to free up valuable internal memory. • 2. sdram_bank {0|1|2|3}: other bank National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu
Synchronization API • /* multi-core lock type */ • volatile multi_core_lock_t synlock; • /* initial function */ • void multicore_spin_lock_init_locked(volatile multi_core_lock_t *lockptr); • void multicore_spin_lock_init_unlocked(volatile multi_core_lock_t *lockptr); • /* function */ • void multicore_spin_lock(volatile multi_core_lock_t *lockptr, int cpu_id); • void multicore_spin_unlock(volatile multi_core_lock_t *lockptr); • void multicore_spin_lock_irqsave(volatile multi_core_lock_t *lockptr, int cpu_id); • void multicore_spin_unlock_irqrestore(volatile multi_core_lock_t *lockptr); National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu
◇ Loader File Structure ◇ Multi-DXE Loader ◇ Second Stage Loader ○ Multi-OS ○ Communication ○ Conclusion ○ Further Work • Outlines ○ Introduction National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu
Conclusion • We can run multi-uC/OS-II on BF561 • We can communicate between multicore by L2 share memory National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu
◇ Loader File Structure ◇ Multi-DXE Loader ◇ Second Stage Loader ○ Multi-OS ○ Communication ○ Conclusion ○ Further Work • Outlines ○ Introduction National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu
Further Work • Periodic Task • Distributed Pinwheel Schedule • Synchronization • Other OSes National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu
Question • Execution Time • Floating Point (Sr, DSr) • Distance Constrained National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu
~F&Q~ ~F&Q~ National Taiwan University, Graduate Institute of Networking and Multimedia Tang-Hsun Tu