0% found this document useful (0 votes)
51 views33 pages

Final Os

Uploaded by

ankit47dd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views33 pages

Final Os

Uploaded by

ankit47dd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

Operating System Laboratory Chahat

UGCA(1926) (2201988)

INDEX
S.NO. Practical PAGE NO. REMARKS
1 Installation of windows OS. 2-10
2 Installation of Linux OS. 11-13
3 Dual boot installation of Operating systems. 14-16

4 Implementation of FCFS Scheduling algorithm 17-18

5 Implementation of SJF Scheduling algorithm 19-20

6 Implementation of Round-Robin Scheduling 21-23


algorithm
7 Vi Editor & its commands 24
8 Shell Commands 25
9 Shell Scripting- Using variables 26-27
10 Shell Scripting- Input & Output 28
11 Shell Scripting- Data types 29
12 Shell Scripting- Use of arithmetic operators 30
13 Shell Scripting- if control statement programs 31

14 Shell Scripting- while control statement 32


15 Shell Scripting- for control statement 33

2
Operating System Laboratory Chahat
UGCA(1926) (2201988)

Practical 1: - Installation of windows OS.

STEP 1:-
Create a Windows Installation Media. If you order Windows 10 for a new PC build, they may send you an
installation media. If you don't have a Windows installation media, you can make one. You'll need a
computer with internet access and an 8 GB USB flash drive (16 GB recommended). You also need to know
if the computer you want to install Windows 10 on has 32-bit or 64-bit architecture. You will also need to
purchase Windows to get a product key. This can be done before or after the installation. Use the following
steps to create a Windows Installation Media:
Insert a USB drive with at least 8 GB of space into any computer with internet
access.This will wipe any existing data on the USB drive, so be sure to back up any
data you want to keep.
Go to https://www.microsoft.com/en-us/software-download/windows10 in a web
browser.
Click Download Tool Now.
Open the "MediaCreationTool.exe" file in your web browser or Downloads folder.
Click Accept.
Select "Create Installation Media (USB drive, DVD, ISO file) for another PC" and
click Next.
Select "USB flash drive" and click Next.

3
Operating System Laboratory Chahat
UGCA(1926) (2201988)

STEP 2 :-
Back up your files (optional). If you already have a Windows installation on your computer,
a new Windows installation may overwrite your files. Back up any data you want to keep
before beginning a new Windows installation. You can back up your files to OneDrive,
Google Drive, Dropbox, or an external hard drive or USB flash drive.

STEP 3:-
Insert the Windows Installation Media in the computer you want to install Windows on. We
can insert the Windows Installation media into any free USB port.

4
Operating System Laboratory Chahat
UGCA(1926) (2201988)

STEP 4:-
Boot the computer. If the PC is already powered on, restart it using the normal restart
procedures of the operating system that is installed on the PC. If it is not yet powered on,
press the power button to boot it up.

STEP 5:-
Enter the Boot menu. Most newer computers have a boot menu you can enter while
booting up. The way you enter it is different, depending on your motherboard. The most
common way to enter the Boot menu is to press F10, F11, F12, F2, or Esc as the PC
boots up. This Boot menu will display a list of drives you can boot from.[1]
If you are using an older PC that does not have a Boot menu, you will need to
Enter the BIOS while booting up. The buttons you press to enter the BIOS is
different from one PC manufacturer to another. It will usually say what buttons
you need to press while your computer boots up. You typically need to press F1
F2, F3, Esc or Delete to enter the BIOS.[2] You may need to be quick about it.
You can also reboot your PC into the BIOS from inside the
Windows Settings menu.

5
Operating System Laboratory Chahat
UGCA(1926) (2201988)

STEP 6:-
Select the USB drive. This is the drive that has the Windows Installation Media. This will
boot the PC from the Windows Installation Media. Once the computer boots from the USB
drive, press any key to start the Windows installation process.
If you are inside the BIOS settings. Locate the option that says "Boot", "Boot order",
"Priorities" or something similar. Change the boot order so that your PC boots
from the USB drive first. Then select the option to save and exit.
This will reboot your PC from the USB drive.

STEP 7:-
Select your language, time and currency, and keyboard input and click Next . Use the
drop-down menus to first select your language. Then select your country or region, and
your keyboard input method. Then click Next.

