OSY Unit I
OSY Unit I
Operations of OS-
Following are some of important functions of an operating System.
Memory Management
Processor Management
Device Management
File Management
Security
Control over system performance
Job accounting
Error detecting aids
Coordination between other software and users
Memory Management
Memory management refers to management of Primary Memory or Main Memory. Main memory
is a large array of words or bytes where each word or byte has its own address.
Main memory provides a fast storage that can be accessed directly by the CPU. For a program to be
executed, it must in the main memory. An Operating System does the following activities for
memory management −
Keeps tracks of primary memory, i.e., what part of it are in use by whom, what part is not in
use.
In multiprogramming, the OS decides which process will get memory when and how much.
Allocates the memory when a process requests it to do so.
De-allocates the memory when a process no longer needs it or has been terminated.
Processor Management
In multiprogramming environment, the OS decides which process gets the processor when and for
how much time. This function is called process scheduling. An Operating System does the following
activities for processor management −
Keeps tracks of processor and status of process. The program responsible for this task is
known as traffic controller.
Allocates the processor (CPU) to a process.
De-allocates processor when a process is no longer required.
Device Management
An Operating System manages device communication via their respective drivers. It does the
following activities for device management −
Keeps tracks of all devices. Program responsible for this task is known as the I/O controller.
Decides which process gets the device when and for how much time.
Allocates the device in the efficient way.
De-allocates devices.
File Management
A file system is normally organized into directories for easy navigation and usage. These directories
may contain files and other directions.
An Operating System does the following activities for file management −
Keeps track of information, location, uses, status etc. The collective facilities are often
known as file system.
Decides who gets the resources.
Allocates the resources.
De-allocates the resources.
Following are some of the important activities that an Operating System performs −
Security − By means of password and similar other techniques, it prevents unauthorized
access to programs and data.
Control over system performance − Recording delays between request for a service and
response from the system.
Job accounting − Keeping track of time and resources used by various jobs and users.
Error detecting aids − Production of dumps, traces, error messages, and other debugging
and error detecting aids.
Coordination between other software and users − Coordination and assignment of
compilers, interpreters, assemblers and other software to the various users of the
computer systems.
Different views of Operating System-
Application view
In application view, we consider the services provided by operating system. Operating system is
responsible to provide the needed execution environment to the running programs. The
program needs processor, memory space and other resources during execution.
This is exactly provided by execution environment. The program uses network, storage devices,
and hardware components through interfaces. These interfaces are also provided by execution
environment. Interfaces provide a simplified, abstract view of hardware to application programs.
Independent systems possess their own memory unit and CPU. These are referred as loosely
coupled systems or distributed systems. These system’s processors differ in size and function. The
major benefit of working with these types of operating system is that it is always possible that one
user can access the files or software which are not actually present on his system but on some other
system connected within this network i.e., remote access is enabled within the devices connected in
that network.
Real-time systems are used when there are time requirements are very strict like missile systems, air
traffic control systems, robots etc.
Two types of Real-Time Operating System which are as follows:
Hard Real-Time Systems:
These OSs are meant for the applications where time constraints are very strict and even the
shortest possible delay is not acceptable. These systems are built for saving life like automatic
parachutes or air bags which are required to be readily available in case of any accident.
Virtual memory is almost never found in these systems.
Soft Real-Time Systems:
These OSs are for applications where for time-constraint is less strict.
Advantages of RTOS:
Maximum Consumption: Maximum utilization of devices and system,thus more output from
all the resources
Task Shifting: Time assigned for shifting tasks in these systems are very less. For example in
older systems it takes about 10 micro seconds in shifting one task to another and in latest
systems it takes 3 micro seconds.
Focus on Application: Focus on running applications and less importance to applications which
are in queue.
Real time operating system in embedded system: Since sizes of programs are small, RTOS can
also be used in embedded systems like in transport and others.
Error Free: These types of systems are error free.
Memory Allocation: Memory allocation is best managed in these type of systems.
Disadvantages of RTOS:
Limited Tasks: Very few tasks run at the same time and their concentration is very less on few
applications to avoid errors.
Use heavy system resources: Sometimes the system resources are not so good and they are
expensive as well.
Complex Algorithms: The algorithms are very complex and difficult for the designer to write
on.
Device driver and interrupt signals: It needs specific device drivers and interrupts signals to
response earliest to interrupts.
Thread Priority: It is not good to set thread priority as these systems are very less prone to
switching tasks.
Examples of Real-Time Operating Systems are: Scientific experiments, medical imaging systems,
industrial control systems, weapon systems, robots, air traffic control systems, etc.
Mobile OS: Mobile operating system is used for phones, tablets and for some other mobile devices.
Android OS: Android is an open source and Linux-based Operating System for mobile devices such
as smartphones and tablet computers. Android was developed by the Open Handset Alliance, led by
Google, and other companies.
Android offers a unified approach to application development for mobile devices which means
developers need only develop for Android, and their applications should be able to run on different
devices powered by Android.
The source code for Android is available under free and open source software licenses. Google
publishes most of the code under the Apache License version 2.0 and the rest, Linux kernel
changes, under the GNU General Public License version 2.
Features of Android
Android is a powerful operating system competing with Apple 4GS and supports great features.
Few of them are listed below –
Beautiful UI: Android OS basic screen provides a beautiful and intuitive user interface.
Connectivity: GSM/EDGE, IDEN, CDMA, EV-DO, UMTS, Bluetooth, Wi-Fi, LTE, NFC and WiMAX.
Storage: SQLite, a lightweight relational database, is used for data storage purposes.
Web browser: Based on the open-source WebKit layout engine, coupled with Chrome's V8
JavaScript engine supporting HTML5 and CSS3.
Messaging: SMS and MMS
Multi-tasking: User can jump from one task to another and same time various applications can run
simultaneously.
Resizable widgets: Widgets are resizable, so users can expand them to show more content or
shrink them to save space.
GCM: Google Cloud Messaging (GCM) is a service that lets developers send short message data to
their users on Android devices, without needing a proprietary sync solution.
Wi-Fi Direct: A technology that lets apps discover and pair directly, over a high-bandwidth peer-to-
peer connection
Applications:
Android applications are usually developed in the Java language using the Android Software
Development Kit. The various applications are – Dialer, SMS/MMS, Browser, camera, alarm,
calculator, contacts, voice dial, Email, calendar, Maps, Media player, Albums, clocks and many
more.
Ios: i-phone Operating system
• It is called so because it resides on Floppy or Hard disk and provides command level
interface between user & the computer hardware.
• The different versions of MS-DOS have evolved over a period of time with Microsoft
introducing new features in each new release.
• Starting with MS-DOS1.1, the latest version was MS-DOS7.2
• There are various versions of DOS like MS-DOS (Microsoft), PC-DOS (IBM), Apple DOS, Dr-
DOS etc.
DOS uses a command line, or text-based interface, that allows the user to type commands.
By typing simple instructions such as pwd (print working directory) and cd (change directory), the
user can browse the files on the hard drive, open files, and run programs.
Booting:
– When the computer is switched ON, the firmware program in Read Only Memory
(ROM) also called Basic Input-Output System(BIOS) reads programs and data i.e.
Operating System and loads it into memory (RAM).
– This process is known Bootstrapping (Booting).
– The OS once loaded:
– Takes control of the computer
– Handles user interaction
– Executes application programs.
Any instruction given to the computer to perform a specific task is called Command. The DOS has
several commands, each for a particular task and these are stored in DOS directory on the disk.
The commands are of two types-
Internal Commands:
External commands:
Layered structure of operating system: There are six layers in the layered structure of operating
system. A diagram demonstrating these layers is as follows:
1. Hardware: This layer interacts with the system hardware and coordinates with all the
peripheral devices used, such as a printer, mouse, keyboard, scanner, etc. These types of
hardware devices are managed in the hardware layer.
The hardware layer is the lowest and most authoritative layer in the layered operating
system architecture. It is attached directly to the core of the system.
2. CPU Scheduling: This layer deals with scheduling the processes for the CPU. Many
scheduling queues are used to handle processes. When the processes enter the system, they
are put into the job queue.
The processes that are ready to execute in the main memory are kept in the ready queue.
This layer is responsible for managing how many processes will be allocated to the CPU and
how many will stay out of the CPU.
3. Memory Management: Memory management deals with memory and moving processes
from disk to primary memory for execution and back again. This is handled by the third layer
of the operating system. All memory management is associated with this layer. There are
various types of memories in the computer like RAM, ROM.
If you consider RAM, then it is concerned with swapping in and swapping out of memory.
When our computer runs, some processes move to the main memory (RAM) for execution,
and when programs, such as calculator, exit, it is removed from the main memory.
4. Process Management: This layer is responsible for managing the processes, i.e., assigning
the processor to a process and deciding how many processes will stay in the waiting
schedule. The priority of the processes is also managed in this layer. The different algorithms
used for process scheduling are FCFS (first come, first served), SJF (shortest job first), priority
scheduling, round-robin scheduling, etc.
5. I/O Buffer: I/O devices are very important in computer systems. They provide users with the
means of interacting with the system. This layer handles the buffers for the I/O devices and
makes sure that they work correctly.
Suppose you are typing from the keyboard. There is a keyboard buffer attached with the
keyboard, which stores data for a temporary time. Similarly, all input/output devices have
some buffer attached to them. This is because the input/output devices have slow
processing or storing speed. The computer uses buffers to maintain the good timing speed
of the processor and input/output devices.
6. User Programs: This is the highest layer in the layered operating system. This layer deals
with the many user programs and applications that run in an operating system, such as word
processors, games, browsers, etc. You can also call this an application layer because it is
concerned with application programs.
There are several advantages of the layered structure of operating system design, such as:
1. Modularity: This design promotes modularity as each layer performs only the tasks it is
scheduled to perform.
2. Easy debugging: As the layers are discrete so it is very easy to debug. Suppose an error
occurs in the CPU scheduling layer. The developer can only search that particular layer to
debug, unlike the Monolithic system where all the services are present.
3. Easy update: A modification made in a particular layer will not affect the other layers.
4. No direct access to hardware: The hardware layer is the innermost layer present in the
design. So a user can use the services of hardware but cannot directly modify or access it,
unlike the Simple system in which the user had direct access to the hardware.
5. Abstraction: Every layer is concerned with its functions. So the functions and
implementations of the other layers are abstract to it.
Though this system has several advantages over the Monolithic and Simple design, there are also
some disadvantages, such as:
1. Complex and careful implementation: As a layer can access the services of the layers below
it, so the arrangement of the layers must be done carefully. For example, the backing
storage layer uses the services of the memory management layer. So it must be kept below
the memory management layer. Thus with great modularity comes complex
implementation.
2. Slower in execution: If a layer wants to interact with another layer, it requests to travel
through all the layers present between the two interacting layers. Thus it increases response
time, unlike the Monolithic system, which is faster than this. Thus an increase in the number
of layers may lead to a very inefficient design.
3. Functionality: It is not always possible to divide the functionalities. Many times, they are
interrelated and can't be separated.
4. Communication: No communication between non-adjacent layers.