Week4 OS

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

`

Operating System
`

Introduction
Archana Nair S
Department of CSE
Amrita Viswa Vidyapeetham
Computer System Structure

Computer system can be divided into three components.


• Hardware – provides basic computing resources.
• Software – Set of programs for data processing.
System software(OS) and application software.
• Users – People, machines or other computers.

2
Computer System Structure

Image Courtesy:Silberschatz, Galvin and Gagne


– ‘Operating System Concepts’ –
9th Edition.

3
Classification of OS

Classification based on the concept of process.


Process
• A program in execution is called a process.
• When a process is on, it will continuously need various types of
resources.
• It will need CPU, I/O devices, main memory and various types
of software resources.

4
Classification of OS

Single-tasking vs Multi-tasking
• A single-tasking system can only run one process at a time,
while a multi-tasking operating system allows more than one
process to be running in concurrency
• This is achieved by time-sharing, where the available processor
time is divided between multiple processes.
• Other resources too would need to be shared in a multi-
tasking environment.

5
Classification of OS

Single-user vs Multi-user
• Single-user operating systems have no facilities to distinguish
users, but may allow multiple processes to run in tandem
• A multi-user operating system extends the basic concept of
multi-tasking with facilities that identify processes and
resources
• The system permits multiple users to interact with the system at
the same time (often via ‘dumb’ terminals).

6
Classification of OS

Distributed Operating systems


• A distributed system is a collection of physically separate,
possibly heterogeneous, computer systems that are networked
to provide users with access to the various resources that the
system maintains.
• Appear to be a single computer, as all computations are
distributed - divided amongst the constituent computers.

7
Classification of OS

Embedded Operating Systems


• Embedded systems are computers which control some larger
machinery.
• Embedded operating systems are designed to be used in
embedded computer systems.
• They are designed to operate on small machines with less
autonomy.
• They are very compact and extremely efficient by design, and
are able to operate with a limited amount of resources.

8
Classification of OS

Real-time Operating System


• Real time computers operate with stringent real time
requirements.
• A real-time operating system is an operating system that
guarantees to process events or data by a specific moment in
time.
• Such an OS may be single- or multi-tasking.
• specialized scheduling algorithms for multi-tasking.

9
OS Operations

• Interrupt driven (hardware and software)


• Hardware interrupt.
• Software interrupt (exception or trap):
• Software error (e.g., division by zero)
• Request for operating system service.
• Other process problems.
Eg. infinite loop, processes modifying each other or the
operating system.

10
OS Operations

• Dual-mode operation allows OS to protect itself and other system


components.
• User mode and kernel mode
• Mode bit provided by hardware.
• Provides ability to distinguish when system is running user code or
kernel code.
• Some instructions designated as privileged, only executable in
kernel mode.
• System call changes mode to kernel, return from call resets it to
user.

11
Transition from user mode to
kernel
• Timer to prevent infinite loop / process hogging resources.
• When counter zero generate an interrupt.

Image Courtesy:Silberschatz, Galvin and Gagne


– ‘Operating System Concepts’ –
9th Edition.

12
Functions of OS

• Process Management
• Memory management
• Peripheral devices management
• Protection and security
• Networking and communication

13
Memory Place your
Webcam Video here
Size 38%

• Memory means any data storage mechanism.


• Need efficient management of how data is stored, accessed
and manipulated.
• The storage and access are taken care of by the memory
management module of the OS.

14
Memory Hierarchy Place your
Webcam Video here
Size 38%

• Computer memory is usually organized hierarchically – in


various well defined levels.
There are four major storage levels in the computer memory
• Internal – Processor registers and cache.
• Main – the system RAM and controller cards.
• On-line mass storage – Secondary storage.
• Off-line bulk storage – Tertiary and Off-line storage.

15
Memory Place your
Webcam Video here
Size 38%

Memory Hierarchy

16
Memory Hierarchy Place your
Webcam Video here
Size 38%

