0% found this document useful (0 votes)
5 views27 pages

ES Module 2

The document outlines the services provided by operating systems (OS), including program execution, memory management, and security, as well as the architecture of embedded operating systems. It details the components of embedded OS, such as the kernel and task management, and describes various types of embedded OS architectures and categories. Additionally, it covers application software development for the 8051 microcontroller, including programming languages, memory management, peripheral interfacing, and development tools.

Uploaded by

ta2846025
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views27 pages

ES Module 2

The document outlines the services provided by operating systems (OS), including program execution, memory management, and security, as well as the architecture of embedded operating systems. It details the components of embedded OS, such as the kernel and task management, and describes various types of embedded OS architectures and categories. Additionally, it covers application software development for the 8051 microcontroller, including programming languages, memory management, peripheral interfacing, and development tools.

Uploaded by

ta2846025
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 27

Module II

Software
Architecture
Services Provided By OS
1] Program execution
• To execute a program, several tasks need to be performed
• Both the instructions and data must be loaded into the main memory
• In addition, input-output devices and files should be initialized, and other
resources must be prepared
• The Operating structures handle these kinds of tasks
• The user no longer has to be concerned about memory allocation,
multitasking, or anything else
• When the program is in execution, the Operating System also handles
deadlock i.e. no two processes come for execution at the same time
2] Input/output devices
• As there are numerous types of I/O devices within the computer system, and
each I/O device calls for its own precise set of instructions for the operation;
OS manages the input-output operations and establishes communication
between the user and device drivers
3] Communication Between Processes
• The OS manages the communication between processes. It includes data
transfer among them
4] File Management
• The operating system helps in managing files also. If a program needs
access to a file, it is the operating system that grants access. These
permissions include read-only, read-write, etc. It also provides a platform
for the user to create, and delete files.
5] Memory Management
• Let’s understand memory management by OS in simple way. Imagine a cricket team with
limited number of player . The team manager (OS) decide whether the upcoming player
will be in playing 11 ,playing 15 or will not be included in team , based on his
performance . In the same way, OS first check whether the upcoming program fulfil all
requirement to get memory space or not ,if all things good, it checks how much memory
space will be sufficient for program and then load the program into memory at certain
location. And thus , it prevents program from using unnecessary memory.
6] Process Management
• Let’s understand the process management in unique way. Imagine, our kitchen stove as the
(CPU) where all cooking(execution) is really happen and chef as the (OS) who uses kitchen-
stove(CPU) to cook different dishes(program). The chef(OS) has to cook different
dishes(programs) so he ensure that any particular dish(program) does not take long
time(unnecessary time) and all dishes(programs) gets a chance to cooked(execution) .The
chef(OS) basically scheduled time for all dishes(programs) to run kitchen(all the system)
smoothly and thus cooked(execute) all the different dishes(programs) efficiently
7] Security and Privacy
• Security : OS keep our computer safe from an unauthorized user by adding security layer to
it. Basically, Security is nothing but just a layer of protection which protect computer from
viruses and hackers
• Privacy : OS give us facility to keep our essential information hidden like having a lock on our
door, where only you can enter and other are not allowed . Basically , it respect our secrets
and provide us facility to keep it safe.
8] Resource Management
• System resources are shared between various processes. It is the Operating
system that manages resource sharing. It also helps in the memory
management of the system. It also controls input-output devices
10] Networking
• This service enables communication between devices on a network, such as
connecting to the internet, sending and receiving data packets, and
managing network connections.
11] Error Handling
• The Operating System also handles the error occurring in the CPU, in Input-
Output devices, etc. It also ensures that an error does not occur frequently
and fixes the errors
Architecture Of Embedded OS
• Embedded operating systems are specialized operating systems designed to manage and
control the hardware and software resources of embedded systems
• The architecture of an embedded OS is tailored to meet the specific requirements of
these systems, which often include real-time constraints, limited resources, and reliability
• Key Components of an Embedded OS Architecture
1.Kernel
1. Core Functionality: The kernel is the heart of an embedded OS. It manages system
resources, handles tasks, and ensures that operations are executed in an orderly and
controlled manner.
2. Task Management: The kernel schedules tasks, manages task states (e.g., running,
waiting, suspended), and facilitates task switching
3. Inter-Process Communication (IPC): The kernel provides mechanisms for tasks to
communicate with each other, such as message queues, semaphores, and shared
memory.
4. Memory Management: The kernel manages memory allocation and deallocation,
ensuring that tasks have the necessary memory space to execute
2] Task/Thread Management
• Multitasking: Embedded OS supports multitasking, allowing multiple tasks or threads to
run concurrently. This is essential for handling various inputs, outputs, and processes in
real-time.
• Task Prioritization: Tasks are often prioritized based on their urgency or importance. The
OS schedules higher-priority tasks before lower-priority ones, especially in real-time
systems.
• Context Switching: The OS can switch the CPU's focus from one task to another, preserving
the state of the current task so that it can resume later without loss of information
3] Real-Time Clock and Timers
• Timing Mechanisms: Embedded OS typically includes a real-time clock (RTC) and timers
that allow precise timing operations. These are crucial for tasks that must be executed at
specific intervals or within strict time constraints.
• Delay and Timeout Management: Timers are used to manage delays, timeouts, and
periodic task execution.
4] Interrupt Handling
• Interrupt Service Routines (ISRs): The OS handles hardware and software
interrupts through ISRs, which are small routines that respond to interrupt
signals. This allows the system to respond quickly to external events.
• Interrupt Prioritization: In systems with multiple interrupts, the OS manages
priorities, ensuring that more critical interrupts are handled first
• Types of Embedded OS Architectures
1. Monolithic Kernel
• In this architecture, all the OS functions, including task management, IPC, device drivers, and file
systems, are part of a single, large kernel. This can lead to efficient performance but might be less
modular (meaning it's difficult to update or replace individual services) and harder to maintain.
2. Microkernel
• The microkernel architecture reduces the kernel to the most essential functions, such as task
scheduling and IPC. Other services, like device drivers and file systems, run in user space as
separate processes. This makes the system more modular and easier to update or modify
3. Hybrid Kernel
• Hybrid kernels combine elements of both monolithic and microkernel architectures, aiming to
balance performance and modularity
4. Real-Time Operating System (RTOS)
• RTOS is a special class of embedded OS designed to handle real-time constraints
Categories Of Embedded OS
1] Real-Time Operating System
• RTOS is designed to be reactive
• It processes inputs when they are received and responds within a specific
timeframe
• If the response time falls outside of the specified time period, the system
could fail
2] Multi-tasking Operating System
• The multi-tasking Operating System may execute multiple tasks at the same
time
• The multitasking operating system is switched between the multiple tasks
• Some tasks are waiting for events to occur, while others are receiving events
and preparing to run
3] Preemptive Operating System
• A multitasking operating system that interprets task preemption (the act
of temporarily stopping a task to work on a higher priority task, and
then resuming the original task later) is known as a preemptive
operating system
• A task with a higher priority is always defined and executed before a task
with a lower priority
• Such systems can fail to meet a system's deadline, and the program is
unaware of the missed deadline
4] Rate Monotonic Operating System
• It is an operating system that assures that tasks in a system may operate
for a specific amount of time and duration of time
• It is a priority-based scheduling algorithm. It is used in operating systems
as a preemptive
• It is generally used to perform shorter tasks with higher priority.
5] Single loop control system
• This type of embedded OS exercises control over a single variable. An
example would be temperature control in a smart home. A smart
thermostat measures the temperature in the house and if it exceeds the
limit set by the user, turns off the heat
6] General-Purpose Embedded OS: These are lightweight versions of
general-purpose OS tailored for embedded systems
7] Network Operating Systems (NOS): NOS are designed to manage network
resources, ensuring data is transmitted efficiently across networked embedded
devices
8] Mobile Operating Systems: Designed for mobile devices with touch interfaces,
mobile OS handle a wide range of applications while managing limited resources
9] TinyOS: TinyOS is a lightweight, flexible OS designed specifically for wireless
sensor networks and low-power embedded systems
Application Software

