80 likes | 373 Views
LPC2148 ARM7 myKernel Details. - Bhavin Kamdar. Keil’s RTX Kernel Features. MyKernel Features. myKernel Memory map. The first 4096+256 bytes of RAM space is reserved for the kernel and task stack Each task is assigned 512 bytes of stack (512 * 8=4096 bytes)
E N D
LPC2148 ARM7 myKernel Details - BhavinKamdar
myKernel Memory map • The first 4096+256 bytes of RAM space is reserved for the kernel and task stack • Each task is assigned 512 bytes of stack (512 * 8=4096 bytes) • The kernel requires 256 bytes of memory to store task stack pointers, task return addresses and other scheduler variables
myKernel Scheduler • The scheduler for myKernel is written completely in assembly to have full control over task stack and context switching. • Scheduler executes in privilged mode of ARM whereas all task are executed in user mode only. • Two complementary functions are provided in scheduler to add and remove tasks.
myKernel Scheduler (cntd) • Each task is given a time slice of 10ms • The task context during a task switch is saved and retrieved from the task stack only • Scheduler identifies task by a 8 bit process ID (PID).
Mutex / Task lists • Each peripheral (UART0, GLCD, MMC and BT module) has its own binary semaphore • Semaphore checking is implemented in assembly to provide true Read-while-write access • Also each peripheral has an optional task list which allows access to peripheral in turn.