6
Operating System Laboratory Chahat
UGCA(1926) (2201988)

STEP 8:-

Click Install Now . It's the button in the center of the screen.

STEP 9:-
Enter your Windows product key and click Next. If you've already purchased Windows, you
can find your license key in your confirmation email. If you have not purchased Windows,
click I don't have a product key. You'll need to purchase Windows and activate it later on.

7
Operating System Laboratory Chahat
UGCA(1926) (2201988)

STEP 10:-

Select which edition of Windows you want to install and click Next. If you've already
purchased Windows, check which version of Windows you purchased and make sure you
click the right version. If you have not yet purchased Windows, check which version you
want to install. Different versions of Windows have a different price.
If you are not sure which version of Windows to install, Windows Home
Edition is the most common version of Windows.

STEP 11:-
Click the checkbox next to "I accept the license terms" and click Next . You can read the license
terms in the window in the center. Click next when you are ready to continue.

8
Operating System Laboratory Chahat
UGCA(1926) (2201988)

STEP 12:-

Click Custom: Install Windows only or Upgrade: Install Windows and keep files, settings,
and applications. If your computer already has a Windows installation on it, click Upgrade:
Install Windows and keep files, settings, and applications. If your computer does not have a
Windows installation or you need to reinstall Windows, click Custom: Install Windows only.

STEP 13:-
Select a drive or partition you want to install Windows on and click Delete . If you have
multiple hard drives or a hard drive with multiple partitions, select the partition you want to
install Windows on and click Delete. Be aware that this will erase all data on the drive. Make
sure you have backed up all data you want to keep before continuing. This will leave the drive
with unallocated space.

9
Operating System Laboratory Chahat
UGCA(1926) (2201988)

STEP 14:-
Select a drive with unallocated space and click Next. This will start installing Windows on
the drive you selected. The amount of time it takes will depend on the hardware of your
computer.

STEP 15:-
Remove the USB flash drive and restart your computer. Once Windows is finished installing,
your computer will restart automatically. Remove the USB flash drive so that it does not try
to boot from the Flash drive again. The first time Windows boots up, you will need to go
through the Setup process.

10
Operating System Laboratory Chahat
UGCA(1926) (2201988)

Practical 2: - How to Install Linux on Windows 10.

STEP 1:-

Insert a bootable Linux USB drive.

STEP 2:-

Click the start menu. This is the button in the lower-left corner of your screen that looks
like the Windows logo.

STEP 3:-

Then hold down the SHIFT key while clicking Restart. This will take you into the
Windows Recovery Environment.

STEP 4:-

Then select Use a Device.

11
Operating System Laboratory Chahat
UGCA(1926) (2201988)

STEP 5:-
Find your device in the list. If you don’t see your drive, choose EFI USB Device ,then pick your drive
from the next screen

STEP 6:-

Your computer will now boot Linux. If your computer reboots Windows, there was either
an issue with your drive, or you might have to change settings in your BIOS.
Warning: Changing BIOS settings can damage your computer if you

STEP 7:-

Select Install Linux. Some distros also let you try out the OS before installing it here.

12
Operating System Laboratory Chahat
UGCA(1926) (2201988)

STEP 8:-

Go through the installation process. This will differ depending on which distro you are
trying to install. These details might include your WiFi network, language, time zone,
keyboard layout, etc. You might also be required to create an account with a username
and password. Make sure to write down any details, as you will likely need them in the
future.

STEP 9:-
Most distros will allow you to partition your drive or erase it and do a clean install during
the installation.
Warning: Erasing your disk will mean you will lose your settings, files,
and Windows operating system. Only select Erase if you have saved
copies of all your files before starting the install process.
STEP 10:-

Reboot your computer when prompted. If you have more than one OS in your system, you
will be taken to a GNU GRUB screen after rebooting. This screen allows you to select
which OS you want to boot.

If you do not see a GRUB screen when you boot up your computer, you can try moving your
Linux distro higher on your boot list in BIOS.

13
Operating System Laboratory Chahat
UGCA(1926) (2201988)

Practical 3: - How to dual-boot Linux and Windows

Running Windows 7 and Windows 10 on the same computer might be

Windows 10. Dual-booting using versions of Windows older than Windows 7 is also
possible - the steps to install them will be almost identical - though actually finding copies
of them may prove harder.

