Nothing Special   »   [go: up one dir, main page]

UNIT1

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

CONCEPTS OF

OPERATING
SYSTEMS
Ms S Thulasi Bharathi
Asst Professor,
Department of Computer Science
St.Joseph’s College( Autonomous)
Trichy

1
Basic knowledge

• Which of the following is the main function of an operating system?


• a) Managing hardware resources
• b) Running applications
• c) Providing user interface
• d) All of the above
Answer: d) all the above

2
• Which type of operating system allows only one user to access the system at
a time?
• a) Single-user operating system
• b) Multi-user operating system
• c) Batch operating system
• d) Real-time operating system
Answer: a) Single-user operating system

3
• What is the role of a device driver in an operating system?
• a) It manages memory allocation in the system.
• b) It handles user interactions with the system.
• c) It provides an interface for users to interact with hardware devices.
• d) It coordinates communication between the CPU and peripherals.
Answer: c) It provides an interface for users to interact with hardware devices.

4
• What is the boot process of a computer?
• a) Loading the operating system into memory and initializing system
components.
• b) Shutting down the computer and saving the current state.
• c) Restarting the computer after a system failure.
• d) Upgrading the hardware components of the computer.
Answer : a) Loading the operating system into memory and initializing system
components.

5
• How does an operating system handle input and output operations?
• a) It directly communicates with peripheral devices for input and output.
• b) It uses device drivers to facilitate input and output operations.
• c) It allocates separate memory areas for input and output data.
• d) It relies on the CPU to handle all input and output operations.
Answer: b) It uses device drivers to facilitate input and output operations.

6
INTRODUCTION
• An operating system is a program that
manages a computer’s hardware.
• It also provides a basis for application
programs and acts as an intermediary
between the computer user and the
computer hardware.

7
WHAT IS THE WORKING OF OPERATING
SYTEM?

8
• Hardware - CPU, MEMORY, I/O DEVICES
• Operating System - controls the hardware and coordinates its use
among the various applications
• Application Programs – Word processors, Media Players, Compilers,
Browsers
• Users – different users

9
Two viewpoints of operating system

• User view – in view of resource utilization (CPU time, memory, I/O)


• System view – resource allocator (CPU time, memory, I/O)

10
Computer System Architecture

11
Computer System Organization
• Bootstrap - when it is powered up or
rebooted, it needs to have an initial
program to run.
• ROM - It initializes all aspects of the
system, from CPU registers to device
controllers to memory contents.
• Kernel – The kernel is a computer
program at the core of a computer's
operating system and generally has
complete control over everything in
the system.
• The bootstrap program must locate
the operating-system kernel and
load it into memory. 12
Terminologies in Computer system operation

• Interrupt – An interrupt is a signal


emitted by hardware or software
when a process or an event needs
immediate attention.
• Interrupt service routine – An ISR is
a specially written program to
service the condition that caused
the interrupt.
• System Call - A system call is a
method for a computer program
to request a service from the
kernel of the operating system on
which it is running.

13
14
VON NEWMANN ARCHITECTURE

15
VON NEWMANN HARVARD
• Von Neumann Architecture is • Harvard Architecture is the
a digital computer digital computer architecture
architecture whose design is whose design is based on the
based on the concept of stored concept where there are
program computers where separate storage and separate
program data and instruction buses (signal path) for
data are stored in the same instruction and data.
memory.

16
17
Storage structure

18
Storage definition and notation
• Bit (b): The smallest unit of data storage, representing a binary
digit (0 or 1).
• Byte (B): A unit of storage that consists of 8 bits.
• Kilobyte (KB): Approximately 1,000 bytes (2^10 bytes).
• Megabyte (MB): Approximately 1 million bytes (2^20 bytes).
• Gigabyte (GB): Approximately 1 billion bytes (2^30 bytes).
• Terabyte (TB): Approximately 1 trillion bytes (2^40 bytes).
• Petabyte (PB): Approximately 1 quadrillion bytes (2^50 bytes).
• Exabyte (EB): Approximately 1 quintillion bytes (2^60 bytes).
• Zettabyte (ZB): Approximately 1 sextillion bytes (2^70 bytes).
• Yottabyte (YB): Approximately 1 septillion bytes (2^80 bytes).

19
REGISTERS
• Registers are a type of
computer memory used to
accept, store, and transfer
data and instructions used
by the CPU right away.
Processor registers refer to
the registers used by the
CPU.

