Operating System

Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

Operating System

MC4109 (Unit1: Introduction)


Dr. Sumit Kumar Tetarave
Lecture-02
Course Content:
• Unit-1
• Introduction Extra Curriculum Activity-1:
• Evolution of operating systems
• Types of operating systems. Did you check the course


Different views of the operating systems
Operating system concepts and structures.
content in Books?
• Processes
• Unit-II
• Inter-process Communication and Synchronization
• Deadlock
• Unit-III
• Memory Management
• File Systems
• Unit-IV
• Principles of I/O Hardware and software
• Disk
• Clocks
• Terminals
Different view of O/S: User vs System View
User View
• The user view depends on the system interface that is used by the users.
• The different types of user view experiences can be explained as follows −
• If the user is using a personal computer, the operating system is largely designed to make the interaction easy.
Some attention is also paid to the performance of the system, but there is no need for the operating system to
worry about resource utilization. This is because the personal computer uses all the resources available and
there is no sharing.
• If the user is using a system connected to a mainframe or a minicomputer, the operating system is largely
concerned with resource utilization. This is because there may be multiple terminals connected to the mainframe
and the operating system makes sure that all the resources such as CPU, memory, I/O devices etc. are divided
uniformly between them.
• If the user is sitting on a workstation connected to other workstations through networks, then the operating
system needs to focus on both individual usage of resources and sharing though the network. This happens
because the workstation exclusively uses its own resources but it also needs to share files etc. with other
workstations across the network.
• If the user is using a handheld computer such as a mobile, then the operating system handles the usability of
the device including a few remote operations. The battery level of the device is also taken into account.
• There are some devices that contain very less or no user view because there is no interaction with
the users. Examples are embedded computers in home devices, automobiles etc.
Different view of O/S: User vs System View (Cont…)

System View
• According to the computer system, the operating system is the bridge between applications and
hardware.
• It is most intimate with the hardware and is used to control it as required.
• The different types of system view for operating system can be explained as follows:
• The system views the operating system as a resource allocator. There are many resources such as CPU time,
memory space, file storage space, I/O devices etc. that are required by processes for execution. It is the duty of
the operating system to allocate these resources judiciously to the processes so that the computer system can
run as smoothly as possible.
• The operating system can also work as a control program. It manages all the processes and I/O devices so that
the computer system works smoothly and there are no errors. It makes sure that the I/O devices work in a proper
manner without creating problems.
• Operating systems can also be viewed as a way to make using hardware easier.
• Computers were required to easily solve user problems. However it is not easy to work directly with the
computer hardware. So, operating systems were developed to easily communicate with the hardware.
• An operating system can also be considered as a program running at all times in the background of a
computer system (known as the kernel) and handling all the application programs. This is the definition of the
operating system that is generally followed.
Operating System Components (Concepts):
• Process Management
• Main Memory Management
• File Management
• I/O System Management
• Secondary Storage Management
• Network Management
• Protection System
• Command-Interpreter System
O/S Concepts: Process Management
• A process is a program in execution.
• A process needs certain resources, including CPU time, memory, files,
and I/O devices, to accomplish its task.
• The operating system is responsible for the following activities in
connection with process management.
– Process creation and deletion.
– process suspension and resumption.
– Provision of mechanisms for:
• process synchronization
• process communication
O/S Concepts: Memory Management
• Memory is a large array of words or bytes, each with its own address.
• It is a repository of quickly accessible data shared by the CPU and I/O
devices.
• Main memory is a volatile storage device. It loses its contents in the case of
system off/failure.
• The operating system is responsible for the following activities in
connections with memory management:
– Keep track of which parts of memory are currently being used and
by whom.
– Decide which processes to load when memory space becomes
available.
– Allocate and deallocate memory space as needed.
O/S Concepts: File Management
• A file is a collection of related information defined by its creator.
• Commonly, files represent programs (both source and object forms) and
data.
• The operating system is responsible for the following activities in
connections with file management:
– File creation and deletion.
– Directory creation and deletion.
– Support of primitives for manipulating files and directories.
– Mapping files onto secondary storage.
– File backup on stable (nonvolatile) storage media.
O/S Concepts: I/O System Management
• Much of the OS kernel is concerned with I/O.
• The OS provides a standard interface between programs (user or
system) and devices.
• Device drivers are the processes responsible for each device type.
– A driver encapsulates device-specific knowledge, e.g., for
device initiation and control, interrupt handling, and errors.
• There may be a process for each device, or even for each I/O request,
depending on the particular OS.
O/S Concepts: Secondary Storage Mgnt
• Since main memory (primary storage) is volatile and too small to
accommodate all data and programs permanently, the computer
system must provide secondary storage to back up main memory
• Most modern computer systems use disks as the principal online
storage medium, for both programs and data.
• The operating system is responsible for the following activities in
connection with disk management:
– Free space management
– Storage allocation
– Disk scheduling
O/S Concepts: Protection System
• Protection refers to a mechanism for controlling access by programs,
processes, or users to both system and user resources.
• The protection mechanism must:
– distinguish between authorized and unauthorized usage.
– specify the controls to be imposed.
– provide a means of enforcement.
• protection mechanisms help to detect errors as well as to prevent
malicious destruction
O/S Concepts: Command-Interpreter System
• Many commands are given to the operating system by control
statements which deal with:
– process creation and management
– I/O handling
– secondary-storage management
– main-memory management
– file-system access
– protection
– networking
Operating System Structures:
• An operating system is a construct that allows the user application
programs to interact with the system hardware.
• Since the operating system is such a complex structure, it should be
created with utmost care so it can be used and modified easily.
• An easy way to do this is to create the operating system in parts.
• Each of these parts should be well defined with clear inputs, outputs and functions.
• These subsystems can then be arranged in various architectural configurations:
• Simple Structure
• Monolithic (one unstructured program)
• Layered
• Microkernel
• Virtual Machines
O/S Structures: Simple Structure

