Kingdom of Saudi Arabia المملكة العربية السعودية
Ministry of Higher Education وزارة التعليم العالي
Najran University جامعة نجران
College of Computer Science and
Information Systems كلية علوم الحاسب ونظم المعلومات
Department of computer Science قسم علوم الحاسب
Department of Information Systems قسم نظم المعلومات
Course Code: 227CSS-3 Lab Report # : 2
Course Name: Operating Systems Date:
Student Name:_____________________________________ ID:____________________
To Understand the use of Oracle VM VirtualBox for Linux
environment and how to create, compile and execute C
programs
1. OBJECTIVE AND LEARNING OUTCOMES
1.1 OBJECTIVE
The objective of the lab exercise is to give the general overview of Oracle VM VirtualBox and
how to use it under Linux environment. C language will be used as an example to demonstrate
how to write, compile and execute the C code using VMware in Linux environment.
1.2 LEARNING OUTCOMES
At the end of the laboratory session, students should be able to;
1. Know about the Software tool VMware for Linux environment.
2. Understand the syntax of UNIX/Linux C program.
3. Know how to create, compile and execute a C program under Unix System.
2. INTRODUCTION TO SOFTWARE TOOL VMWARE
Oracle VM Virtual Box (formerly Sun VirtualBox, Sun xVM VirtualBox and Innotek Virtual
Box) is a hypervisor for x86 computers from Oracle Corporation. Developed initially by Innotek
GmbH, it was acquired by Sun Microsystems in 2008 which was in turn acquired by Oracle in
2010.
Virtual Box may be installed on a number of host operating systems, including: Linux, OS
X, Windows Vista,Solaris, and OpenSolaris. There are also ports to FreeBSD[5] and Genode.
It supports the creation and management of guest virtual machines running versions and
derivations of Windows, Linux, BSD, OS/2, Solaris, Haiku, OSx86 and others, and limited
virtualization of OS X guests on Apple hardware.
Page 1 of 4
For some guest operating systems, a "Guest Additions" package of device drivers and system
applications is available which typically improves performance, especially of graphics.
2.2 BENEFITS OF VIRTUALIZATION
• Reduce costs by increasing energy efficiency and requiring less hardware with server
consolidation.
• Build up business continuity through improved disaster recovery solutions and deliver
high availability throughout the datacenter with VMware Site Recovery Manager.
• Virtualize enterprise apps, including Oracle, Exchange, SQL Server, Sharepoint and
SAP, and deliver the highest SLAs and top performance.
• Use policy-based automation and ensure compliance and performance with a zero-touch
infrastructure using the vCenter Product Family for virtualization management.
3. IMPORTANCE OF C-LANGUAGE
C language is known as middle level language, which is having features of low level, as well as
higher-level languages. That’s why C language is very much suitable for the systems
programming. C language is still most suitable language for systems programming.
4. LAB EXERCISE
Problem 4.1:
Write following simple hello word program in VMware, compile it and run it according to lab
instructor instructions.
#include <stdio.h>
int main(void)
{
printf("Hello World!\n");
}
Problem 4.2:
Write following program demonstrate the use of if-statement, relational & logical operators,
write this program in Oracle VM VirtualBox, compile it and run it. Write all steps from start to
end how to write program, compile program and run program.
#include<stdio.h>
main()
{
int a,b,c,max;
printf("Please Input three Numbers: "); //to display message on screen
scanf("%d %d %d",&a,&b,&c); //to read input from keyboard
if(a>b && a>c) //use of if-else-if statement and logical operators
max=a;
else if(b>a && b>c)
max=b;
else
Page 2 of 4
max=c;
printf("\nThe maximum of %d, %d, %d is = %d\n",a,b,c,max); //to display output
}
Write steps for problem 4.2
Problem 4.3:
Write a program in Oracle VM VirtualBox for Linux environment which demonstrate the use of
for-loop and while loop.
Code for Problem 4.3
Page 3 of 4
Comments by the Student:
For The Teacher Use Only:
Comments:
Signature: Date: / /
Page 4 of 4