20
CACHE MEMORY
• Cache Memory is a special very
high-speed memory.
• The cache is a smaller and faster
memory that stores copies of the
data from frequently used main
memory locations.
• There are various different
independent caches in a CPU,
which store instructions and data.
• The most important use of cache
memory is that it is used to
reduce the average time to access
data from the main memory.

21
ROM – READ ONLY MEMORY

• ROM stands for Read-Only Memory.


• It is a non-volatile memory that is used to stores important
information which is used to operate the system.

22
RAM – RANDOM ACCESS
MEMORY

23
We want the programs and data to reside in main memory
permanently.
This arrangement usually is not possible for the following two
reasons:
1. Main memory is usually too small to store all needed
programs and data permanently.
2. Main memory is a volatile storage device that loses its
contents when power is turned off or otherwise lost

HERE COMES SECONDARY STORAGE MEMORY!!!!!!!!

24
SECONDARY MEMORY
• It acts as an extension of main
memory.
• It hols large quantities of data
permanently.
• The main differences among
the various storage systems
lie in speed, cost, size, and
volatility

25
COMPUTER SYSTEM ARCHITECTURE

• A computer system may be organized in a number of different ways,


which we can categorize roughly according to the number of
general-purpose processors used.
• Single-Processor Systems
• Multiprocessor Systems
• Clustered Systems

26
Single processor systems
• A single processor system, there is one main CPU capable of
executing a general-purpose instruction set, including instructions
from user processes.
• So only one process can be executed at a time and then the process
is selected from the ready queue.

There are multiple applications that need to be executed. However, the system contains a single
processor and only one process can be executed at a time.
27
Multiprocessor systems

• Multiprocessor systems (also known as parallel systems or tightly


coupled systems)
• These systems have two or more processors in close communication,
sharing the computer bus and sometimes the clock, memory, and
peripheral devices.

28
• Multiple CPUs are interconnected so that a job can be divided
among them for faster execution.
• When a job finishes, results from all CPUs are collected and
compiled to give the final output.
• Jobs needed to share main memory and they may also share other
system resources among themselves.
• Multiple CPUs can also be used to run multiple jobs simultaneously.

29
• Increased reliability: Due to the multiprocessing system, processing tasks
can be distributed among several processors. This increases reliability as if
one processor fails; the task can be given to another processor for completion.
• Increased throughout: As several processors increase, more work can be
done in less
• The economy of Scale: As multiprocessors systems share peripherals,
secondary storage devices, and power supplies, they are relatively cheaper
than single-processor systems.

30
Types
• Symmetrical multiprocessing
operating system
• each processor executes the same copy
of the operating system, takes its own
decisions, and cooperates with other
processes to smooth the entire
functioning of the system.
• "SHARED EVERY-THING"
• Asymmetrical multiprocessing operating
system
• CPU n1 acts as a supervisor whose
function controls other following
processors.
• each processor is assigned a specific
task, and there is a designated master
processor that controls the activities of
other processors.
• "SHARED EVERY-THING" 31
Clustered Systems

Clustered systems, in the context of operating systems, refer to a


configuration where multiple computers or servers are interconnected to
work together as a unified system.
High-Performance Computing (HPC) Clusters: HPC clusters are commonly used
in scientific research, engineering simulations, and other computationally intensive
applications.
Load Balancing: In a clustered system, the operating system implements load
balancing mechanisms to distribute workloads evenly among the nodes
Distributed File Systems: Clustered systems often employ distributed file systems
that enable data to be shared and accessed across multiple nodes in a transparent
manner.

32
Operating System Structure
• The main aspect of operating to MULITPROGRAMMING.
• Multiprogramming increases CPU utilization by organizing jobs (code and
data) so that the CPU always has one to execute.

33
• Multiprogramming – share CPU, memory, peripheral devices.(system
resources)
• Multitasking (Time sharing) – an extension of multiprogramming.
• CPU executes multiple jobs by switching among them.
• Multitasking is a broader concept that refers to the ability to run multiple
tasks concurrently,
• While time sharing is a specific approach to multitasking that emphasizes fair
resource allocation among multiple users.
• Time sharing is a mechanism used within multitasking operating systems to
achieve equitable resource utilization.

