Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 23

• What is an operating system?

• What does it do?


• Why do we need it?
OPERATING SYSTEM:
• An operating system is an interface between the user and the
hardware.
• hardware understands binary language(0 and 1)instructions must
be passed in binary form ?? Normal user do not know this language
• How can one interact with the system? how is this possible?
• you need a Translator. Thus, OS acts as a translator  converts the
commands received via Applications (like MSWord or a web
browser etc.) into binary language understood by the hardware and
vice-versa.
Need of Operating System

• No OS
If you are working on MC6800 hardware then the instructions will be:
LDAA $80 – Loading the number at memory location 80
LDAB $81 – Loading the number at memory location 81
ADDB – Adding these two numbers
STAA $55 – Storing the sum to memory location 55
But the moment you hardware changes, for example, say to 8086 or 8088, all the above
instructions will change, a problem!

• With OS
Use any High Level Language like C.
Write c=a+b;
The underlying hardware does not matter because OS takes care of convertion. Infact this is
what we always do. Have we ever bothered what hardware are we using. Our focus is just
writing the code correctly in C, C++, Python etc.
Can we use the system without installing an
Operating System?
• Views of Operating System
• Use of operating system depends upon who is using it and what is the need in that
particular scenario  there are different views.
1. User view
2. System view
User’s point of view, the operating system should offer ease of use and performance.
Example, Windows is very popular because it is very easy to use as it is having a
graphical user interface. Similarly, Android became very popular and it became one of
the reasons that Nokia’s Symbian OS lost its market value.
• But from the system’s point of view, the OS should act as a Resource Manager, which
means that the OS should be able to manage all the hardware resources in the system.
Hence, all hardware should be used in the most efficient manner and the process
should be kept waiting for a minimum amount of time if they require any resource
Uni-programming vs Multi Programming vs Time Sharing

• Uni-programming –system jobs are submitted one by one to the system. From within the
batch, the jobs are processed one by one. A collection of jobs forms a batch (batch
processing) from which the jobs are executed one by one. Every user submits his/her job to
the operator who forms a batch of jobs. The entire system is used by one process at a time.
The sequence of steps is as follows:
1.All users submit the jobs to the operator ( the one who manages the system)
2.The operator selects similar kinds of jobs and makes batches.
3.Job1 from batch 1 is submitted for processing.
4.Job1 uses the CPU and I/O till it is completed. Till this time no other process can use the
CPU.
5.After job1 finishes job 2 is loaded into the memory.
• Disadvantages of batch processing/uni-programming:
1.Wastage of CPU time
2.No user interaction
3.No mechanism to prioritize processes
• In multi-programming more than one process can reside in the main
memory at a time. Thus, when process P1 goes for I/O operation the
CPU is not kept waiting and is allocated to some another process (lets
say P2). This keeps the CPU busy at all times.
• Advantages:
1.CPU is being utilized all the time as long as there are more than 1
process
2.The processes can be finished in less amount of time
• Disadvantages:
• 1. No user interaction
• Time Sharing (multi tasking) systems
• The concept of time sharing overcomes the problem of no user interaction as faced in
the above two strategies. Time sharing is the logical extension of multi programing.
In time sharing multiple jobs are executes at the same time and the CPU switches
among them so frequently that each user can interact with each program while it is
running. Time sharing system requires that each user be provided with input device
(keyboard or mouse) and an output device (monitor) to interact with the
systemdecreases the response time of the system for each user process. This gives
each user the illusion that the CPU is working solely for him/her.
• Advantages:
1.User interaction is possible
2.Multi-programming is possible
Uni-Programming Multi Programming Time Sharing

1. No user interaction 1. No user interaction 1. User interaction possible

2. Only one process uses the entire 2. Multiple process can use system 2. Multiple process can use system
system resources at any given time resources at same time resources at same time

3. Less CPU utilization 3. More CPU utilization 3. More CPU utilization


• Operating System Services
• OS provides services to the programs to the users.
• The specific set of services varies from one operating system to
another
• but here is a list of services that are common in almost all operating
system. These operating system services can be divided into two broad
categories:
1. User services
2. System services
• 1. User Interface
• User needs some interface pass his/her commands to the system.
• GUI (Graphical User Interface) or the CLI (Command Line
Interface). The GUI provides  icons and
• the user use mouse to operate upon those icons.
• But in the CLI the user interact by writing some commands on a
shell, like bash.
• GUI is very easy to learn and use.
• CLI is difficult for beginners but is more powerful as compared to
GUI as you can do much more by writing the right command.
• Consider a simple scenario where you want to create 1000 files with
names1, 2, …1000.
• 2. Program Execution
• System able to run a program by placing it into RAM.
• Program should be able to finish its execution normally/
• if there is an error it should be indicated to the user. Hence, the OS
handles these tasks for the user.
• 3. I/O Operations
• A program like MSWord may require to take input from the user via
keyboard or it may want to send a file for printing to the printer.
• User can not handle the I/O devices.
• Hence, the operating system should provide certain means to operate
these I/O devices.
• 4. File System Manipulation
• The user want to read from or write into a file,
• save it in some particular location.
• Need to check what permissions are available to the user on any particular file.
May be required to search for files, hence the files should be organized in some
manner like arranging them in directories. So, the system should provide certain
services to manipulate the files.
• 5. Communication
• Processes communicate among themselves i.e., they want to send some
message to each other.
• These processes can be on the same system or might be running on different
systems.
• An operating system provides two mechanisms to handle this
inter process communication : shared-memory and message-passing.
• Error Detection
• The operating system should aware of all errors that occur in the
system and should report these errors to the user so that the user can
take appropriate action.
• Certain times the operating system might be able to debug the issue on
its own also.
System Services
The operating system provides three services to the system.
1. Resource Allocation
• System is used by multiple processes at the same time (you run 10-15
applications on your mobile at any given time).
• Each of these process request for some resource and some may request for
the same resource at the same time.
• The operating system should be able to handle all the requests and allocate
them the resources with minimum waiting time.
2. Accounting
• System should be able to keep track of all users who are using the system.
• Helps to monitor and track malicious activities.
• Method used by OS allowing different users accounts in the system.
• Everyone logs in with his/her personal account and the operating systems
keeps on tracking who does what.
• Later, the admin can analyse the activity log of each user.
Protection and Security
• Protection means securing the data of one process from another.
• A process P1 must not be able to write into the address space of
process P2.
• Security means safeguarding the data from external threats like virus,
worms, etc.
• Operating system deploy different tools from these. One of the most
common tool is firewall.
• FIREWALL??

You might also like