- Task management, sometime call it scheduler.
- Time management, handle timer, delay.
- Intertask communication, how to share the resource between mutiple tasks.
- Memory Management, e.g. how to allocation of memory.
Let's see a concrete example: Porting micro C/OS-II to AVR32UC3 microcontroller. The codes in the first block (uC/OS-II book) are the general implementation of kernel, implemented in standard C. If you check the code more closely, you may find that some used functions (or macros) are not yet implemented there. For example:
- OS_TASK_SW()
For GUN toolchains
- #define OS_TASK_SW() __asm__ __volatile__ ("scall")
For IAR toolchians
- #define OS_TASK_SW() (OSCtxSw())
- #define uCOS 0x80
- #define OS_TASK_SW() asm INT uCOS
Usually, the porting is provided by vendor of chips, because these guys know it best and want their product as compatible as possible to all kernels.
Reference:
No comments:
Post a Comment