Unit 1
Unit 1
Compiled By:
Dr. Narendra Kumar Sharma
Associate Professor, Dept. of MCA
Pranveer Singh Institute of Technology, Kanpur
Topics to be covered:
• Introduction to OS
• Operating System Definition
• Structure of a Computer System
• History of Operating System
• Characteristics of Operating Systems
• Functionalities of Operating System
• Conceptual View (Abstract) of OS
• Operating System Services
• Basic Input Output System (BIOS)
• Power On Self Test (POST)
• Booting Process
– Cold booting
– Warm booting
Introduction to Operating System
Large Scale
Fourth Since 1980 PC
Integration
Characteristics of Operating Systems
• Program Creation
The Operating system offers the structures and tools, including editors
and debuggers, to help the programmer create, modify, and debugging
programs.
• Error Detection and Response
An Error in a device may also cause malfunctioning of the entire device.
These include hardware and software errors such as device failure,
memory error, division by zero, attempts to access forbidden memory
locations, etc. To avoid error, the operating system monitors the system
for detecting errors and takes suitable action with at least impact on
running applications.
• While working with computers, errors may occur quite often. Errors
may occur in the:
– Input/ Output devices: For example, connection failure in the
network, lack of paper in the printer, etc.
– User program: For example: attempt to access illegal memory
locations, divide by zero, use too much CPU time, etc.
– Memory hardware: For example, Memory error, the memory
becomes full, etc.
• Accounting
An Operating device collects utilization records for numerous assets
and tracks the overall performance parameters and responsive time to
enhance overall performance. These personal records are beneficial for
additional upgrades and tuning the device to enhance overall
performance.
• Communication
The operating system manages the exchange of data and programs
among different computers connected over a network. This
communication is accomplished using message passing and shared
memory.
• File management
Computers keep data and information on secondary storage devices
like magnetic tape, magnetic disk, optical disk, etc. Each storage media
has its capabilities like speed, capacity, data transfer rate and data
access methods.
For file management, the operating system must know the types of
different files and the characteristics of different storage devices. It has
to offer the proportion and safety mechanism of documents
additionally.
Basic Input Output System (BIOS)
• The method of turning on a computer system after it has been shut off
is known as “cold booting”.
• Usually, this is done by pushing the power button of the computer.
Using cold booting, the “Power on Self-Test” (POST) is carried out.
• It is a series of system checks carried out when the boot process first
begins.
Steps For Cold Booting:
• Shutdown: Start by shutting down the PC. This may be carried out through the
running device’s shutdown option or by urgent the power button till the device
powers off.
• Power Off: Ensure that the pc is completely powered off.
• Wait: Wait for a few seconds for the system to completely power down.
• Power On: Press the power button to show on the pc. This initiates the cold
boot process.
• BIOS Initialization: The Basic Input Output System (BIOS) starts running,
initializing hardware components together with the CPU, memory, and devices.
It additionally performs a Power On Self Test (POST) to check for any hardware
issues.
• Operating System Load: Once the hardware initialization is done, the BIOS
locates the boot tool (commonly the difficult force or SSD) and masses
the operating system into memory.
• Operating System Initialization: The working machine starts running, initializing
software components and loading important drivers and services.
• User Login: If required, the operating device prompts the consumer to log in.
Once logged in, the consumer can begin the use of the pc.
2. Warm Booting
• Operating System Command: Start from inside the operating system. This may
be performed with the aid of choosing the restart option from the shutdown
menu or through urgent particular key combinations (e.g., Ctrl+Alt+Del) to
initiate a restart.
• Software Restart: The operating system sends a command to restart the device
without powering off.
• Hardware Reset: The CPU receives the restart command and initiates a
hardware reset.
• BIOS Skipped: Since the power isn’t became off, the BIOS initialization step is
skipped in the course of heat booting. This saves time as compared to cold
booting.
• Operating System Reload: The operating system reloads, restarting all device
services and tactics even as maintaining the machine country.
• User Login: If required, the operating system activates the consumer to log in
again. Once logged in, the person can resume using the computer with the
previous country preserved.
Difference between Cold Booting and Warm Booting
Reset button or by
Initialized by Power button. pressing Ctrl+Alt+Del
simultaneously.
Compiled By:
Dr. Narendra Kumar Sharma
Associate Professor, Dept. of MCA
Pranveer Singh Institute of Technology, Kanpur
Topics to be covered:
• This type of operating system does not interact with the computer
directly. There is an operator which takes similar jobs having the same
requirement and groups them into batches. It is the responsibility of
the operator to sort jobs with similar needs.
2. Multi-Programming Operating System
• Each task is given some time to execute so that all the tasks work
smoothly. Each user gets the time of the CPU as they use a single
system. These systems are also known as Multitasking Systems. The
task can be from a single user or different users also. The time that each
task gets to execute is called quantum. After this time interval is over
OS switches over to the next task.
6. Distributed Operating System
• Provides the facilities to create and modify programs and data files
using an editor.
• Access to the compiler for translating the user program from high-level
language to machine language.
• Provide a loader program to move the compiled program code to the
computer’s memory for execution.
• Provide routines that handle the details of I/O programming.
THANKS
System Components
and
System Call
Compiled By:
Dr. Narendra Kumar Sharma
Associate Professor, Dept. of MCA
Pranveer Singh Institute of Technology, Kanpur
Topics to be covered:
• Components of Operating System
– Process Management
– File Management
– Network Management
– Main Memory Management
– Secondary Storage Management
– I/O Device Management
– Security Management
– Command Interpreter System
• System Call
• Need of System Call
• Types of System Call
– Process Control
– File Management
– Device Management
– Information Maintenance
– Communication
Components of Operating System
i. Storage allocation
ii. Free space management
iii. Disk scheduling
6. I/O Device Management
• One of the important use of an operating system that helps to hide the
variations of specific hardware devices from the user.
• Functions of I/O management: The I/O management system offers the
following functions, such as:
• There are various situations where you must require system calls in the
operating system. Following of the situations are as follows:
• There are commonly five types of system calls. These are as follows:
1. Process Control
2. File Management
3. Device Management
4. Information Maintenance
5. Communication
1. Process Control
Process control is the system call that is used to direct the processes.
Some process control examples include creating, load, abort, end,
execute, process, terminate the process, etc.
2. File Management
File management is a system call that is used to handle the files. Some
file management examples include creating files, delete files, open,
close, read, write, etc.
3. Device Management
Device management is a system call that is used to deal with devices.
Some examples of device management include read, device, write, get
device attributes, release device, etc.
4. Information Maintenance
Information maintenance is a system call that is used to maintain
information. There are some examples of information maintenance,
including getting system data, set time or date, get time or date, set
system data, etc.
5. Communication
Communication is a system call that is used for communication. There
are some examples of communication, including create, delete
communication connections, send, receive messages, etc.
Examples of Windows and Unix system calls
• open(): The open() system call allows you to access a file on a file
system. It allocates resources to the file and provides a handle that the
process may refer to. Many processes can open a file at once or by a
single process only. It's all based on the file system and structure.
• read(): It is used to obtain data from a file on the file system. It accepts
three arguments in general:
– A file descriptor.
– A buffer to store read data.
– The number of bytes to read from the file.
The file descriptor of the file to be read could be used to identify it and
open it using open() before reading.
• wait(): In some systems, a process may have to wait for another
process to complete its execution before proceeding. When a parent
process makes a child process, the parent process execution is
suspended until the child process is finished. The wait() system call is
used to suspend the parent process. Once the child process has
completed its execution, control is returned to the parent process.
• write(): It is used to write data from a user buffer to a device like a file.
This system call is one way for a program to generate data. It takes
three arguments in general:
– A file descriptor.
– A pointer to the buffer in which data is saved.
– The number of bytes to be written from the buffer.
• fork(): Processes generate clones of themselves using
the fork() system call. It is one of the most common ways to create
processes in operating systems. When a parent process spawns a child
process, execution of the parent process is interrupted until the child
process completes. Once the child process has completed its execution,
control is returned to the parent process.
• close(): It is used to end file system access. When this system call is
invoked, it signifies that the program no longer requires the file, and
the buffers are flushed, the file information is altered, and the file
resources are de-allocated as a result.
• exec(): When an executable file replaces an earlier executable file in an
already executing process, this system function is invoked. As a new
process is not built, the old process identification stays, but the new
process replaces data, stack, data, head, etc.
• exit(): The exit() is a system call that is used to end program execution.
This call indicates that the thread execution is complete, which is
especially useful in multi-threaded environments. The operating system
reclaims resources spent by the process following the use of
the exit() system function.
THANKS
Operating System Structure
Compiled By:
Dr. Narendra Kumar Sharma
Associate Professor, Dept. of MCA
Pranveer Singh Institute of Technology, Kanpur
Topics to be covered:
• What is an Operating System Structure?
• Types of Operating System Structure
– Simple Structure
– Monolithic Structure
– Micro-Kernel Structure
– Hybrid-Kernel Structure
– Exo-Kernel Structure
– Layered Structure
– Modular Structures
– Virtual Machines
What is an Operating System Structure?
Compiled By:
Dr. Narendra Kumar Sharma
Associate Professor, Dept. of MCA
Pranveer Singh Institute of Technology, Kanpur
Topics to be covered:
• Layered Structure of OS
• Architecture of Layered Structure
– Hardware
– CPU Scheduling
– Memory Management
– Process Management
– IO Buffers
– User Program
• Advantages of Layered Structure
Layered Structure of Operating System
• CPU Scheduling: This layer deals with scheduling the processes for the
CPU. Many scheduling queues are used to handle processes. When the
processes enter the system, they are put into the job queue.
The processes that are ready to execute in the main memory are kept in
the ready queue. This layer is responsible for managing how many
processes will be allocated to the CPU and how many will stay out of
the CPU.
• I/O Buffer: I/O devices are very important in computer systems. They
provide users with the means of interacting with the system. This layer
handles the buffers for the I/O devices and makes sure that they work
correctly.