About KAL
The Kernel Abstraction Layer (KAL) is intended to be used by Micrium products (µC/FS, µC/TCP-IP, µC/USB-Device, etc.) to completely make abstraction of any kernel used.
KAL is not as a full-featured kernel abstraction layer and only aims to provide minimal kernel services for usage in Micriµm's products and thus its functions should not be called by your application(s), except for an optional call to KAL_Init().
The KAL implementation code for µC/OS-II and µC/OS-III is available. Users of third party kernel will need to provide their own KAL implement using the provided template file,.
Installation
Only the kal.h
and <KERNEL>/kal.c
file corresponding to the kernel used (no kernel, uC/OS-II or uC/OS-III) must be included in the project.
The path to the root of the kernel used (C:/Micrium/Software/uC-OS-II or C:/Micrium/Software/uC-OS-III, by default) must be added to the compiler's list of include paths.
Configuration
If KAL resources are allocated from the heap (no specific memory segment is used, as specified through KAL_Init()), LIB_MEM_CFG_HEAP_SIZE
(in lib_cfg.h
) must provide enough memory for allocation of these resources.
Initialization
KAL must only be initialized by the application if a specific memory segment is to be used to allocate the resources used by KAL. These resources can include pools for semaphores, locks, timers and optionally task stacks.
If no specific memory needs to be used for KAL resources, the products using KAL (µC/FS, µC/TPC, etc.) will call KAL_Init() themselves without specifying a memory segment. In that case, KAL will allocate its resources in the heap and LIB_MEM_CFG_HEAP_SIZE
may need to be adjusted to provide enough memory for allocating these resources.
Initialization example for specific memory location use
This initialization example shows how KAL can be initialized and configured to use a specific memory location to allocate everything it needs.