• There was no user/ kernel mode, and so errors in applications


could cause the whole system to crash.
• OS such as MS-DOS and the original UNIX did not have well-
defined structures.
O/S Structures: Monolithic
• OS is simply a collection of functions
• One big program including everything (system calls, system programs,
device drivers, etc.)
• Entire OS resides in main memory
• Ex: MS-DOS, Multics, Unix, BSD, Linux
O/S Structures: Monolithic (Cont…)
• Pros
Every component contained in kernel
– direct communication among all components
– All OS services operate in kernel space
– high performance
• Cons
– Larger size makes it hard to maintain
– Complexity is more
– Dependencies between system component
– not easily extended/modified: new devices, emerging technologies not
easily added
O/S Structures: Layered Approach
• This approach breaks up the operating system into different layers.
– This allows implementers to change the inner workings, and
increases modularity.
– With the layered approach, the bottom layer is the hardware,
while the highest layer is the user interface.
• The main advantage is simplicity of construction and debugging.
• The main difficulty is defining the various layers.
• The main disadvantage is that the OS tends to be less efficient than
other implementations
O/S Structures: Layered Approach Cont…
• The operating system is divided into a number of layers (levels),
providing different functionalities
– The bottom layer (layer 0) is the hardware;
– the highest (layer N) is the user interface.
• A layer can only use the services provided by layer below
• E.g. Windows NT O/S
(Windows NT was the first Windows
operating system that supports
- preemptive multitasking.)
O/S Structures: Layered Approach Cont…
• Pros:
– Information hiding between layers
– Increased security and protection
– Easy to debug, test, and modify OS
• Cons:
– If one layer stops working, entire system will stop
– Mapping overhead between layers
– Difficult to categorize into layers
O/S Structures: Microkernel
• Move as much functionality as possible from the kernel into user space.
• Only a few essential functions in the kernel
– primitive memory management (address space)
– I/O and interrupt management
– Inter-Process Communication (IPC)
– basic scheduling
• Other OS services are provided by processes running in user mode :
– device drivers, file system, virtual memory…
• E.g. Mac OS
O/S Structures: Microkernel (Cont…)
• Communication between components of the OS is provided by message passing.
• Advantage: More flexibility, extensibility, portability and reliability.
• Disadvantage: Performance overhead caused by replacing service calls with message exchanges between
processes.
• Benefits:
1. Extensibility/Reliability
– easier to extend a microkernel
– easier to port the operating system to new architectures
– more reliable (less code is running in kernel mode)
– more secure
– small microkernel can be rigorously tested.
2. Portability
– changes needed to port the system to a new processor is done in the microkernel, not in the other
services.
O/S Structures: Virtual Machines
• Virtual Machine: provides an interface that looks like independent
hardware, to multiple different OS running simultaneously on the
same physical hardware
– Each OS believes that it has access to and control over its own
CPU, RAM, I/O devices, hard drives, etc.
• Usage: development and testing of software that must run on
multiple platforms and/or OS.
• Difficulty: involves the sharing of hard drives, which are generally
partitioned into separate smaller virtual disks for each operating OS
O/S Structures: Virtual Machines (Cont…)

