0% found this document useful (0 votes)
2 views172 pages

OS Module 1 2 3 4

The document provides an overview of system software and operating systems, detailing the components of a computer system, including hardware, operating systems, application programs, and users. It explains the roles of the operating system as a resource manager and control program, and outlines key concepts such as process management, memory management, and user interfaces. Additionally, it discusses the structure of operating systems, including user and kernel modes, and the importance of processes and their states.

Uploaded by

rk2king28
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views172 pages

OS Module 1 2 3 4

The document provides an overview of system software and operating systems, detailing the components of a computer system, including hardware, operating systems, application programs, and users. It explains the roles of the operating system as a resource manager and control program, and outlines key concepts such as process management, memory management, and user interfaces. Additionally, it discusses the structure of operating systems, including user and kernel modes, and the importance of processes and their states.

Uploaded by

rk2king28
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 172

Module-1

Introduction to System Software and Operating


Systems
Computer System Structure
Computer system can be divided into four components:
● Hardware – provides basic computing resources.
CPU, memory, I/O devices
● Operating system
Controls and coordinates use of hardware among various applications and users.
● Application programs – define the ways in which the system resources are used
to solve the computing problems of the users.
Word processors, compilers, web browsers, database systems, video games
● Users
People, machines, other computers.
Components of a Computer System
•Computer System = Hardware + Software
•Software = Application Software + System Software(OS)
● Application Software: application software is a computer software package that performs a specific
function for a user, or in some cases, for another application
For Ex. office suites, graphics software, databases and database management programs, web browsers,
word processors, software development tools, image editors and communication platforms
● System Software:These software programs are designed to run a computer's application programs
and hardware. System software coordinates the activities and functions of the hardware and
software.
An Operating System is a system Software that acts as an intermediary/interface between a user of a
computer and the computer hardware.
•Operating system goals:
○ Execute user programs and make solving user problems easier
○ Make the computer system convenient to use
○ Use the computer hardware in an efficient manner
Operating System
● A program that acts as an intermediary between a user of a computer and the computer
hardware.

❖ OS is a resource manager
➢ 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
Operating System Structure
● Multiprogramming needed for efficiency
● Single user cannot keep CPU and I/O devices busy at all times
● Multiprogramming organizes jobs (code and data) so CPU always has one to
execute
● A subset of total jobs in system is kept in memory
● One job selected and run via job scheduling
● When it has to wait (for I/O for example), OS switches to another job
● Timesharing (multitasking) is logical extension in which CPU switches jobs so
frequently that
users can interact with each job while it is running, creating interactive
computing
● Response time should be < 1 second
● Each user has at least one program executing in memory □process
● If several jobs ready to run at the same time □ CPU scheduling
● If processes don’t fit in memory, swapping moves them in and out
to run
● Virtual memory allows execution of processes not completely in
Memory Layout for Multiprogrammed System
Operating-System Operations
Operating System Mode
Operating System Mode
● The User Mode is concerned with the actual interface between the user and the
system.
-It controls things like running applications and accessing files.
● The Kernel Mode is concerned with everything running in the background.
-It controls things like accessing system resources, hardware
controlling functions and processing program instructions.

● System calls are used to change mode from User to


Kernel.
Kernel
● Kernel is a software code that reside in central core of OS. It has complete
control over system.
● When operating system boots, kernel is first part of OS to load in main memory.
● Objectives of Kernel :
◆ To establish communication between user level application and hardware.
◆ To decide state of incoming processes.
◆ To control disk management.
◆ To control memory management.
◆ To control task management.
● Kernel includes:-
1. Scheduler: It allocates the Kernel’s processing time to
various processes.
2. Supervisor: It grants permission to use computer system resources
to each process.
3. Interrupt handler : It handles all requests from the various
hardware devices which compete for kernel services.
4. Memory manager : allocates space in memory for all users of
kernel service.
● kernel provides services for process management, file management, I/O
management, memory management.
● "System calls are used to access the services provided by the kernel."
Transition from User to Kernel Mode
● Timer to prevent infinite loop / process hogging resources
● Set interrupt after specific period
● Operating system decrements counter
● When counter zero generate an interrupt
● Set up before scheduling process to regain control or terminate
program that exceeds allotted time
Operating System Functions
1. Process Management
2.Memory Management
2.Memory Management
OS activities include
• Creating and deleting files and directories.
• Primitives to manipulate files and dirs.
• Mapping files onto secondary storage.
• Backup files onto stable (non-volatile) storage media.
6. User Interface Mechanism

• A user interface (UI) controls how you enter data


and instructions and how information is displayed on the
screen
•There are two types of user interfaces
1.Command Line
Interface 2.Graphical user
Interface
1. Command-line interface
• In a command-line interface, a user types commands represented by

short
keywords or abbreviations or presses special keys on the keyboard to
enter data and instructions.
2. Graphical User Interface
•With a graphical user interface (GUI), you interact
with menus and visual images.
Module 2
What is an Operating System?

● A program that acts as an intermediary between a user of a


computer and the computer hardware

● Operating system goals:


● Execute user programs and make solving user problems
easier
● Make the computer system convenient to use
● Use the computer hardware in an efficient manner

Operating System Concepts – 8th 1. Silberschatz, Galvin and Gagne


Four Components of a Computer System

Operating System Concepts – 8th 1. Silberschatz, Galvin and Gagne


Process Management
● A process is a program in execution. It is a unit of work
within the system. Program is a passive entity, process is
an active entity.
● Process needs resources to accomplish its task
● CPU, memory, I/O, files
● Initialization data
● Process termination requires reclaim of any reusable
resources
● Single-threaded process has one program counter
specifying location of next instruction to execute
● Process executes instructions sequentially, one at a
time, until completion
● Multi-threaded process has one program counter per
thread
● Typically system has many processes, some user, some
Operating System Concepts – 8th 1. Silberschatz, Galvin and Gagne
Process Management Activities
The operating system is responsible for the following activities
in connection with process management:
● Creating and deleting both user and system processes
● Suspending and resuming processes
● Providing mechanisms for process synchronization
● Providing mechanisms for process communication
● Providing mechanisms for deadlock handling

Operating System Concepts – 8th 1. Silberschatz, Galvin and Gagne


Operating System Concepts – 8th 1. Silberschatz, Galvin and Gagne
Process Concept
● An operating system executes a variety of programs:
● Batch system – jobs
● Time-shared systems – user programs or tasks

• An operating system executes a variety of programs that run as a


process.​
• Process – a program in execution; process execution must
progress in sequential fashion. No parallel execution of
instructions of a single process

● A process includes:
● program counter
● stack
● data section

Operating System Concepts – 8th 3. Silberschatz, Galvin and Gagne ©2009


The Process

● Multiple parts
● The program code, also called text section
● Current activity including program counter, processor
registers
● Stack containing temporary data
> Function parameters, return addresses, local variables
● Data section containing global variables
● Heap containing memory dynamically allocated during
run time
● Program is passive entity, process is active
● Program becomes process when executable file loaded
into memory
● Execution of program started via GUI mouse clicks, command
line entry of its name, etc
● One program can be several processes
● Consider multiple users executing the same program

Operating System Concepts – 8th 3. Silberschatz, Galvin and Gagne ©2009


Process in Memory

Operating System Concepts – 8th 3. Silberschatz, Galvin and Gagne ©2009


Process State
● As a process executes, it changes state
● new: The process is being created
● running: Instructions are being executed
● waiting: The process is waiting for some event to occur
● ready: The process is waiting to be assigned to a
processor
● terminated: The process has finished execution

Operating System Concepts – 8th 3. Silberschatz, Galvin and Gagne ©2009


Diagram of Process State

Operating System Concepts – 8th 3. Silberschatz, Galvin and Gagne ©2009


Process Control Block (PCB)
Each Process is represented in the OS BY PCB also known as task
control block ,Information associated with each process
● Process state
● Program counter
● CPU registers
● CPU scheduling information
● Memory-management information
● Accounting information
● I/O status information

Operating System Concepts – 8th 3. Silberschatz, Galvin and Gagne ©2009


Process Control Block (PCB)

Operating System Concepts – 8th 3. Silberschatz, Galvin and Gagne ©2009


Representation of Process Scheduling

Operating System Concepts – 8th 3. Silberschatz, Galvin and Gagne ©2009


CPU Switch From Process to Process

Operating System Concepts – 8th 3. Silberschatz, Galvin and Gagne ©2009


Thread States in Operating Systems
Last Updated : 25 Nov, 2019
Module 4 :
There are several logical structures of a directory,
these are given below.
Module 3
Paging algorithms

You might also like