STEP 1:-
1. Get another copy of Windows

If you are running Windows 10 and need Windows 7, you will need to

STEP 2:-
2. Create bootable media

If your second copy of Windows is on a DVD, you can skip this step as you will be able
to use the DVD directly. Otherwise, you will need an empty DVD or USB flash drive of
at least 8GB (gigabytes) to create a bootable medium - a drive or disk that contains its
own operating system.

Microsoft has tools on its website for downloading and creating bootable media for
Windows 7 and Windows 10. All you need to do is enter the Windows product key,
download the tools and follow the instructions on them.

STEP 3:-
3. Create your new Windows partition

On a desktop computer, the easiest and safest way to dual boot is to buy and install a new
hard drive or solid-state drive (SSD) for the new

14
Operating System Laboratory Chahat
UGCA(1926) (2201988)

(i) On Windows 10, right-click the Windows icon on your taskbar

(ii) In Disk Management, find the partition that you would like to shrink to
make space for the new Windows installation. If you only have one disk
drive, this will most likely be Windows (C:).

(iii) In the dialog box that opens, choose the amount you would like to shrink
the partition by. You will want to have at least 128GB for your new
Windows installation.

15
Operating System Laboratory Chahat
UGCA(1926) (2201988)

(v) Follow the instruction on the tool to finish creating the new partition.

STEP 4:-

4. Install Windows

your computer from the


installation media you created, but Windows 7 and 10 have a handy option to perform a
new Windows installation straight from File Explorer. (i) Make sure that your
installation media (the DVD or USB flash drive) has been inserted into the computer and
open

16
Operating System Laboratory Chahat
UGCA(1926) (2201988)

(iv) Follow the rest of the installation steps according to your own preferences.

(v) Use the Windows boot manager to shift between operating systems.

Our Windows dual boot is now ready to use. Whenever you start or restart your
computer you will now see the boot manager, which will allow you to choose an
operating system. Use the Up and Down keys on

17
Operating System Laboratory Chahat
UGCA(1926) (2201988)

Practical 4: - Implementation of FCFS Scheduling algorithm.

ALGORITHM OF FCFS (First Come First serve) :-


1- Input the processes along with their burst time (bt).
2- Find waiting time (wt) for all processes. 3- As first process that
comes need not to wait so waiting time for process 1 will be 0 i.e.
wt[0] = 0.
4- Find waiting time for all other processes i.e. for process i ->
wt[i] = bt[i-1] + wt[i-1] .
5- Find turnaround time = waiting_time + burst_time for all
processes. 6- Find average waiting time = total_waiting_time
/ no_of_processes. 7- Similarly, find average turnaround time =
total_turn_around_time / no_of_processes.

18
Operating System Laboratory Chahat
UGCA(1926) (2201988)

PROGRAM OF FCFS IN C++ :-

OUTPUT :-

19
Operating System Laboratory Chahat
UGCA(1926) (2201988)

Practical 5: - Implementation of SJF Scheduling algorithm.

ALGORITHM OF SJF (Shortest Job First) :-


1. Sort all the process according to the arrival time.

2. Then select that process which has minimum arrival time and minimum Burst time.

3. After completion of process make a pool of process which after till the completion of
previous process and select that process among the pool which is having minimum Burst
time.

How to compute below times in SJF using a program?

1. Completion Time: Time at which process completes its execution.


2. Turn Around Time: Time Difference between completion time and arrival time. Turn
Around Time = Completion Time Arrival Time
3. Waiting Time(W.T): Time Difference between turn around time and burst time.
Waiting Time = Turn Around Time Burst Time

PROGRAM OF SJF IN C++ :-

20
Operating System Laboratory Chahat
UGCA(1926) (2201988)

OUTPUT :-

21
Operating System Laboratory Chahat
UGCA(1926) (2201988)

Practical 6: - Implementation of Round-Robin Scheduling algorithm

ALGORITHM OF ROUND ROBIN :-


1- Create an array rem_bt[] to keep track of remaining burst time of
processes. This array is initially a copy of bt[] (burst times array)
2- Create another array wt[] to store waiting times of processes. Initialize
this array as 0.
3- Initialize time : t = 0
4- Keep traversing the all processes while all processes are not done. Do
following for i'th process if it is not done yet. a- If rem_bt[i] >
quantum (i) t = t + quantum (ii) rem_bt[i] -= quantum; c-
Else // Last cycle for this process
(i) t = t + rem_bt[i];
(ii) wt[i] = t - bt[i]
(ii) rem_bt[i] = 0; // This process is over

