1 / 28
Multi-OS Project Multi-OS Project
National Taiwan University, Graduate Institute of Networking and MultimediaTang-Hsun Tu
Presenter: Tang-Hsun Tu
How to work with Multi-OSHow to work with Multi-OSon BF561on BF561
2 / 28
◇ Loader File Structure
Outlines Outlines
○ Introduction
◇ Multi-DXE Loader
○ Multi-OS
○ Communication
National Taiwan University, Graduate Institute of Networking and MultimediaTang-Hsun Tu
○ Conclusion
○ Further Work
◇ Second Stage Loader
3 / 28
◇ Loader File Structure
Outlines Outlines
○ Introduction
◇ Multi-DXE Loader
○ Multi-OS
○ Communication
National Taiwan University, Graduate Institute of Networking and MultimediaTang-Hsun Tu
○ Conclusion
○ Further Work
◇ Second Stage Loader
4 / 28National Taiwan University, Graduate Institute of Networking and Multimedia
Tang-Hsun Tu
Motivation Motivation
1. a porting uC/OS-II dxe
2. System Architecture
5 / 28National Taiwan University, Graduate Institute of Networking and Multimedia
Tang-Hsun Tu
Motivation (Cont.) Motivation (Cont.)
6 / 28National Taiwan University, Graduate Institute of Networking and Multimedia
Tang-Hsun Tu
Compiler / Linker / Loader Compiler / Linker / Loader
.o(s).lds
.ldf
executable
.doj(s) .dxe(s)
Visual DSP++
Linux
7 / 28National Taiwan University, Graduate Institute of Networking and Multimedia
Tang-Hsun Tu
Loader File and Flash Loader File and Flash
8 / 28National Taiwan University, Graduate Institute of Networking and Multimedia
Tang-Hsun Tu
Second Stage Loader Second Stage Loader
Management of Two dxe(s)
9 / 28
◇ Loader File Structure
Outlines Outlines
○ Introduction
◇ Multi-DXE Loader
○ Multi-OS
○ Communication
National Taiwan University, Graduate Institute of Networking and MultimediaTang-Hsun Tu
○ Conclusion
○ Further Work
◇ Second Stage Loader
10 / 28National Taiwan University, Graduate Institute of Networking and Multimedia
Tang-Hsun Tu
BF561 Multi-DXE Loader BF561 Multi-DXE Loader
11 / 28National Taiwan University, Graduate Institute of Networking and Multimedia
Tang-Hsun Tu
Loader File Structure Loader File Structure
12 / 28National Taiwan University, Graduate Institute of Networking and Multimedia
Tang-Hsun Tu
1. Address(4 bytes) – the block will be booted within mem
2. Count(4 bytes) – number of bytes in the block
3. Flag(2 bytes) – block type and control commands
10-Byte Header 10-Byte Header
13 / 28National Taiwan University, Graduate Institute of Networking and Multimedia
Tang-Hsun Tu
Loader File With Init Loader File With Init
-NoFinalTag
Single Boot Stream
-NoSecondStageKernel
14 / 28
SICA_SYSCR Register SICA_SYSCR Register
National Taiwan University, Graduate Institute of Networking and MultimediaTang-Hsun Tu
How to start coreB ?
*pSICA_SYSCR &= 0xFFDF
15 / 28
◇ Loader File Structure
Outlines Outlines
○ Introduction
◇ Multi-DXE Loader
○ Multi-OS
○ Communication
National Taiwan University, Graduate Institute of Networking and MultimediaTang-Hsun Tu
○ Conclusion
○ Further Work
◇ Second Stage Loader
16 / 28National Taiwan University, Graduate Institute of Networking and Multimedia
Tang-Hsun Tu
Compiler / Linker / Loader Compiler / Linker / Loader
.ldf.doj(s) .dxe(s)
Visual DSP++
17 / 28
Linker Section (L2)Linker Section (L2)
National Taiwan University, Graduate Institute of Networking and MultimediaTang-Hsun Tu
1. L2_sram: map code and data into L2 for non-multicore parts that have L2 SRAM
2. L2_sram_a: map code and data into the part of L2 memory reserved for core A on a multicore system
3. L2_sram_b: map code and data into the part of L2 memory reserved for core B on a multicore system
4. l2_sram: be used on multicore system to map code and data into L2 for parts which have L2 memory
5. l2_shared: map code and data into the part of L2 memory shared between core A and core B
18 / 28
L2 Share memoryL2 Share memory
National Taiwan University, Graduate Institute of Networking and MultimediaTang-Hsun Tu
0xFEB0 0000
0xFEB2 0000
0xFEB1 0000
0xFEB0 8000L2 SRAM A (32K)
L2 SRAM (64K)
L2_sram_b
L2_sram_a
l2_shared
l2_sram
section
L2_sramsection
128K
L2 SRAM B (32K)
19 / 28
Memory ArchitectureMemory Architecture
National Taiwan University, Graduate Institute of Networking and MultimediaTang-Hsun Tu
Core A Memory
Core B Memory
20 / 28
Memory Architecture (Cont.)Memory Architecture (Cont.)
National Taiwan University, Graduate Institute of Networking and MultimediaTang-Hsun Tu
L2 Share Memory (128 K)
L3 Share Memory (SDRAM)Max is 256 / 512 MB
21 / 28
Linker Section (SDRAM / L3)Linker Section (SDRAM / L3)
National Taiwan University, Graduate Institute of Networking and MultimediaTang-Hsun Tu
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
22 / 28
Synchronization API Synchronization API
National Taiwan University, Graduate Institute of Networking and MultimediaTang-Hsun Tu
/* multi-core lock type */volatile multi_core_lock_t synlock;
/* initial function */1. void multicore_spin_lock_init_locked(volatile multi_core_lock_t *loc
kptr);2. void multicore_spin_lock_init_unlocked(volatile multi_core_lock_t *l
ockptr);
/* function */1. void multicore_spin_lock(volatile multi_core_lock_t *lockptr, int cp
u_id);2. void multicore_spin_unlock(volatile multi_core_lock_t *lockptr);3. void multicore_spin_lock_irqsave(volatile multi_core_lock_t *lockptr,
int cpu_id);4. void multicore_spin_unlock_irqrestore(volatile multi_core_lock_t *lo
ckptr);
23 / 28
◇ Loader File Structure
Outlines Outlines
○ Introduction
◇ Multi-DXE Loader
○ Multi-OS
○ Communication
National Taiwan University, Graduate Institute of Networking and MultimediaTang-Hsun Tu
○ Conclusion
○ Further Work
◇ Second Stage Loader
24 / 28
Conclusion Conclusion
National Taiwan University, Graduate Institute of Networking and MultimediaTang-Hsun Tu
1. We can run multi-uC/OS-II on BF561
2. We can communicate between multicore by L2 share memory
25 / 28
◇ Loader File Structure
Outlines Outlines
○ Introduction
◇ Multi-DXE Loader
○ Multi-OS
○ Communication
National Taiwan University, Graduate Institute of Networking and MultimediaTang-Hsun Tu
○ Conclusion
○ Further Work
◇ Second Stage Loader
26 / 28
Further Work Further Work
National Taiwan University, Graduate Institute of Networking and MultimediaTang-Hsun Tu
1. Periodic Task
2. Distributed Pinwheel Schedule
3. Synchronization
4. Other OSes
27 / 28
Question Question
National Taiwan University, Graduate Institute of Networking and MultimediaTang-Hsun Tu
1. Execution Time
2. Floating Point (Sr, DSr)
3. Distance Constrained
28 / 28National Taiwan University, Graduate Institute of Networking and Multimedia
Tang-Hsun Tu