• Register (very small capacity, temporary, extremely fast).


• Cache (small capacity, temporary, very fast).
• Main memory (medium capacity, temporary, fast).
• Secondary Memory (hard disk) (high capacity, permanent, not fast).
• Tertiary memory (very high capacity, permanent, slow).

17
Data Migration Place your
Webcam Video here
Size 38%

• OS focussing on data movement between secondary and main


memory.
• Microprocessor hardware handles data movements between
main memory and internal storage.

Image Courtesy:Silberschatz, Galvin and Gagne


– ‘Operating System Concepts’ –
9th Edition.

18
Memory Management Place your
Webcam Video here
Size 38%

• To execute a program all (or part) of the instructions must be in


memory
• Memory management determines what is in memory and
when.
• Optimizing CPU utilization and computer response to users.

• Memory management activities


• Keeping track of which parts of memory are currently being used and
by whom.
• Deciding which processes (or parts thereof) and data to move into
and out of memory.
• Allocating and deallocating memory space as needed.
19
Software Components

• A set of programs.
• Three types of software.
• System Software
• Application Software
• Utility software

20
Software Components

System Software
• Controls all the components of a computer.
• Controls other software and hardware components.
Application software
• It is designed for a specific purpose of the user.
• Dedicated to a specific application.
• Run by users.
• Utility software is designed to solve any issues or a complex
situation in a computer.
21
What is an Operating
System(OS)

• An operating system (OS) is system software that manages all


resources of a computer system.
• Controls Computer hardware including the core computer
and peripheral devices, software resources.
• Provides common services for computer programs.

22
What is an Operating
System(OS)

• Acts as an intermediary between user and the computer


hardware.
• OS is a resource allocator
• Manages all resources.
• Decides between conflicting requests for efficient and fair
resource use.
• OS is a control program
• Controls execution of programs to prevent errors and
improper use of the computer.

23
Basic Concepts

Some of the key concepts:


• Kernel
• System Calls
• Interrupts
• Shell

24
Kernel
• The kernel is the core component of an
operating system.
• It is the part of the operating system
that loads first, and it remains in main
memory.
• It is responsible for providing secure
access to the system’s resources.
• It act as an interface between the user
applications and the hardware.
• When a process makes requests of the
kernel, the request is called system
call. This Photo by Unknown Author is licensed under CC BY-SA

25
System Calls

• A system call is the means by which a computer program


requests a service from the kernel of the operating system on
which it is executed.
• This may include hardware-related services (for example,
accessing a hard disk drive), creation and execution of new
processes, and communication with integral kernel services
such as process scheduling.
• System calls provide an essential interface between a process
and the operating system.

26
Interrupts

• An interrupt is a response by the processor to an event that needs


attention from the software
• An interrupt condition alerts the processor and serves as a request for the
processor to interrupt the currently executing code when permitted, so
that the event can be processed in a timely manner
• If the request is accepted, the processor responds by suspending its
current activities, saving its state, and executing a function called an
interrupt handler (or an interrupt service routine, ISR) to deal with the
event

27
Shell

• A shell is a user interface for access to an operating system's


services.
• In general, operating system shells use either a command-line
interface (CLI) or graphical user interface (GUI), depending on
a computer's role and particular operation.

28
Shell
Types of Shells
• A GUI (graphical user interface) - most famously seen in
Windows family operating systems
• Command line interface – usually associated with Unix family
• Command-line shells require the user to be familiar with
commands and their calling syntax, and to understand
concepts about the shell-specific scripting language

29
Takeaways

• Computer System
Structure.
• Software Components.
• What is an Operating
System? Place your
Webcam Video here
Size 100%

30
References

[1] Silberschatz, Galvin and Gagne – ‘Operating System concepts’ –


9th Edition.

[2] J. Glenn Brookshear,”Computer Science: An Overview”, Addision-


Wesley, Twelth Edition, 2014

[3] Computer Fundamentals, Anita Goel, Pearson

31

You might also like