• The application software for the 8051 microcontroller typically involves


developing programs that control hardware peripherals, process data, and
communicate with other systems. Below is a detailed overview of the application
software development for the 8051 microcontroller
1. Development Environment
• To develop application software for the 8051 microcontroller, several tools are
commonly used:
• Assembler: Converts assembly language code into machine code. Example: Keil
uVision, SDCC.
• Compiler: Converts high-level languages like C into machine code. Example: Keil
C51, SDCC (Small Device C Compiler).
• IDE (Integrated Development Environment): Provides a unified interface for
writing, compiling, and debugging code. Example: Keil uVision IDE, Eclipse with
SDCC plugin.
2. Programming Languages
• Assembly Language: Offers precise control over the hardware, with direct access
to CPU instructions. It is efficient but complex and time-consuming.
• C Language: The most common high-level language used for 8051 programming.
It simplifies development by abstracting hardware details and offering better
portability and readability.
3. Memory Management
• Code Memory (ROM): Stores the program code. In the 8051 microcontroller, this
is often flash memory, where the application software is stored permanently.
• Data Memory (RAM): Used for storing variables, stack, and temporary data during
program execution. The 8051 has both internal (128 bytes to 256 bytes) and
external RAM.
• External Memory: If the application requires more memory than available
internally, external RAM and ROM can be interfaced with the 8051.
4. Software Architecture
• The architecture of application software for the 8051 microcontroller
generally follows a structured approach:
• Initialization: Setting up the microcontroller’s clock, I/O ports, timers, serial
communication, and other peripherals.
• Main Loop: The main loop is the core of the application, repeatedly
executing tasks such as reading sensors, updating displays, and checking
communication links.
• Interrupt Service Routines (ISRs): Handles asynchronous events like timers,
external interrupts, or communication signals. The 8051 supports multiple
interrupt sources, making it ideal for real-time applications.
• Task Scheduling: For complex applications, a simple cooperative or
preemptive scheduler can be implemented to manage multiple tasks.
5. Peripheral Interfacing
• Application software often involves interfacing the 8051 with various peripherals:
• GPIO (General Purpose Input/Output): Used to control LEDs, read button states, or
interface with other digital devices.
• Timers/Counters: Implemented in software for tasks like generating delays, measuring
time intervals, or generating PWM signals.
• Serial Communication (UART, I2C, SPI): Facilitates communication with other
microcontrollers, sensors, or external devices like displays.
• ADC (Analog to Digital Converter): If required, external ADCs are interfaced with the
8051 to read analog signals.
6. Communication Protocols
• The 8051 microcontroller can be programmed to implement various
communication protocols:
• UART: Used for serial communication, commonly interfacing with PCs, GPS
modules, or Bluetooth devices.
• I2C: A protocol for communication with other microcontrollers, sensors, or
memory devices.
• SPI: A faster communication protocol often used with high-speed peripherals
like ADCs, DACs, or memory chips.
7. Software Libraries
• Developers often use libraries to simplify interfacing with peripherals or
implementing protocols. For example:
• LCD Library: To control LCD displays.
• Serial Library: For handling UART communication.
• Sensor Libraries: For interfacing with temperature sensors, accelerometers, etc.

