Kernel vs. User Code

In a system with an RTOS, the CPU is either executing code that is part of the RTOS (kernel code), or code that has been written by the user to perform firmware functions (user code).