PROGRAM OF ROUND ROBIN IN C++ :-

22
Operating System Laboratory Chahat
UGCA(1926) (2201988)

23
Operating System Laboratory Chahat
UGCA(1926) (2201988)

OUTPUT :-

24
Operating System Laboratory Chahat
UGCA(1926) (2201988)

Practical 7: - Vi Editor & its commands


Hello World in Ubuntu

What is your Name in Ubuntu

Choice in Ubuntu

25
Operating System Laboratory Chahat
UGCA(1926) (2201988)

Practical 8: - Shell Commands.

Commands pwd, echo, cd, man, cat, file

Commands - ls

Commands - a

26
Operating System Laboratory Chahat
UGCA(1926) (2201988)

Practical 9: - Shell Scripting- Using variable.

27
Operating System Laboratory Chahat
UGCA(1926) (2201988)

Practical 10: - Shell Scripting- Input & Output.

#!/bin/bash echo -n "What is your


favorite food: " # Assign input value
into a variable read answer
# Print the value of the variable echo
"Oh! you like $answer!"

OUTPUT

28
Operating System Laboratory Chahat
UGCA(1926) (2201988)

Practical 11: - Shell Scripting- Data types.

Data type Prefix Example

Boolean bln blnFound

Byte byt bytRasterData

Date (Time) dtm dtmStart

Double dbl dblTolerance

Integer int intQuantity

Long lng lngDistance

Object obj objCurrent

String str strFName

29
Operating System Laboratory Chahat
UGCA(1926) (2201988)

Practical 12: - shell scripting- use of arithmetic operators.


1. #!/bin/bash
2.
3. x=8
4. y=2
5. echo "x=8, y=2"
6. echo "Addition of x & y"
7. echo $(( $x + $y ))
8. echo "Subtraction of x & y"
9. echo $(( $x - $y ))
10. echo "Multiplication of x & y"
11. echo $(( $x * $y ))
12. echo "Division of x by y"
13. echo $(( $x / $y ))
14. echo "Exponentiation of x,y"
15. echo $(( $x ** $y ))
16. echo "Modular Division of x,y"
17. echo $(( $x % $y ))
18. echo "Incrementing x by 5, then x= "
19. (( x += 5 ))
20. echo $x
21. echo "Decrementing x by 5, then x= "
22. (( x -= 5 ))
23. echo $x
24. echo "Multiply of x by 5, then x="
25. (( x *= 5 ))
26. echo $x
27. echo "Dividing x by 5, x= "
28. (( x /= 5 ))
29. echo $x
30. echo "Remainder of Dividing x by 5, x="
31. (( x %= 5 ))

30
Operating System Laboratory Chahat
UGCA(1926) (2201988)

32. echo $x
OUTPUT

31
Operating System Laboratory Chahat
UGCA(1926) (2201988)

Practical 13: - Shell Scripting- if control statement programs

#!/bin/bash m=1
n=2

if [ $n -eq $m ] then echo "Both


variables are the same" else
echo "Both variables are different"
fi

OUTPUT

Both variables are different

32
Operating System Laboratory Chahat
UGCA(1926) (2201988)

Practical 14: - Shell Scripting- while control statement

1. #!/bin/bash
2. #Script to get specified numbers
3.
4. read -p "Enter starting number: " snum
5. read -p "Enter ending number: " enum
6.
7. while [[ $snum -le $enum ]];
8. do
9. echo $snum
10. ((snum++)) 11.
12. done
13. echo "This is the sequence that you wanted."

OUTPUT

33
Operating System Laboratory Chahat
UGCA(1926) (2201988)

Practical 15: - Shell Scripting- for control statement

#!/bin/sh

NUMS="1 2 3 4 5 6 7"

for NUM in $NUMS do


Q=`expr $NUM % 2`
if [ $Q -eq 0 ]
then echo "Number is an even number!!"
continue
fi
echo "Found odd number" done

OUTPUT

Found odd number Number


is an even number!!
Found odd number Number
is an even number!!
Found odd number Number
is an even number!!
Found odd number

34

You might also like