8. Debugging and Testing


• Simulators: Before deploying code on hardware, it’s common to use simulators to
test the application software. Keil uVision provides a robust simulation environment.
• In-Circuit Debugging: Tools like JTAG or ICE (In-Circuit Emulator) allow debugging on
the actual hardware by stepping through code, setting breakpoints, and watching
variables.
• Testing: Involves functional testing (to ensure the software meets requirements),
integration testing (to verify the interaction between different modules), and system
testing (to ensure the entire system works as expected)
9. Power Management
• For battery-operated applications, software needs to manage power
consumption effectively. The 8051 can be put into various low-power modes
like Idle or Power-down, which the application software can control.
Development And Testing Tools

1] Integrated Development Environment (IDE)


• An IDE is a software and hardware environment that consolidates the tools
needed for code development
• It typically includes a simulator, editor, compiler, assembler, linker, and
debugging tools, RTOS, emulators, logic analyzers etc.
 Simulator: It is a computer program that runs on a PC without any microcontroller hardware, and it simulates the behaviour
of the target microcontroller by interpreting the user program instructions using the target microcontroller instruction set
 An editor: It is a software that allows you to write and edit your code
 Compiler: It converts the high-level language to machine/binary language
 Assembler: It is a computer program that translates assembly language code into machine code
 Linker: It is a program in a system which helps to link object modules of a program into a single object file. It performs the
process of linking
 Emulator: It is a hardware or software that enables one computer system (called the host) to behave like another computer
system (called the guest). so that the host can run applications and services designed for the guest
 Logic analyzer: It is a device that captures and displays the digital signals from a microcontroller or other electronic circuit. It
can measure the voltage levels, frequency, and duration of each signal, and show them as waveforms on a screen or software
2] Compiler: For using the complete set of the codes, functions, expressions
and library routines and creating a file called object file
3] Assemblers
• For translating the assembly mnemonics into binary opcodes (instructions),
that is, into an executable file, called binary file
• It also creates a file that can be printed
• The list file has address, source code and hexadecimal object codes
• The file has addresses which are allocated again during the actual run of
assembly language program
4] Linkers and Locators: Linkers and locators are used to combine various
modules of code into a single executable file and to assign memory addresses
to different parts of the program
5] Simulators: Simulators allow developers to test their code in a virtual
environment without the need for physical hardware. This is useful for initial
testing and debugging
6] In-Circuit Emulators (ICE): ICE are hardware devices that allow for real-time
debugging and testing of the microcontroller in the actual circuit
7] Debuggers: Debuggers are tools or software that allow developers to
examine the execution of their programs in detail, identify errors, and monitor
the behavior of the microcontroller
8] Programmers: Programmers are hardware devices used to load the
compiled program code into the microcontroller’s memory. Eg: FlashMagic
9] Development kit: It is used for editing, configuring (enabling and disabling
the features), GUIs development and compiling
10] RTOS: An OS for multitasking, process, memory, IO, network, devices, file
system and for real-time control of processes
11] Cross- assembler: For converting object codes or executable codes for a
processor at development system to other codes for another processor for
embedded system and vice versa
(Development System is a software OS that interfaces directly with hardware to execute
user software, enabling tasks such as displaying information, receiving input, and
reading from or writing to storage)
12]Cross- compiler: For compiling source codes for another processor and
vice versa
13]Editor: For writing C codes or assembly mnemonics using the keyboard of
host system (PC) for entering the program. Allows the entry, addition,
deletion, insertion appending previously written lines of files, merging record,
and files at the specific positions. Creates a source file that stores the edited
file that has an appropriate name
14] Interpreter: For expression by expression (line-by-line) translation to the
machine executable codes

You might also like