You are on page 1of 12

EC 308 EMBEDDED SYSTEMS

MODULE-6

SYLLABUS

Real time operating systems - Services- Goals – Structures - Kernel - Process Management –
Memory Management – Device Management – File System Organization.

KTUStudents.in
Micro C/OS-II RTOS - System Level Functions – Task Service Functions – Memory Allocation
Related Functions – Semaphore Related Functions.
Study of other popular Real Time Operating Systems.

For more study materials: WWW.KTUSTUDENTS.IN


Real Time
➢ A real time is the time which continuously increments at regular intervals after the start
of the system and time for all the activities at difference instances take that time as a
reference in the system.

RTOS
➢ A real time operating system (RTOS) is multitasking operation system for the
applications with hard or soft real time constraints
➢ Real-time constraint means constraint on occurrence of an event and system expected
response and latency to the event.

6.1 RTOS Service Goals

KTUStudents.in
6.2 Structures

A system can be assumed to have a structure as per table given below.

For more study materials: WWW.KTUSTUDENTS.IN


6.3 Kernel
➢ The OS is the middle layer between the application software and system hardware.
➢ An OS includes some or all of the following structural units.
1. Kernel
2. File Management in case it is not a part of kernel.
➢ The kernel is the basic structural unit of OS. It can be defined as secured unit of an OS
that operates in the supervisory mode while the remaining part and the application
software operates in the user mode
➢ Table below gives the services of kernel in an OS.

KTUStudents.in

For more study materials: WWW.KTUSTUDENTS.IN


6.4 Process Management
Process Creation

➢ At reset of processor in a computer system, an OS is initialized first and then a process,


which can be called initial process, is created.
➢ Initialisation of OS means enabling the use of OIS functions, which includes the
function to create the process.
➢ Then the OS is started and runs the initial process.
➢ Processes can be created hierarchically.
➢ The initial process creates subsequent processes.
➢ Creation of a process means specifying the resources for the process and address spaces
(memory block) for the created process, stack, data and heap and placing the initial
information at a PCB.
➢ The process manager allocates a PCB when it creates the process and later manages it.
➢ PCB (Process Control Block) is a process descriptor used by process manager.
➢ A PCB describes the following.

KTUStudents.in

Management of created processes

➢ Process manager is a unit of the OS that is the entity responsible for controlling the
process execution.
➢ Process management enables the process creation, activation, running, blocking,
resumption, deactivation and deletion.

A process manger facilitates the following:

For more study materials: WWW.KTUSTUDENTS.IN


6.5 Memory Management

Memory allocation
➢ When a process is created, the memory manager allocates the memory addresses
(blocks) to it by mapping the process address space.
➢ Threads of a process share the memory space of the process.

Memory Management after Initial Allocation

➢ Memory manager of the OS has to be secure, robust and well protected.


➢ There must be control such that no memory leaks and stack overflows.
➢ Memory leaks means attempts to write in the memory block not allocated to a process
or data structure.
➢ Stack overflow means that the stack exceeding the allocated memory block(s)

KTUStudents.in
➢ Table below gives the memory management strategy.

6.6 Device Management

For more study materials: WWW.KTUSTUDENTS.IN


➢ A device manager is the software that manages various device drivers available in the
system.
➢ An OS device manager provides and executes the modules for managing the devices and
their drivers ISRs.

➢ The functions of device manager are given below.

KTUStudents.in

For the
➢ Table below gives more
setstudy
of OSmaterials:
commandWWW.KTUSTUDENTS.IN
functions for a device.
6.7 File System Organization
➢ A file is a named entity on a magnetic disc, or optical disc, or system memory or
memory stick
➢ File contains the data, characters and text.

Different abstractions of a file:


i) A file may be a named entity that is a structured record named entity as on a

KTUStudents.in
disk, having random access in the system.
ii) May be a structured record on a RAM analogous to a disk and may also be
either separately called as ‘RAM disk’or simply, as a ‘file’ itself (virtual device).
iii) May be an unstructured record of bits or bytes.
iv) A file device may be a pipe -like device

File organization in a system

➢ File is organized in a way according to a file system, which has set of command
functions for operations on the file.
➢ Table below gives these functions for POSIX file system.

For more study materials: WWW.KTUSTUDENTS.IN


File descriptor:
A file system has a data structure called file descriptor as per the table below:

6.8 Micro C/OS-II RTOS (MUCOS)

➢ One of the popular RTOS for an embedded system is μC/OS-II.


➢ μC/OS-II is a free ware for non commercial use.

6.9 μC/OS-II System level Functions


A set of system level functions in MUCOS are as follows.

KTUStudents.in

For more study materials: WWW.KTUSTUDENTS.IN


6.10 Task Service Functions

➢ Service functions mean the functions to task create, suspend and resume, and
time setting and time retrieving functions.

KTUStudents.in
1. Creating a task: Unsigned byte OSTaskCreate (void(*task) (void *taskPointer),
void*pmdata, OS_STK*taskStackPointer, unsigned byte taskPriority) is a
function called for creating a task.

For more study materials: WWW.KTUSTUDENTS.IN


KTUStudents.in
6.11 Memory Allocation Related Functions

For more study materials: WWW.KTUSTUDENTS.IN


6.12 Semaphore Functions

KTUStudents.in

For more study materials: WWW.KTUSTUDENTS.IN


KTUStudents.in

For more study materials: WWW.KTUSTUDENTS.IN

You might also like