Unit 3 RTOS
Unit 3 RTOS
Unit 3 RTOS
The only way to come out of the loop is either a hardware reset or an
interrupt assertion.
-A hardware reset brings the program execution back to the main
loop.
-An interrupt request suspends the task execution temporarily and
performs the corresponding interrupt routine and on completion of
routine it restarts the task execution from the point where it got
interrupted.
-The super loop approach does not require an operating system
(since no scheduling and priority is required)
-Example : Video Games keypad and display
SUPER LOOP APPROACH
Drawback
1.Any failure in any part of a single task may affect the total system
(hardware and software watchdogs can be used)
2.Lack of real timeliness – no of tasks increases , time at which each
task is repeated increases. Probable missing of some task . Ex:
pressing of the keys
solution: to introduce interrupts for events that require real
time attention
THE EMBEDDED OPERATING
SYSTEM BASED APPROACH
Data types
STORAGE CLASS
1. The instruction *ptr++ increments only the pointer not the content
pointed by the pointer ptr and *ptr– decrements the pointer not the
contents pointed by the pointer ptr
2. The instruction (*ptr)++ increments the content pointed by the
pointer ptr and not the pointer ptr (*ptr)- - decrements the content
pointed by the pointer ptr and not the pointer ptr
3. A type casted pointer cannot be used in an assignment expression
and cannot be incremented or decremented
4. ‘Null Pointer’ is a ponter holding a special value called ‘NULL’which
is not the address of any variable or function or the start address of
the allocated memory block in dynamic memory allocations.
IMPORTANT POINTS ON POINTERS
5. Pointers of each type can have a related null pointer viz. there can
be character type null pointer, integer type null pointer.
6. NULL is a preprocessor macro which is literally defined as zero or
((void*)0). #define NULL 0 or #define NULL((void*)0)
7. NULL is a constant zero and both can be used interchangeably as
Null pointer constants
8. A NULL pointer can be checked by the operaor if()
9. Null pointer is a C language concept and whose internal value
does not matter to us . NULL always guarantee a 0 to you but Null
pointer need not be .
CHARACTERS AND STRINGS
Character is a one byte data type and it can hold values ranging
from 0 to 255 or -128 to +127. Character refers to the alpha numeric
characters A to Z and special characters like *, !, ? ,,,
•String is an array of characters. A group of characters defined within
a double quote represents a constant string.
•String always terminates with a \0 character.
Input and Output operations
Standard string input (scanf()) and string output(printf()) functions
from the platform specific I/O library.
CHARACTERS AND STRINGS
• String concatenation
It refers to the joining of two or more strings together to form a single string. To make use of the
built in string operation functions include the header file ‘string.h’ to the ‘.c’ file.
‘strcat()’ is the function used for concatenating two strings.
• String comparison
Is done by strcmp() function. If two strings are passed as arguments to strcmp() function are equal,
the return value is zero. The value can be greater or lesser than zero if the strings compared are
not equal.
• String length
it refers to the number of characters except the null terminator character \0 present in a string.
Strlen() gives the length of the string.
• Copying strings
Strcpy() is used for copying a string to another string
CHARACTERS AND STRINGS
-FreeRTOS has a very small footprint. A typical kernel build will consume approximately 6K bytes of
Flash space and a few hundred bytes of RAM. Each task also requires RAM to be allocated for use as
the task stack.
-FreeRTOS uses a modified GPL license. The modification is included to ensure:
1.FreeRTOS can be used in commercial applications.
2. FreeRTOS itself remains open source.
3.FreeRTOS users retain ownership of their intellectual property.
4.When you link FreeRTOS into an application, you are obliged to open source only the kernel,
5.including any additions or modifications you may have made. Components that merely use
6.FreeRTOS through its published API can remain closed source and proprietary.
THANK YOU