Академический Документы
Профессиональный Документы
Культура Документы
Operating System
(CMP-3621)
Contents
System Information............................................................................................................................... 2
System Configuration ............................................................................................................................ 3
Task Manager ........................................................................................................................................ 4
Disk Management (Shrink, Extend Volumes ets…) ............................................................................... 6
Introduction to Command Line Interface (CLI) ..................................................................................... 8
2
System Information
A free tool included with Microsoft Windows that allows users to
view information about the computer, its hardware, drivers, and software
related data. The picture below is an example of the Windows System
Information tool showing the System Summary for the computer.
3
System Configuration
A system configuration (SC) in systems engineering defines the
computers, processes, and devices that compose the system and its
boundary. More generally, the system configuration is the specific
definition of the elements that define and/or prescribe what a system
is composed.
Task Manager
Task Manager, previously known as Windows Task
Manager, is a task manager, system monitor, and startup
manager included with Microsoft Windows systems. It
provides limited information about computer performance
and running
applications, processes and CPU usage, commit charge and
memory information, network activity and statistics, logged-in
users, and system service
5
s
6
2. Select the adjacent disk of the disk you want to extend, right
click and choose Shrink Volume to create some free disk space.
Text file
Time cmd
Data cmd
Volum cmd
16
Version cmd
Directory cmd
Backward cmd
18
Color cmd
Hide
Unhide
21
Create
22
Removed
Diskpart utility
before
23
After
24
Network commands
Ip configuration cmd
Ping cmd
25
Trace cmd
26
CPU Scheduling
27
#include<iostream>
#include<conio.h>
using namespace std;
class cpus
{
int n,bt[20]; // bt( bust time),
n(no of processes)
float atat,awt,wt[20],tat[20];
//atat(averge turn aournd time),awt(averge
waiting time),wt(waiting time),tat(turn
aournd time)
public:
void getdata();
void fcfs ();
void sjf();
void rr();
void p();
};
// get processes and bust time
void cpus::getdata()
28
{
int i;
cout<<"Enter the no of processes
max[20]=";
cin>>n;
for( i=1;i<=n;i++)
{
cout<<"Enter bust time of proesses
p"<<i<<"=";
cin>>bt[i];
}
}
//First come First served Algorithm
void cpus::fcfs()
{
int i=1,b[20];
float sum=0.0,sum1=0.0;
atat=0.0;
b[1]=bt[1];
wt[0]=0;
29
for(i=1;i<=n;i++)
{
b[i]=bt[i];
cout<<"p"<<i<<"="<<b[i]<<"\t";
}
cout<<"\n\n FCFS \n\n";
}
awt=sum/n;
atat=sum1/n;
cout<<"\nThe Averge of waiting time
="<<awt;
cout<<"\nthe averge of the turnaround
time ="<<atat;
}
//Shortest job First Algorithm
void cpus::sjf()
{
int i,j,temp,b[20];
float sum=0.0,sum1=0.0;
for(i=1;i<=n;i++)
{
b[i]=bt[i];
cout<<"p"<<i<<"="<<b[i]<<"\t";
}
cout<<"\n\n SJF
\n\n";
31
for(i=n;i>=1;i--)
{
for(j=2;j<=n;j++)
{
if(b[j-1]>b[j])
{
temp=b[j-1];
b[j-1]=b[j];
b[j]=temp;
}
}
}
wt[0]=0;
cout<<"\n prosses \t bust time \t
waiting time \t turn around time";
for(i=1;i<=n;i++)
{
cout<<"\np"<<i<<"\t\t\t";
cout<<b[i]<<"\t\t";
32
wt[i]=b[i]+wt[i-1];
cout<<wt[i-1]<<"\t\t";
tat[i]=wt[i];
cout<<tat[i];
sum+=wt[i]-b[i];
sum1+=tat[i];
}
awt=sum/n;
atat=sum1/n;
cout<<"\nThe Averge of waiting time
="<<awt;
cout<<"\nthe averge of the turnaround
time ="<<atat;
}
//Round Robin Algorithm
void cpus::rr()
{
int i,j,b[20],qt,totalbt,temp,count,value;
float sum=0.0,sum1=0.0;
count=0,value=0;
33
b[i]=0;
}
else if(b[i]>qt)
{
b[i]=b[i]-qt;
temp=qt;
}
value=value+temp;
tat[i]=value;
}
}
for(i=1;i<=n;i++)
{
wt[i]=tat[i]-bt[i];
sum+=wt[i];
sum1+=tat[i];
}
cout<<"\n\n Round Robin
\n\n";
35
// Priority Alogorithm
void cpus::p()
{
36
int
b[20],pr[20],c[20],count[20][99],i,j,temp;
temp=0;
float sum=0,sum1=0;
cout<<"\n priority processes\n";
for (i=1;i<=n;i++)
{
b[i]=bt[i];
cout<<"p"<<i<<"=";
cin>>pr[i];
c[i]=pr[i];
}
cout<<"\n user input
\n"<<endl;
cout<<"processes busttime
priority\n";
for(i=1;i<=n;i++)
{
37
cout<<" p"<<i<<"
"<<b[i]<<" "<<c[i]<<endl;
}
cout<<"\n\n output
table "<<endl;
for(i=n;i>=1;i--)
{
for(j=2;j<=n;j++)
{
if(c[j-1]>c[j])
{
temp=c[j-1];
c[j-1]=c[j];
c[j]=temp;
temp=b[j-1];
b[j-1]=b[j];
b[j]=temp;
}
38
}
}
wt[0]=0;
cout<<"\n\n Priority Alogorithm
\n\n";
cout<<"\n prosses \t bust time \t
waiting time \t turn around time";
for(i=1;i<=n;i++)
{
cout<<"\np"<<i<<"\t\t\t";
cout<<b[i]<<"\t\t";
wt[i]=b[i]+wt[i-1];
cout<<wt[i-1]<<"\t\t";
tat[i]=wt[i];
cout<<tat[i];
sum+=wt[i]-b[i];
sum1+=tat[i];
}
awt=sum/n;
39
atat=sum1/n;
cout<<"\nThe Averge of waiting time
="<<awt;
cout<<"\nthe averge of the turnaround
time ="<<atat;
}
main()
{
cpus c;
int a;
cout<<" 1: First come First served
Algorithm"<<endl;
cout<<" 2: Shortest job First
Algorithm"<<endl;
cout<<" 3: Round Robin
Algorithm"<<endl;
cout<<" 4: Priority Alogorithm"<<endl;
cout<<" 5: All Algorithm"<<endl;
cout<<" 6: Exit"<<endl;
40
do
{
switch(a)
{
case 0:
break;
case 1:
c.getdata();
c.fcfs();
break;
case 2:
c.getdata();
c.sjf();
break;
case 3:
c.getdata();
c.rr();
break;
case 4:
c.getdata();
41
c.p();
break;
case 5:
c.getdata();
cout<<endl;
c.fcfs();
cout<<endl;
c.sjf();
cout<<endl;
c.rr();
cout<<endl;
c.p();
break;
case 6:
break;
}
cout<<"\nEnter your choice=";
cin>>a;
}
while(a<6);
42
return 0;
}
43
Banker Algorithm
#include<iostream>
#include<conio.h>
using namespace std;
main()
{
int
n,m,tot[10],alloc[10][10],max[10][10],i,j;
int avi[10],need[10][10];
cout<<"Enter no. of processes=";
cin>>n;
cout<<"enter no. of resources=";
cin>>m;
for(i=0;i<m;i++)
44
{
cout<<"Enter no.of instances:";
cin>>tot[i];
}
//create maxium instances matric
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
{
cout<<"Enter no. of maxium instances of P
"<<i+1<<" allocated to I "<<j+1<<":" ;
cin>>max[i][j];
}
}
//create allocations matrix
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
{
45
}
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
{
tot[j]=tot[j]-alloc[i][j];
avi[j]=tot[j];
}
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
46
{
need[i][j]=max[i][j]-alloc[i][j];
}
}
cout<<"\nAviable"<<endl;
for(i=0;i<m;i++)
{
cout<<avi[i]<<"\t";
}
cout<<"\nAllocation "<<endl;
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
{
cout<<alloc[i][j]<<"\t";
}
cout<<"\n";
}
47
cout<<"\n maximum"<<endl;
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
{
cout<<max[i][j]<<"\t";
}
cout<<endl;
}
cout<<"\nneeded"<<endl;
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
{
cout<<need[i][j]<<"\t";
}
cout<<endl;
}
int work[10],k,p=0,q,e,f;
for(i=0;i<n;i++)
48
work[i]=avi[i];
k=0;
int ss[10],fin[10];
for(i=0;i<n;i++)
ss[i]=0;
cout<<"\nSafe Sequence\n";
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
{
if(need[i][j]<=work[j])
{
p++;
if(p==m)
{
p=0;
for(j=0;j<m;j++)
{
work[j]=work[j]+alloc[i][j];
}
49
k++;
cout<<i<<",";
}
}
}
}
/* cout<<"\nSafe Sequence\n";
for(i=0;i<k;i++)
cout<<ss[i]<<",";*/
if(k==n)
cout<<"\nSystem is safe\n";
else
cout<<"\nDeadlock occur \n";
}
50
# include <iostream>
# include <conio.h>
using namespace std;
int getp(int count[],int b)
{
int max=count[0];
int pos=0;
for(int i=0;i<b;i++)
{
if(count[i]>max)
{
pos=i;
max=count[i];
}
}
return pos;
}
main()
{
int page[20],frame[10],count[10];
52
int np,nf,pf=0;
cout<<"Enter the number of page
max[20] : ";
cin>>np;
cout<<"Enter the number of frames
max[10] :";
cin>>nf;
cout<<"Enter string:\n";
for(int i=0;i<np;i++)
{
cin>>page[i];
}
cout<<"The page refernces string :";
for(int i=0;i<np;i++)
{
cout<<page[i]<<" ";
}
for(int i=0;i<nf;i++)
{
frame[i]=0;
53
count[i]=0;
}
for(int i=0;i<np;i++)
{
int f=0,j;
for(j=0;j<nf;j++)
{
if(frame[j]==page[i])
{
f=1; //if page is present in
frames
break;
}
}
// if page is not present in frame
if (f==0)
{
pf++;
for(j=0;j<nf;j++)
{
54
if(frame[j]==0)
{
frame[j]=page[i];
f=1;
count[j]++;
break;
}
}
}
//if there are no ampty frame
if (f==0)
{
int pos,k;
pos=getp (count,nf);
frame[pos]=page[i];
count[pos]=1;
for(k=0;k<nf;k++)
{
if(k!=pos)
{
55
count[k]++;
}
}
}
cout<<endl;
for(j=0;j<nf;j++)
{
cout<<frame[j]<<" ";
}