Full Os 53
Full Os 53
Engineering
Department of Information Technology Engineering
OPERATING SYSTEM
(SEIT2230) | B. Tech.
of Engineering
PRACTICAL - 1
int main(){
int A, B;
int main() {
int i,j,o,p;
for(j=2;j<=i;j++)
{ p=0;
for(o=2;o<=j-1;o++)
{
if(j%o==0){ p++;
}
}
if(p==0){ printf("%d\n",j);
}
} return 0;
}
Practical - 2
if (n < 0) {
printf("Factorial is not defined for negative numbers.\n");
} else {
23SE02CB053 NAKUM RUTIK D.
return 0;
}
OUTPUT:
23SE02CB053 NAKUM RUTIK D.
You make a new directory via mkdir newdirectoryname. You can remove a
directory using rmdir directoryname. To remove a directory, you must first
remove all the files it contains. To change directories to a directory that is
contained in the current directory use cd directoryname.
. cat stands for “concatenate” and is primarily used to read, display, and
concatenate text files.
Cat a.txt to print
Cat >> a.txt to read
PRACTICAL 3
AIM: ADDITION OF TWO NUMBERS. SOURCE CODE:
echo "Enter number 1" read a echo "Enter
number 2" read b c=$((a+b)) echo "sum of
numbers are: $c"
OUTPUT:
OUTPUT:
AIM:
SOURCE DODE:
echo "Hello World"; echo "Enter number
a" read a echo "Enter number b" read b
echo "Enter number c" read c
if [[ $a -gt $b && $a -gt $c ]] then echo "a:$a is
greatest" elif [[ $b -gt $a && $b -gt $c ]]
then echo "b:$b is greatest" else echo
"c:$c is gratest" fi
OUTPUT:
#include <stdio.h>
int main() {
int bt[20], p[20], wt[20], tat[20], i, j, n, total = 0, totalT = 0, pos, temp;
float avg_wt, avg_tat;
return 0;
}
Practical - 5.1
Q-Simulate Worst-Fit Algorithm for Contiguous Memory Allocation
Answer: #include <stdio.h>
#include <stdlib.h>
#define MAX 25
blockSize[wstIdx] -= processSize[i];
}
}
printf("\nProcess No.\tProcess Size\tBlock No.\n");
for (int i = 0; i < n; i++)
{
printf("%d\t\t%d\t\t", i+1, processSize[i]);
if (allocation[i] != -1)
printf("%d\n", allocation[i] + 1);
else
printf("Not Allocated\n");
}
}
int main()
{
int blockSize[MAX], processSize[MAX];
int m, n;
printf("Enter the number of blocks: ");
scanf("%d", &m); printf("Enter the
sizes of the blocks:\n"); for (int i = 0; i
< m; i++) scanf("%d",
&blockSize[i]);
Practical - 7.1
fifo(inp,numframe)
Output:
Operating System
23SE02CB053 SEIT2230
RUTIK NAKUM OPERATING SYSTEM
PRACTICAL 7.2
Simulate the Least Recently Used (LRU)/Optimal page replacement algorithm with a
page reference string.
CODE:
#include<stdio.h>
#include<limits.h> int n;
int checkHit(int incomingPage, int queue[], int occupied){
return 0;
}
int main()
{
int incomingStream[] = {7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2};
n= sizeof(incomingStream)/sizeof(incomingStream[0]);
int frames = 3; int queue[n]; int distance[n]; int
occupied = 0; int pagefault = 0;
printFrame(queue, occupied);
}
else{
if(queue[j] == incomingStream[k])
break;
}
printf("\n");
}
OUTPUT:
23SE02CB053 SEIT2230
RUTIK NAKUM OPERATING SYSTEM
PRATICAL 8.1
Simulate the First-Come-First-Serve (FCFS) disk scheduling algorithm, calculate
seek #me, and compare with other algorithms.
CODE:
start = 100 req = [55, 58, 60, 70, 18, 150, 160, 184]
while q:
return t
PARI PATEL
OPERATING SYSTEM 23SE02IE058
1
23SE02CB053 SEIT2230
RUTIK NAKUM OPERATING SYSTEM
OUTPUT
2
23SE02CB053 SEIT2230
RUTIK NAKUM OPERATING SYSTEM
PRATICAL 8.2
Simulate SCAN Disk Scheduling Algorithm
CODE:
start = 100 requests = [55, 58, 60, 70, 18, 150, 160, 184]
OUTPUT:
3
23SE02CB053 SEIT2230
RUTIK NAKUM OPERATING SYSTEM
Introduction
Operating systems (OS) serve as the backbone of computing environments across various industries,
providing essential services and security features that protect sensitive data and ensure operational
integrity. This report explores the implementation of OS security in banking, healthcare, and cloud
computing, focusing on protection mechanisms and Role-Based Access Control (RBAC).
OS Security Concepts
Protection Mechanisms
Protection mechanisms in operating systems are designed to safeguard data and resources from
unauthorized access and misuse. Key protection mechanisms include:
1. Access Control Lists (ACLs): Define permissions for users and groups on files and resources.
2. User Authentication: Verifies the identity of users through passwords, biometrics, or multi-factor
authentication.
3. Encryption: Protects data at rest and in transit, ensuring confidentiality and integrity.
4. Sandboxing: Isolates applications to prevent them from affecting each other or the OS.
RBAC is a security paradigm that restricts system access to authorized users based on their roles
within an organization. Roles are defined according to job functions, and permissions are assigned to
these roles rather than individual users, simplifying management and enhancing security.
Banking
In the banking sector, OS security is paramount due to the sensitive nature of financial data. Banks
utilize robust operating systems like Linux and Windows Server, implementing security features such
as:
4
23SE02CB053 SEIT2230
RUTIK NAKUM OPERATING SYSTEM
• RBAC: Employees are assigned roles such as teller, manager, or auditor, each with specific access rights
to financial systems and data.
For example, JPMorgan Chase employs a combination of Windows and Linux servers, utilizing RBAC
to ensure that only authorized personnel can access sensitive financial information.
Healthcare
The healthcare industry is heavily regulated, requiring stringent data protection measures to comply
with laws like HIPAA. Operating systems in this sector often include:
• Access Control Mechanisms: Ensuring that only authorized healthcare professionals can access
patient records.
• Audit Trails: Monitoring access to sensitive data to detect unauthorized attempts.
• RBAC: Roles such as doctor, nurse, and administrative staff are defined, with access tailored to their
specific needs.
A notable example is the use of Linux-based systems in electronic health record (EHR) management,
where RBAC is critical in protecting patient information while allowing necessary access for treatment.
Cloud Computing
Cloud computing platforms, such as AWS and Azure, rely on OS security to protect data across shared
environments. Key features include:
• Virtualization Security: Isolating virtual machines to prevent cross-VM attacks.
• Identity and Access Management (IAM): Implementing RBAC to manage user permissions across
cloud resources.
• Data Encryption: Ensuring data is encrypted both at rest and in transit.
For instance, AWS employs a layered security model that includes RBAC through IAM, allowing
organizations to define user roles and permissions for accessing cloud resources.
• Windows: Offers extensive security features, including BitLocker for disk encryption, Windows Defender
for malware protection, and Group Policy for managing user permissions. RBAC is implemented through
Active Directory.
5
23SE02CB053 SEIT2230
RUTIK NAKUM OPERATING SYSTEM
• Linux: Known for its robust security model, Linux provides SELinux and AppArmor for mandatory access
control, along with traditional RBAC. Its open-source nature allows for extensive customization and
security auditing.
• Cloud-Based OS: Security in cloud environments is often more complex due to multitenancy. Providers
implement strong encryption, IAM, and continuous monitoring to protect data. RBAC is crucial for
managing access across diverse user roles.
Amazon Web Services (AWS) Identity and Access Management (IAM) is a prime example of OS
security implementation in cloud computing. IAM allows organizations to create and manage AWS
users and groups, assigning permissions based on roles. This RBAC model ensures that users have
the minimum necessary access to perform their jobs, significantly reducing the risk of data breaches.
Conclusion
Operating systems play a critical role in securing sensitive data across various industries. By
implementing robust protection mechanisms and RBAC, organizations can effectively manage access
and protect against unauthorized use. The case studies in banking, healthcare, and cloud computing
illustrate the importance of OS security in maintaining data integrity and compliance with regulatory
standards. As technology evolves, the need for advanced security measures will continue to grow,
making OS security a vital area of focus for all industries.