34
• A time-shared operating system uses CPU scheduling and
multiprogramming to provide each user with a small portion of a
time-shared computer, with a program for each user.
• And that execution of program from memory is called PROCESS.
• Time sharing and multiprogramming require that several jobs be
kept simultaneously in memory.
• TO HANDLE ALL THE JOBS RESIDES IN THE MEMORY, WE NEED
A PERSON CALLED JOB SCHEDULER

35
Operating-System Operations
• In operating systems, user mode and privileged mode (also known as kernel
mode or supervisor mode) are two distinct execution modes with different levels of
privileges and access to system resources.
User mode is the execution mode in which most Privileged mode, also known as kernel mode
user applications or processes run. When a or supervisor mode, is a higher privilege
program is executed in user mode, it operates level than user mode.
with limited privileges and restricted access to Operating in privileged mode allows the
system resources. operating system to perform critical tasks
The purpose of user mode is to ensure that such as managing memory, handling
user applications cannot interfere with or interrupts, controlling hardware devices,
disrupt the proper functioning of the operating and enforcing security policies.
system and other processes.

User applications run in a restricted environment, while the operating system runs with, higher privileges
LAYER OF PROTECTION AND ISOLATION 36
OPERATING SYSTEMS
OPERATIONS
1. PROCESS MANAGEMENT - The operating system creates and manages
processes, which are instances of executing programs. It schedules processes,
allocates resources, and provides mechanisms for process synchronization and
communication.

37
• Let's consider the scenario of a user working on a computer with
multiple applications open:
• Web Browsing (Process 1): The user is using a web browser to
browse the internet. The web browser runs as a separate process
and has its own memory space and resources. It is responsible for
rendering web pages, handling user interactions, and managing
network connections.
• Word Processing (Process 2): The user is also working on a word
processing application to write a document. The word processor
runs as a separate process and has its own memory space and
resources. It handles text input, formatting, and saving the
document to the storage device.
• Media Player (Process 3): Additionally, the user has a media
player application open to watch a video. The media player runs
as a separate process and has its own memory space and
resources. It decodes and plays the video file, handles audio
output, and allows the user to control playback.
38
MEMORY MANAGEMENT

• Memory is the important part of the computer that is used to store the data.
Its management is critical to the computer system because the amount of
main memory available in a computer system is very limited.
• At any time, many processes are competing for it.
• Moreover, to increase performance, several processes are executed
simultaneously.
• For this, we must keep several processes in the main memory, so it is even
more important to manage them effectively.

39
MEMORY MANAGEMENT

• The operating system is responsible for the following activities in connection


with memory management:
• Keeping track of which parts of memory are currently being used and who is
using them
• Deciding which processes (or parts of processes) and data to move into and
out of memory
• Allocating and deallocating memory space as needed

40
Storage Management

• It refers to the management of the data storage equipment’s that are


used to store the user/computer generated data.
• Storage management is a process for users to optimize the use of
storage devices and to protect the integrity of data across the
devices .

41
File-System Management
• File management is one of the most visible components of an operating
system.
• Computers can store information on several different types of physical media.
• Magnetic disk, optical disk, and magnetic tape are the most common.
• Each of these media has its own characteristics and physical organization.
• Each medium is controlled by a device, such as a disk drive or tape drive, that
also has its own unique characteristics.
• These properties include access speed, capacity, data-transfer rate, and access
method (sequential or random).

42
File Management in OS

• Creating and deleting files and directories


• Primitives to manipulate files and directories
• Mapping files onto secondary storage
• Backup files onto stable (non-volatile) storage media

43
Disk management in OS

• The operating system is responsible for the following activities in connection


with disk management:
• Free-space management
• Storage allocation
• Disk scheduling
• Magnetic tape drives and their tapes and CD and DVD drives, external
drives and platters are typical tertiary storage devices.

44
Caching
• It is the process of storing data
in a cache, which is a
temporary storage area that
facilitates faster access to data
with the goal of
improving application and
system performance.

45
Caching

• Main memory can be viewed as a fast cache for secondary storage, since data
in secondary storage must be copied into main memory for use and data
must be in main memory before being moved to secondary storage for
safekeeping.
• The file-system data,which resides permanently on secondary storage, may
appear on several levels in the storage hierarchy.
• At the highest level, the operating system may maintain a cache of file-
system data in main memory.

46
Caching

47
Protection and Security

• Protection, then, is any mechanism for controlling the access of


processes or users to the resources defined by a computer system.
• Protection and security require the system to be able to distinguish
among all its users.
• Most operating systems maintain a list of user names and associated
user identifiers (user IDs).

48

You might also like