OPERATING SYSTEM TUTORIAL
An Operating System (OS) is software that manages and handles the hardware
and software resources of a computer system. It provides interaction between users of
computers and computer hardware. An operating system is responsible for managing
and controlling all the activities and sharing of computer resources. An operating
system is a low-level Software that includes all the basic functions like processor
management, memory management, Error detection, etc.
This Operating System tutorial will cover all the basic to advance operating system
concepts like System Structure, CPU Scheduling, Deadlock, file and disk
management, and many more.
FAQs on Operating System
Q.1 Why learn Operating Systems?
Answer:
OS is the most important part of a computer. Through OS users can interact with
computer software. It provides an interface between Hardware and CPU. It also
provides a platform for the program to run on it and services to users. It performs all
the basic tasks required in an application.
Q.2 Write the top 10 Operating System Examples?
Answer:
Some most popular OS examples are given below:
Windows
Linux
MacOS
Ios
Android
Ubuntu
CentOS
Solaris
Chrome OS
Fedora
Q.3 What are the Advantages of a multiprocessor system?
Answer:
A multiprocessor system involves the processing of two or more computer programs
simultaneously that share the same memory area. It increases reliability.
Q.4 What is a thread in OS?
Answer:
A thread is a lightweight process or subprogram which is part of the process or a
program. A thread has its own Registers, Stack, State, and Program counter.
System Protection in Operating System
System protection in an operating system refers to the mechanisms implemented by
the operating system to ensure the security and integrity of the system. System
protection involves various techniques to prevent unauthorized access, misuse, or
modification of the operating system and its resources.
There are several ways in which an operating system can provide system protection:
User authentication: The operating system requires users to authenticate themselves
before accessing the system. Usernames and passwords are commonly used for this
purpose.
Access control: The operating system uses access control lists (ACLs) to determine
which users or processes have permission to access specific resources or perform
specific actions.
Encryption: The operating system can use encryption to protect sensitive data and
prevent unauthorized access.
Firewall: A firewall is a software program that monitors and controls incoming and
outgoing network traffic based on predefined security rules.
Antivirus software: Antivirus software is used to protect the system from viruses,
malware, and other malicious software.
System updates and patches: The operating system must be kept up-to-date with the
latest security patches and updates to prevent known vulnerabilities from being
exploited.
By implementing these protection mechanisms, the operating system can prevent
unauthorized access to the system, protect sensitive data, and ensure the overall
security and integrity of the system.
What is Protection?
Protection refers to a mechanism which controls the access of programs, processes,
or users to the resources defined by a computer system. We can take protection as a
helper to multi programming operating system, so that many users might safely share
a common logical name space such as directory or files.
Need for Protection:
To prevent the access of unauthorized users
To ensure that each active programs or processes in the system uses resources
only as the stated policy
To improve reliability by detecting latent errors
Role of Protection:
The role of protection is to provide a mechanism that implement policies which
defines the uses of resources in the computer system. Some policies are defined at the
time of design of the system, some are designed by management of the system and
some are defined by the users of the system to protect their own files and programs.
Every application has different policies for use of the resources and they may change
over time so protection of the system is not only concern of the designer of the
operating system. Application programmer should also design the protection
mechanism to protect their system against misuse. Policy is different from
mechanism. Mechanisms determine how something will be done and policies
determine what will be done. Policies are changed over time and place to place.
Separation of mechanism and policy is important for the flexibility of the system.
Advantages of system protection in an operating system:
1. Ensures the security and integrity of the system
2. Prevents unauthorized access, misuse, or modification of the operating system
and its resources
3. Protects sensitive data
4. Provides a secure environment for users and applications
5. Prevents malware and other security threats from infecting the system
6. Allows for safe sharing of resources and data among users and applications
7. Helps maintain compliance with security regulations and standards
Disadvantages of system protection in an operating system:
1. Can be complex and difficult to implement and manage
2. May slow down system performance due to increased security measures
3. Can cause compatibility issues with some applications or hardware
4. Can create a false sense of security if users are not properly educated on safe
computing practices
5. Can create additional costs for implementing and maintaining security
measures.
Hardware Protection and Type of Hardware Protection
In this article, we are going to learn about hardware protection and its types. So first,
let’s take a look at the type of hardware which is used in a computer system. We
know that a computer system consists of hardware components like processor,
monitor, RAM and many more. The important thing is, that the operating system
ensures that these devices are not directly accessible by the user.
Basically, hardware protection is divided into 3 categories: CPU protection, Memory
Protection, and I/O protection. These are explained as follows:
1. CPU Protection:
CPU protection ensures that, a process does not monopolize the CPU indefinitely,
as it would prevent other processes from being executed. Each process should get
a limited time, so that every process gets time to execute its instructions. To
address this, a timer is used to limit the amount of time, which a process can
occupy from the CPU. After the timer expires, a signal is sent to the process for
relinquishing the CPU. Hence one process cannot hold the CPU forever.
2. Memory Protection:
In memory protection, we are talking about that situation when two or more
processes are in memory and one process may access the other process memory.
To prevent this situation, we use two registers which are known as:
1. Base register
2. Limit register
So basically, Base register store the starting address of program and limit register
store the size of the process. This is done to ensure that whenever a process wants to
access the memory, the OS can check that – Is the memory area which the process
wants to access is privileged to be accessed by that process or not.
3. I/O Protection:
With I/O protection, an OS ensures that following can be never done by a processes:
1. Termination I/O of other process – This means one process should not be
able to terminate I/O operation of othe processes.
2. View I/O of other process – One process should not be able to access the data
being read/written by other processes from/to the Disk(s).
3. Giving priority to a particular process I/O – No process must be able to
prioritize itself or other processes which are doing I/O operations, over other
processes.
Protection in OS: Domain of Protection, Association, Authentication
In this, we will cover the overview of Protection in OS, it’s need and Goals of
protection. And mainly will focus on Protection in OS like Domain of Protection,
Association, Authentication in details. Let’s discuss it one by one.
Need of protection OS:
To ensure data safety, process and program safety against illegal user access, or
even program access, we need protection.
It is to ensure that programs, resources and data are accessed only according to
the systems’ policies.
It is also to ensure that there are no access rights’ breach, no unauthorized
access to the existing data, no virus or worms.
There can be security threats such as unauthorized reading, writing,
modification or preventing the system to work properly for the authorized
users themselves.
Goals of Protection:
Therefore, protection is a method of safeguarding data and processes against
malicious and intentional intrusion. For that purpose, we have protection
policies that are either designed by the system itself or specified by the
management itself or are imposed by the programmers individually to protect
their programs with extra safety.
It also gives a multiprogramming OS the sense of safety that is required by its
users to share common space like files or directories.
The policies bind how the processes are to access the resources present in the
computer system, resources like CPU, memory, software and even the OS.
Both the OS designer and the application programmer are responsible for this.
However, these policies always change from time to time.
Domain of Protection:
The protection policies limit the access of each process with respect to their
resource handling. A process is bound to use only those resources which it
requires to complete its task, in the time limit that it requires and also the mode
in which it is required. That is the protected domain of a process.
A computer system has processes and objects, which are treated as abstract
data types, and these objects have operations specific to them. A domain
element is described as <object, {set of operations on object}>.
Each domain consists of a set of objects and the operations that can be
performed on them. A domain can consist of either only a process or a
procedure or a user. Then, if a domain corresponds to a procedure, then
changing domain would mean changing procedure ID. Objects may share a
common operation or two. Then the domains overlap.
Association between process and domain:
Processes switch from one domain to other when they have the access right to do so.
It can be of two types as follows.
1. Fixed or static –
In fixed association, all the access rights can be given to the processes at the
very beginning but that give rise to a lot of access rights for domain switching.
So, a way of changing the contents of the domain is found dynamically.
2. Changing or dynamic –
In dynamic association where a process can switch dynamically, creating a new
domain in the process, if need be.
Security Measures:
Security measures at different levels are taken against malpractices, such as no
person should be allowed on the premises or allowed access to the systems.
The network that is used for the transfer of files must be secure at all times. No
alien software must be able to extract information from the network while the
transfer. This is known as Network Sniffing, and it can be prevented by
introducing encrypted channels of data transfer. Also, the OS must be able to
resist against forceful or even accidental violations.
The best ways of authentication are using a username password combination,
using fingerprint, eye retina scan or even user cards to access the system.
Passwords are a good method to authenticate, but it is also one of the most
common as well as vulnerable methods. To crack passwords is not too hard.
While there are weak passwords, but even hard passwords can be cracked by
either sniffing around or giving access to multiple users or even network
sniffing as mentioned above.
Security Authentication:
To make passwords strong and a formidable authentication source, one-time
passwords, encrypted passwords and Cryptography are used as follows.
1. One Time Passwords –
It is used in such a way that it is unique at every instance of login by the user. It
is a pair of passwords combined to give the user access. The system generates a
random number and the user provides a complementary one or the system and
the user are provided a random number by an algorithm and through a common
function that the two share they match the output and thus get access.
2. Encrypted Passwords –
It is also a very way to authenticate access. Encrypted data is passed over the
network which does the transfer and checking of the passwords that helps in
the data passage without interruption or interception.
3. Cryptography –
It is another method of ensuring that data transfer over a network is not
available to the unauthorized users. This helps in transfer of data with full
protection. It protects the data by introducing the concept of a key. The key is
very important here. When a user sends the data, he encodes it using a
computer possessing the key and the receiver also has to decode the data using
the very same key. Thus, even if the data is stolen mid-way, there’s still a big
possibility that the unauthorized user cannot access it.
Protection is an essential aspect of an operating system, which ensures the safety and
security of system resources and data. It provides a way to control access to resources
and ensure that unauthorized access is prevented.
There are three main components of protection in an operating system: domain of
protection, association, and authentication.
1. Domain of Protection: The domain of protection is the set of resources that are
controlled by a particular protection mechanism. In an operating system, a
domain can be defined as a set of objects that are accessed by a set of subjects.
Objects are resources, such as files, memory, and I/O devices, while subjects
are entities that access these resources, such as processes, users, and groups.
Each domain has a specific set of rules that govern the access to its objects by
its subjects.
2. Association: Association is the mapping of a subject to a domain of protection.
In other words, it is the relationship between a subject and the set of resources
that it is authorized to access. In an operating system, association can be
defined as the process of assigning a subject to a domain of protection based on
its authentication credentials. Authentication credentials can be a password, a
digital certificate, or a biometric identifier.
3. Authentication: Authentication is the process of verifying the identity of a
subject before granting access to protected resources. Authentication is an
essential component of protection because it ensures that only authorized
subjects can access protected resources. In an operating system, authentication
can be implemented using various methods, such as passwords, digital
certificates, smart cards, and biometric identifiers.
4. In summary, protection in an operating system is achieved through the
combination of domain of protection, association, and authentication. The
domain of protection defines the set of resources that are controlled by the
protection mechanism, association maps subjects to domains of protection, and
authentication ensures that only authorized subjects can access protected
resources.
System Programs in Operating System
System Programming can be defined as the act of building Systems Software using
System Programming Languages. According to Computer Hierarchy, Hardware
comes first then is Operating System, System Programs, and finally Application
Programs. Program Development and Execution can be done conveniently in System
Programs. Some of the System Programs are simply user interfaces, others are
complex. It traditionally sits between the user interface and system calls.
In the context of an operating system, system programs are nothing but a special
software which give us facility to manage and control the computer’s hardware and
resources.
Fork System Call in Operating System
In many operating systems, the fork system call is an essential operation. The fork
system call allows the creation of a new process. When a process calls the fork(), it
duplicates itself, resulting in two processes running at the same time. The new
process that is created is called a child process. It is a copy of the parent process.
The fork syst em call is
required
for process c ASSIGNMENT TOPICS reation and
enables many
important features such as parallel processing, multitasking, and the creation of
complex process hierarchies.
MOTHER THERESA INSTITUTE OF ENGINEERING & TECHNOLOGY
MELUMOI (P&V), PALAMANER-517408
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Name of the Subject : OPERATING SYSTEMS
Max. Marks : 10
Subject Code & Regulation : 20A05402T & R20
Name of the Faculty: G.JAYAGOPI
Designation : ASSOCIATE PROFESSOR
Department : COMPUTER SCIENCE AND ENGINEERING
Phone Number : 8903661681
E- E-mail Id : jayagopi0075@gmail.com
ASSIGNMENT - 1
S.No TOPICS
1 OPERATING SYSTEM FUNCTIONS
2 OPEN – SOURCE OPERATING SYSTEMS
3 OPERATING SYSTEM DESIGN AND IMPLEMENTATION
4 MULTITHREADING MODELS
5 SCHEDULING ALGORITHMS
ASSIGNMENT - 2
S.No TOPICS
1 CONTINGUOUS MEMORY ALLOCATION
2 PAGE REPLACEMENT ALGORITHMS
3 DEADLOCK DETECTION AND RECOVERY
4 DISK SCHEDULING
5 FIREWALLING TO PROTECT SYSTEMS AND NETWORKS
Detailed Key & Scheme of Evaluation
Signature
MOTHER THERESA INSTITUTE OF ENGINEERING & TECHNOLOGY
MELUMOI (P&V), PALAMANER-517408
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Name of the Examination : II B.TECH II SEM I MID EXAMINATION MAY-2024
Name of the Subject : OPERATING SYSTEMS
Max. Marks : 30
Subject Code & Regulation: 20A05402T & R20
Name of the Faculty: G.JAYAGOPI
Designation : ASSOCIATE PROFESSOR
Department : COMPUTER SCIENCE AND ENGINEERING
Phone Number : 8903661681
E- E-mail Id : jayagopi0075@gmail.com
Step
Question
Detailed Step by Step Procedure wise
No. marks
division
1 (a) Diagram (Architecture): 3
Explanation: 2
(b) Protection 2
Security 3
2 (a) Services of OS: 3
Explanation: 2
(b) Types of system calls: 1
Explanation: 3
Example: 1
3 (a) What is process? 1
Process state (sketch): 2
Explanation: 3
(b) Differences (5) 5
4 (a) Explain: Process Creation 3
Explain: Process Termination 2
(b) IPC in Client-Server(sketch) 2
Explanation 3
5 (a) SJF Explanation 3
Example 2
(b)
RR scheduling Explanation: 3
Example 2
6 (a) Define Critical Section Problem: 2
Requirements: 1
Solution: Detailed Key & Scheme of Evaluation 2
(b) Semaphore (structure): 2
Explanation: 2
Example: 1
***END***
Note: 1) If you have more or less sections like a, b, c and d etc. You may add or delete rows accordingly.
2) Send the Soft Copy (PDF) of scheme of valuation to the examination branch mail id:
examsection@mtieat.org
Prepared By: G. JAYAGOPI, M.E., Ph.D.
MOTHER THERESA INSTITUTE OF ENGINEERING & TECHNOLOGY
MELUMOI (P&V), PALAMANER-517408
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Name of the Examination : II B.TECH II SEM II MID EXAMINATION MAY-2024
Name of the Subject : OPERATING SYSTEMS
Max. Marks : 30
Subject Code & Regulation: 20A05402T & R20
Name of the Faculty: G.JAYAGOPI
Designation : ASSOCIATE PROFESSOR
Department : COMPUTER SCIENCE AND ENGINEERING
Phone Number : 8903661681
E- E-mail Id : jayagopi0075@gmail.com
Step
Question
Detailed Step by Step Procedure wise
No. marks
division
1 (a) Diagram (Architecture): 3
Explanation: 2
(b) Functions 2
Security 3
2 (a) Services of OS: 3
Explanation: 2
(b) Types of system calls: 1
Explanation: 3
Example: 1
3 (a) PCB (sketch) 3
Explanation: 2
(b) Differences (5) 5
4 (a) IPC in Client-Server(sketch) 3
Explanation: 2
(b) Multithreading models 2
Explanation: 3
5 (a) FCFS Explanation 3
Example 2
(b) RR scheduling Explanation: 3
Example 2
6 (a) Define Critical Section Problem: 2
Requirements: 1
Solution: 2
(b) Semaphore (structure): 2
Explanation: 2
Example: 1
***END***
Note: 1) If you have more or less sections like a, b, c and d etc. You may add or delete rows accordingly.
2) Send the Soft Copy (PDF) of scheme of valuation to the examination branch mail id:
examsection@mtieat.org
Prepared By: G. JAYAGOPI, M.E., Ph.D.