System models:. (a) Nonvirtual machine. (b)Virtual machine


O/S Structures: Virtual Machines (Cont…)
• The resources of the physical computer are shared to create the
virtual machines:
– CPU scheduling can create the appearance that users have
their own processor.
– Spooling and a file system can provide virtual card readers and
virtual line printers.
– A normal user time-sharing terminal serves as the virtual
machine operator’s console.
Top Interview Questions:
1) What is the concept of reentrancy?
• It is a very useful memory saving technique that is used for multi-
programmed time sharing systems. It provides functionality that
multiple users can share a single copy of program during the same
period.
• It has two key aspects:
• The program code cannot modify itself.
• The local data for each user process must be stored separately.
Top Interview Questions:
2) How are server systems classified?
• Server systems can be classified as either computer-server systems or file
server systems. In the first case, an interface is made available for clients to
send requests to perform an action. In the second case, provisions are
available for clients to create, access and update files.
3) What is asymmetric clustering?
• In asymmetric clustering, a machine is in a state known as hot standby mode
where it does nothing but to monitor the active server. That machine takes
the active server’s role should the server fails.
Top Interview Questions:
4) What is root partition?
• Root partition is where the operating system kernel is located. It also contains
other potentially important system files that are mounted during boot time.
5) What are the different types of CPU registers in a typical operating
system design?
• Accumulators
• Index Registers
• Stack Pointer
• General Purpose Registers
Top Interview Questions:
6) Explain pros and cons of a command line interface?
• A command line interface allows the user to type in commands that can
immediately provide results. Many seasoned computer users are well
accustomed to using the command line because they find it quicker and
simpler.
• However, the main problem with a command line interface is that users have
to be familiar with the commands, including the switches and parameters
that come with it. This is a downside for people who are not fond of
memorizing commands.
7) Differentiate internal commands from external commands.
• Internal commands are built-in commands that are already part of the
operating system. External commands are separate file programs that are
stored in a separate folder or directory.
Top Interview Questions:
8) What is an Assembler?
• An assembler acts as a translator for low-level language. Assembly codes written using mnemonic
commands are translated by the Assembler into machine language.
9) What is GUI?
• GUI is short for Graphical User Interface.
• It provides users with an interface wherein actions can be performed by interacting with icons and
graphical symbols.
• People find it easier to interact with the computer when in a GUI especially when using the
mouse.
• Instead of having to remember and type commands, users click on buttons to perform a process.
10) Why partitioning and formatting is a prerequisite to installing an operating system?
• Partitioning and formatting create a preparatory environment on the drive so that the operating
system can be copied and installed properly.
• This includes allocating space on the drive, designating a drive name, determining and creating
the appropriate file system and structure.
Course Content: Lecture 03
• Unit-1 Extra Curriculum Activity-2:
• Introduction Please read Chapter-18,
• Evolution of operating systems Chapter-1 and Chapter-2 of
• Types of operating systems. Galvin Book.
• Different views of the operating systems
• Operating system concepts and structures.
• Processes
• The process concept,
• system programmer's view of processes.
• The operating system's view of processes.
• Operating system services for process management.
• Scheduling algorithms, Performance evaluation.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy