CSL320 - Operating System Lab
Case Study
Submitted by
(Name) Haider Ali,Shoaib Khattak,Muhammad Sajjad
(Enrollment #) 01-235171-016,01-235171-040,01-235171-079
(Class & Section) BSIT 5-B
Submitted To
Mr. Syed Saqlain Hassan
Monday, May 20, 2019
Department of Computer Science
Bahria University Islamabad
2019
Embedded Operating system:
History
First, we talk about operating system these systems are required for man kind
for heavy machine or we can say that it is needed for mathematics not for
simple calculation it is for measurements if we talk about simple computer
that’s not mean abuse. If we talk about operating system that are required to
run some kind of hardware or we can say that user want interaction with the
machine but first they built a hardware then they built a software these are
called operating system. Whereas the difference between embedded operating
system and other operating system are too many firstly we will discuss the
comparison between these two operating system, first we will talk about
operating system not embedded operating system these system are used for
multitasking and if we talk about embedded operating system these system are
use for specific hardware if we are specific hardware its mean a single
dedicated task will be performed from these operating system or operating
devices. When human have not much knowledge about technology they were
running then heavy machine task such as a packing machine these task are
done by human by candle through candle they are just seal the upper side of
the shopping bag now we can se that there are thousand of machine which is
used for packaging the packets by the help o simple operating system or we
can say that simple operating device/operating software. Actually embedded
system are used in home appliances such as AC inverter and washing
machine, iron, fan, security senor system how they understand the human that
they want to done that specific task so here is the answer they just give
instruction to the embedded system the simple code will run then the job will
be done.
Now I will discuss about how they actually work basically Operating system
size is not to much big it will easily fitted on any machine then we required a
software not application software it is call system software which manage all
the tasks but here in that case it is used for task here is the important thing is
that when user give command to any machine or we can say that washing
machine then this command will generate a event for this event there will be a
particular code for that as we say that embedded operating system is for a
dedicated task means it is used for a specific task then the corresponded set of
code will be run by embedded operating system that all about history.
Objectives
Objective of the embedded operating system are written follow as
These systems are for dedicated task such as washing machines, AC
inverter which perform specific task the main objective of the embedded
operating system is to make every device automate which mean such as
automatic washing machine which is wash clothes automatically user just
have to put clothes in that machine.
The main objective of the embedded operating system is designed to use
efficient at resource usage. For example, if we take an example of a car it
has automatic door close system this system is not in old car these systems
are in new model car or we take an example of the offices door which
automatically open and close these are the example of the embedded
operating system.
Real Life Example of Embedded operating system using
Atm machine using a embedded operating system + other operating system
other operating system such as window 7 used for display and embedded
operating system is used for dedicated task or we can say that the money
coming out of the machine is the task and this task is done by embedded
operating system.
Washing machine is also using an embedded operating system which you can
see in the figure user only interact with the control or monitors the these
instruction are managed by embedded operating system keep in mind
operating system are only used for specific task in this example washing
machine have only one task and after that set of code will be executed by the
embedded operating system the user task will be done. In this example that is
the work of embedded operating system. We have many examples where
embedded operating system works such as Ac inverter, watches, mobiles,
security system, refrigerator etc.
Design Principle
An Extendable Layered Architecture which runs on Kernel layer in a secure
mode which gives support threads to the CPU With no interrupts and traps
It basically provides you the basic systems services which are needed.
The subsystems operates in user mode to provide different operating
systems API’s
Additional environmental subsystems are provided by modular structure
which helps in less execution effects.
Gives the comfort of portability as any windows can be moved from One
hardware platform to another.
Dynamic link library DDL is on which the code is isolated of by a dependent
platform.
A very trust worthy because of hardware protection from windows via virtual
memory and vise- versa for software for operating system mechanisms.
Comparitively compatible because application follow standards which can be
executed on windows without the changing of source code.
Its performance is subsicuently very fond cause windows and their
subsystems can commute with each other via very high performance data
passing.
Purchasing of low priority threads enables OS to React Fast For Events that
are external to it.
Programmer interface
It has two main things to Discuss.
1- Inter-process Communication
2- Memory Management
1- Inter-process Communication:
Any Win 32 application usually has inter processes communicating by sharing
the kernel objects, related to shared memory portion and files(Data).
There is another process through which message transfering is communed
which is a common and one the most popular for any windows ( GUI
Applications).
Threads send messages to one another or they send it to the windows it-self.
Data can also be sent by threads with the message.
There is an important point here to be mentioned that From which the
thread gets its data(message) Each Win 32 Thread has its own input queue
2- Memory Management:
As I said we will be talking here about virtual memory ( Virtual Allocation
Reserves it And Commits it Later when required).
It also provides the functionality which lets virtual addresses to allocate the
memory locations properly .
File System
There are some embedded Os which provide memory management support for
a permanent or temporary file system storage conspire on different memory
gadgets, for example, Flash, RAM, or hard plate. File-systems are basically an
accumulation of files alongside their management protocols. File system
calculations are middleware as well as application programming that is
installed at some installation location in the storage device.
File System Summary
FAT-32 (File-Allocation-Table) Where memory is separated into the
littlest unit conceivable. A collection
of the sectors is known as cluster. A
unique number is assigned to each
cluster by an OS, and tracks which
clusters are used by which files.
NFS (Network-File-System) External devices are allowed to be
mounted to a partition on a system as
if it were in local memory,
FFS (Flash-File-System) Designed For Flash-memory
Dos-FS Intended for real-time utilization of
square devices (disks)
Raw-FS Provides a simple raw file system that
essentially treats an entire disk as a
single large file.
Tape-FS Intended for tape gadgets that don't
utilize a standard file or registry
structure on tape. Basically regards
the tape volume as a crude gadget in
which the whole volume is a huge
file.
Cdrom-FS Allows applications to read data from
CD-ROMs formatted according to the
‘ISO’.
In relationship to file systems, a ‘kernel’ normally provides file system
management mechanisms.
Files are mapped onto secondary storage, Flash, or RAM.
Os vary as far as the natives utilized for controlling files, what memory
devices files can be mapped to, and what file systems are supported. Standard
I/O interface between the file system and the memory device drivers are
mostly used by Os. This enable for one or more file-systems to operate in
coexistence with the operating system.
I/O System
An additional abstraction layer from the system’s hardware and device drivers
is provided by I/O Management in embedded Os. An OS provides a stable
interface for I/O gadgets that play out a wide assortment of capacities by
means of the accessible kernel system , providing protection to I/O devices
since user processes can only access I/O via these system calls, calls and
managing a fair and efficient I/O sharing scheme among the multiple
processes. An OS also needs to manage ‘synchronous’ and “asynchronous”
communication coming from I/O to its processes, in essence be event-driven
by responding to requests from both sides, and manage the data transfers. In
order to accomplish these goals, an OS’s I/O the board conspire is regularly
comprised of a conventional device-driver interface both to client procedures
and device drivers, as well as buffer-caching mechanism is of some type.
Board’s I/O hardware is controlled by Device driver code. In order to manage
I/O, device driver code to contain a specific set of functions may be all
required by an OS, such as shutdown, enable, startup, disable and so on. I/O
devices are managed by “kernel” and in some of the Os file systems as well-as
“black boxes” which are mostly accessed by some set of generic APIs by
higher-layer processes. Os can differ generally as far as what kinds of I/O
APIs they give to upper layers. For example, under ‘Jbed’, or any Java-based
scheme, all resources are viewed and structured as objects.
In little cases, the existence of OS buffers to manage data transmissions is
required by the I/O hardware. Buffers can be pretty necessary for the
management of I/O device for a number of reasons. Essentially, they are
required for the OS to have the option to catch information transmitted by
means of square access. The OS stores within buffers the stream of bytes
being transmitted to and from an I/O device independent of whether one of its
processes has initiated communication to the device. When performance is an
issue, buffers are just stored in cache, rather than in slower portion of the main
memory.
IPC:
Separate operations in an embedded system must share the similar software &
hardware resources, or may depend on one another so as to work accurately.
For these cause, embedded Os provide various mechanisms that allow for
tasks in a multitasking system to synchronize their behavior so as to
coordinate their functions and inter-communicate, avoid problems, and allow
tasks to normally run simultaneously. Embedded Os with various inter-
communicating processes normally implement inter-process communication
and synchronization algorithms based upon one or some group of memory
sharing, signaling mechanisms and message passing. As the data model shown
below processes communicate via access to shared areas of memory in which
variables modified by one procedure are available to all procedures.
While accessing data that is shared as a means to communicate is basically a
simple approach, the major concern of race conditions can occur. A race
condition occurs when there is a process that is accessing shared variables is
prevented before completing a mitigation access, thus it turns to badly affect
the integrity of shared variables. To counter this problem, part of processes
that get to access the shared data, called critical sections, can be appropriate
for mutual exclusion. Mute x mechanisms enable shared memory to be locked
up by the process trying to access it, giving that process the exclusive access
to the data that is shared. Different common avoidance mechanisms can be
implemented not just for planning access to shared memory, but for planning
access to other resources of shared system as well. Common avoidance
systems for synchronizing tasks that desire to simultaneously get to shared
information can include:
Processor helped locks for tasks getting to shared data that are booked
such that no other tasks can seize them; the main different mechanisms
that could drive a setting switch are interrupts. Disabling interrupts
while the execution of code in the critical section would prevent the
race condition scenario if the handlers of interrupt access the same
data.
Another possible processor-assisted lock is the “test-and-set-instruction”
mechanism. Under this mechanism, the testing and setting of a register
condition is an atomic method, a process that cannot be interrupted, and this
flag is tested by any process that wants to access a critical section. In short,
both the interrupt disabling and the condition variable type of locking schemes
guarantee a process exclusive access to memory.
Memory Management:
As it is clear from its name memory management means how embedded OS
will manage its memory. How it is going to give memory to other processes.
How it will allocate and deallocate its memory.
There are kernel inside the os which manage os memory and its also manage
its task and disk. The kernel always have some kind of instructions/code to
execute and load the it in the memory. When the different process consume
memory the OS need some kind of security system that could stop other free
independent processes to not to intrrupet the OS. The kernel provide this
security and stop other independent processes to not to intrrupet the OS when
it is in working state.
There kernel memory management responsilbilities are:
Allocate and deallocate the memory
Load the process into the memory when the memory is free
Track the components that are using the memory
Provide protection to processes that are using the memory
Os usually manage the logical memory and kernel oth the other hand
generally run code in separate memory from processes that are running in
a higher level. The Os can only run in two modes:kernel mode and user
mode.Kernel things are run in kernel mode and also run in different
memory space such as(middleware).Kernel mode is also called supervisor
mode. The kernel also manage memory for itself and for its user process
and providethem protection.
Diagram:
User interface:
By user interface most of people think how they can interact with their
devices but its not that how it is.User interface means how User’s/people
interact with there technology. So the user interface is as important as the
rest of the things. So that’s why companies also focus and even put more
of there money in building the interface of the technology as they focus on
rest of the things. User interface is so much important that market sales
depend on them. The companies that make interface a lot easier for their
users get their products easily sold. As for embedded os they ain’t got
much of the interface they are basically the chips that are in the machines
such as washing machines. Like in watching machines user can easily
interact with their washing machines like they can set the washing time
there spinning time and many other things. An other example is smart
kitchen device. As you can see in the pic below it the smart intelligent
device of kitchen it contain a devices that can scan your food and can tell
how much calories, protein and carbohydrates and it can even tell that
whether it is healthy for you or not. In the device there is an embedded Os
is fixed that do all these jobs. Some other basic examples of embedded Os
are LED.
Example:
Process Management:
As it is clear from its name process management means how will
embedded Os manage its processes means which process come after the
first process and which process will come after the second process and so
on. Process management can be done thoough scheduling or other
algorithm.
The embedded Os use five state model through which it manage its
processes.The five state model include:
1:New
2:Ready
3:Running
4:Blocked
5:Exit
1:New:
In new the process is loaded from secondary memory to main memory and
is not yet executed.
2:Ready:
In ready the process is ready to be executed when it get’s the opportunity
or when the memory is free.
3:Running:
The process is Running and Os is working on it.
4:Blocked:
The process is blocked and waiting for some event occurred.
5:Exit:
The process is removed from main memory because it is completed or
being aborted.