---
title: "Basic functions of real-time kernel"
subject: "Embedded System"
chapter: 6
key: "semester_6/embedded_system:real-time-kernel-functions"
source: https://www.bctengineer.com/q/semester_6/embedded_system/real-time-kernel-functions
site: BCT Engineering
---

# Basic functions of real-time kernel

Embedded System · Chapter 6: RTOS

- Asked in: 2069 Bhadra, 6 marks; 2072 Asoj, 4 marks (asked 2 times)
- Video: [RTOS Basics](https://www.youtube.com/watch?v=CvOqPmFvc-w) — Weston Embedded Solutions
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/embedded_system/real-time-kernel-functions
- Whole chapter: https://www.bctengineer.com/md/semester_6/embedded_system/chapter-6

## Question

Explain the basic functions of Real-time kernel (briefly describe the kernel operating system services).

## Short answer

The real-time kernel provides task management (create, delete, states), priority-based preemptive scheduling, context switching, inter-task communication (semaphores, queues), timer management, interrupt handling, memory allocation, device I/O, and resource management with deadlock avoidance. These services ensure deterministic, timely task execution.

## Answer

The **kernel** is the core of the RTOS that controls the processor, memory and devices and provides services to the tasks. Its basic functions are:

1. **Task (process) management:** create, delete, suspend, resume, change priority; maintains a task control block (TCB) and task states (ready, running, blocked).
2. **Scheduling:** selects the next task to run, normally the highest-priority ready task, pre-emptively, with a bounded decision time.
3. **Context switching:** saves and restores the CPU context when tasks change.
4. **Inter-task communication and synchronisation:** semaphores, mutexes, mailboxes, message queues, event flags and shared memory. 
5. **Timer and time management:** the system tick, delays, time-outs, periodic tasks, software timers.
6. **Interrupt management:** handles interrupt entry and exit, ISR-to-task communication, nested interrupts.
7. **Memory management:** allocation and freeing of memory (fixed-size blocks to avoid fragmentation), protection.
8. **Device (I/O) management:** device drivers and a standard interface for peripherals.
9. **Resource management:** controlled sharing of resources, avoiding deadlock and priority inversion (priority inheritance).
10. **File system and networking** services (in larger RTOS).

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What does the TCB hold/support?
   A. Task information and states (ready, running, blocked)
   B. Timers only
   C. The file system
   D. Only memory
   Answer: A. Task management maintains the TCB and states. (Key point: Task management)

2. What does the kernel scheduler normally select?
   A. The oldest task
   B. The longest task
   C. The highest-priority ready task, pre-emptively, with bounded decision time
   D. A random task
   Answer: C. Bounded scheduling is key to real-time behavior. (Key point: Scheduling)

3. Which are inter-task communication and synchronisation services?
   A. Only the system tick
   B. Only paging
   C. Only file systems
   D. Semaphores, mutexes, mailboxes, message queues, event flags
   Answer: D. Kernel provides these for coordination. (Key point: Inter-task communication)

4. Why does an RTOS use fixed-size memory blocks?
   A. To enable virtual memory
   B. To avoid fragmentation
   C. To slow allocation
   D. To use more memory
   Answer: B. Fixed blocks keep allocation predictable. (Key point: Memory management)

## Related in Embedded System

- [File system handling of kernel](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Akernel-file-system-handling) — Embedded System, chapter 6
- [RTOS and its services](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Artos-services) — Embedded System, chapter 6
- [Importance of kernel OS in embedded](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Aimportance-of-kernel-os) — Embedded System, chapter 6
- [User-level versus kernel-level threads](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Auser-vs-kernel-threads) — Embedded System, chapter 6, asked 2×
- [Kernel and its types](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Akernel-types) — Embedded System, chapter 6, asked 2×
- [Challenges of modeling a physical system](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Amodeling-physical-system-challenges) — Embedded System, chapter 7

## Related in other subjects

- [Real-time system and real-time OS components](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Areal-time-os) — Software Engineering, chapter 4
- [Basic ISDN services and architecture](https://www.bctengineer.com/question.md?key=semester_8%2Ftelecommunications%3Aisdn-services-architecture) — Telecommunications, chapter 8
- [CORBA services; object adapter functions](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Acorba-services-object-adapter) — Distributed System, chapter 4
- [Extended machine, kernel, system call](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Aextended-machine-kernel-syscall) — Operating System, chapter 1
