OS Chapter One
OS Chapter One
LECTURE NOTE
For Second Year Software Engineering Regular
Students
Chapter One
Fundamental of Operating System
Hardware refers to the physical components of a computer system. These are tangible devices that work
together to process data and execute tasks.
Key Components of Hardware:
Central Processing Unit (CPU): The "brain" of the computer, responsible for executing instructions and
performing calculations.
Memory (RAM): Temporary storage that holds data and instructions currently in use by the CPU.
Storage Devices: Permanent storage for data, such as Hard Disk Drives (HDDs), Solid-State Drives (SSDs),
and optical drives.
Input Devices: Tools like keyboards, mice, and scanners that allow users to input data.
Output Devices: Tools like monitors, printers, and speakers that display or produce results.
Motherboard: The main circuit board that connects all hardware components.
Software
Software is a set of instructions, programs, or data that enables a
computer or electronic device to perform specific tasks or functions.
Unlike hardware, which refers to the physical components of a computer.
Software is intangible and includes various types of applications and
systems that allow users to interact with the technology.
Application software
1. Program execution
2. I/O operation
3. File system manipulation
4. Communications
5. Error detection
1. Program execution: Operating system loads a program into memory and
executes the program. The program must be able to end its execution,
either normally or abnormally.
2. I/O Operation : I/O means any file or any specific I/O device. Program may
require any I/O device while running. So operating system must provide the
required I/O.
3. File system manipulation : Program needs to read a file or write a file.
The operating system gives the permission to the program for operation on
file.
4. Communication : Data transfer between two processes is required for some time.
The both processes are on the one computer or on different computer but connected
through computer network. Communication may be implemented by two methods:
Shared memory
Message passing.
5. Error detection : error may occur in CPU, in I/O devices or in the memory
hardware. The operating system constantly needs to be aware of possible errors. It
should take the appropriate action to ensure correct and consistent computing.
Operating system with multiple users provides following services:
A. Resource Allocation
B. Accounting
C. Protection
Resource Allocation :If there are more than one user or jobs running at the same
time, then resources must be allocated to each of them. Operating system manages
different types of resources require special allocation code, i.e. main memory, CPU
cycles and file storage.
There are some resources which require only general request and release code. For
allocating CPU, CPU scheduling algorithms are used for better utilization of CPU. CPU
scheduling algorithms are used for better utilization of CPU. CPU scheduling routines
consider the speed of the CPU, number of available registers and other required
factors.
Accounting : Logs of each user must be kept. It is also necessary to keep record of
which user how much and what kinds of computer resources. This log is used for
accounting purposes.
The accounting data may be used for statistics or for the billing. It also used to
improve system efficiency.
Protection :Protection involves ensuring that all access to system resources is
controlled. Security starts with each user having to authenticate to the system,
usually by means of a password. External I/O devices must be also protected from
invalid access attempts.
In protection, all the access to the resources is controlled. In multiprocess
environment, it is possible that, one process to interface with the other, or with the
operating system, so protection is required.
Operating System Components
Modern operating systems share the goal of supporting the system components. The
system components are :
Process Management
Main-Memory Management
Secondary-Storage Management
I/O System Management
File Management
Protection System
Networking
Command-Interpreter System
Process management
Every software application program has one or more processes associated with them
when they are running.
Functions of process management in OS includes:
A buffer-caching system
A general device-driver interface
Drivers for specific hardware devices (device drivers)
Device Drivers
Must have access to I/O hardware
Must be able to handle interrupts.
Communicate with other parts of the OS (File system,Networking etc).
File Management
A file is a collection of related information.
Commonly, files represent programs (both source and object forms) and data.
The operating system is responsible for the following activities in connection
with file management:
File creation and deletion.
Directory creation and deletion.
Support of primitives for manipulating files and directories.
Mapping files onto secondary storage. e.g. free space allocation.
File backup on stable (non-volatile) storage media.
Protection System
Protection refers to a mechanism for controlling access by programs, processes,
or users to both system and user resources.
Operating Systems commonly control access by using permissions. All system
resources have an owner and a permission associated with them.
Users may be combined into groups for the purpose of protection. e.g. in UNIX every
file has an owner and a group.
Networking(Distributed system)
A distributed system is a collection of processors that do not share memory,
peripheral devices, or a clock.
The processors communicate with one another through communication lines called
network
Command-Interpreter System
Many commands are given to the operating system by control statements which deal with:
process creation and management (e.g. running a program)
I/O handling (e.g. set terminal type)
secondary-storage management (e.g. format a disk)
main-memory management (e.g. specify virtual memory
parameters)
file-system access (e.g. print file)
protection (e.g. set permissions)
networking (e.g. set IP address)
The program that reads and interprets control statements is called variously:
command-line interpreter
shell (in UNIX)
Type of Operating system
Batch System
Time Sharing System
Distributed operating system
Network operating system
Real-time operating system
Batch Operating System
The users of batch operating system do not interact with the computer directly.
• Each user prepares his job on an off-line device like punch cards and submits it to
the computer operator. To speed up processing, jobs with similar needs are batched
together and run as a group.
• Thus, the programmers left their programs with the operator. The operator then
sorts programs into batches with similar requirements.
Eg: payroll system, bank statement
The problems with Batch Systems are following.
Lack of interaction between the user and job.
CPU is often idle, because the speeds of the mechanical I/O devices is slower than CPU.
Difficult to provide the desired priority.
Time Sharing operating System
Disadvantages
Problem of reliability.
Question of security.
Problem of data communication.
Distributed operating system