Aim: Write An Awk Program Using Function, Which Convert Each Word in A Given Text Into Capital
Aim: Write An Awk Program Using Function, Which Convert Each Word in A Given Text Into Capital
Experiment No: 17
Aim: Write an awk program using function, which convert each word in a given text
into capital.
Date:
Relevant CO: Understand the process management policies and scheduling of processes by
CPU
Objectives:
1. To introduce students to the capabilities and functionalities of the awk programming language,
especially in the realm of text processing.
2. To showcase the design and application of custom functions in awk.
3. To instill an understanding of pattern matching, data processing, and transformation using awk.
4. To provide a clear and structured approach to capitalizing text, emphasizing algorithmic thinking
and design.
Theory:
awk is a text-processing programming language that is particularly well-suited for structured
data and produces formatted reports. The language is data-driven and is used for pattern scanning
and processing. It provides a way to create small and simple programs to transform and report on
data within files.
A crucial aspect of awk is its ability to match patterns and perform actions on the matched
data. Functions, both built-in and user-defined, can further extend its capabilities. One such task is
to capitalize the first letter of each word in a text.
Procedure:
1. Define the Capitalize Function:
- Accept a string as input.
- Extract the first letter of the string and convert it to uppercase.
- Append the remainder of the string (from the second character onwards) to the uppercase letter
without changing its case.
- Return the combined result as the capitalized word.
- Move to the next line of the input text and repeat the process until all lines are processed.
Observations:
Quiz:
1. What is awk primarily used for?
2. How does awk handle the processing of input data by default?
3. In the context of the provided algorithm, what is the main purpose of the capitalize
function?
Rubrics 1 2 3 4 5 Total
Marks
Operating System 230170132035
Experiment No: 18
Aim: Write a program for process creation using C. (Use of gcc compiler)
Date:
Relevant CO: Evaluate the requirement for process synchronization and coordination
handled by operating system
Objectives:
1. To introduce students to the fundamentals of process management in UNIX-like operating
systems.
2. To educate on the usage and significance of the fork() system call in creating new processes.
3. To demonstrate the creation and differentiation of parent and child processes in a C program.
4. To foster an understanding of how processes are managed and controlled in a UNIX environment.
Theory:
In UNIX-like operating systems, the creation of a new process is accomplished using the
fork() system call. When a process calls fork(), it creates a new process called the child process.
The original process is called the parent process.
The child process is an almost exact copy of the parent process. Both processes will continue
executing from the point of the fork() call. The main difference is the value returned by fork(). In
the child process, fork() returns 0, while in the parent, it returns the child's process ID.
This distinction can be utilized to differentiate the roles of the parent and child processes in the
program.
Procedure:
1. Begin the program.
2. Call the fork() function.
3. Check the return value of fork().
- If the return value is negative, the fork failed.
- If the return value is zero, the current code block is being executed by the child process.
- If the return value is positive, the current code block is being executed by the parent process.
4. In the child process, print a message indicating that it's the child process and display its process
ID.
5. In the parent process, print a message indicating that it's the parent process, display its process
ID, and also display the child's process ID.
6. End the program.
Operating System 230170132035
Observations:
Quiz:
1. What is the primary function used to create a new process in UNIX-like systems?
2. How can you differentiate between the child and parent processes after the fork() call?
3. What does fork() return in the child process?
Rubrics 1 2 3 4 5 Total
Marks
Operating System 230170132035
Experiment No: 19
Aim: Study the concepts of virtual machines and virtualization.
Date:
Relevant CO: Evaluate the requirement for process synchronization and coordination
handled by operating system
Objectives:
1. To introduce students to the foundational concepts of virtual machines and the broader realm of
virtualization.
2. To impart knowledge about the advantages, challenges, and use cases of virtualization in modern
IT infrastructures.
3. To educate on the roles and functions of hypervisors in a virtualized environment.
4. To provide insights into various types of virtualization, enabling students to make informed
decisions in real-world applications.
Theory:
1. Virtual Machines (VM):
- A Virtual Machine (VM) is a software-based simulation of a physical computer. It runs in an
isolated environment on a host system with the help of virtualization software. A VM operates
similarly to a physical computer, having its own CPU, memory, disk space, and I/O.
2. Virtualization:
- Virtualization refers to the act of creating a virtual (rather than physical) version of computing
resources. It allows for the creation of multiple virtual environments on a single physical system.
- At the heart of virtualization is the *hypervisor*, a software layer or platform that manages the
distribution of the underlying hardware resources to the virtual machines. There are two types of
hypervisors:
a. Type 1 (Bare Metal): Runs directly on the system's hardware.
b. Type 2 (Hosted): Runs atop a conventional operating system.
Advantages of Virtualization:
1. Resource Efficiency: Multiple VMs can run on a single physical server, optimizing hardware
usage.
2. Isolation: VMs are isolated from each other. If one VM crashes, it doesn’t affect others.
3. Snapshot and Cloning: VMs can be snapshotted to capture their current state, allowing easy
rollback. They can also be cloned for quick deployment.
4. Flexibility and Testing: VMs can run different operating systems on the same physical host,
Operating System 230170132035
which is beneficial for application testing across different environments.
5. Cost Savings: Virtualization can reduce the need for physical hardware, leading to cost savings
in hardware procurement and energy consumption.
Types of Virtualization:
1. Hardware/Platform Virtualization: Creation of VMs which act like real computers with an
operating system.
2. Network Virtualization: Splitting available bandwidth in a network into independent channels
which can be assigned to particular servers or devices.
3. Storage Virtualization: Pooling physical storage from multiple devices and presenting it as a
single storage device.
4. Application Virtualization: Packaging an application along with its runtime environment to run
on any compatible underlying OS.
Observations:
Quiz:
1. What is the primary software component responsible for managing virtual machines and
their access to the physical hardware?
2. Name the two types of hypervisors.
3. Why might an organization opt to use virtualization in their data center?
Rubrics 1 2 3 4 5 Total
Marks
Operating System 230170132035
Experiment No: 20
Aim: Study the concepts and functionalities of Hypervisors, focusing on VMWare
ESXi, Microsoft Hyper-V, Xen Server, and the Java Virtual Machine.
Date:
Objectives:
1. To familiarize students with the realm of virtualization and the role of hypervisors in creating
and managing virtual environments.
2. To introduce the features and functionalities of VMWare ESXi, Microsoft Hyper-V, and Xen
Server, enabling informed decision-making in IT infrastructures.
3. To impart the knowledge of the Java Virtual Machine's workings and its importance in the Java
ecosystem.
4. To encourage the exploration and comparison of various virtualization technologies,
understanding their strengths, weaknesses, and use cases.
Theory:
1. Hypervisors:
- A hypervisor, often termed a Virtual Machine Monitor (VMM), is software, firmware, or
hardware that creates and runs virtual machines. It divides the host system's resources to allocate
them to the VMs.
2. VMWare ESXi:
- VMWare ESXi is a Type 1 hypervisor integrated into VMware's vSphere suite. It's a bare-metal
hypervisor that installs directly onto the physical server and doesn't require an underlying operating
system.
- It offers centralized management, automation, and scalability capabilities.
3. Microsoft Hyper-V:
- Microsoft Hyper-V is a hypervisor-based virtualization system, part of Windows Server editions.
It's available both as a standalone product and an integrated feature of the Windows OS.
- Hyper-V can create both VMs and containers, offering robustness and flexibility for different
virtualization needs.
4. Xen Server:
- Xen is an open-source Type-1 or bare-metal hypervisor, initially developed by the University of
Cambridge and now hosted by the Linux Foundation.
- Xen is used by many cloud providers and offers features like live migration, VM cloning, and a
high level of security.
Operating System 230170132035
5. Java VM (JVM):
- The JVM is a virtualization engine for running Java bytecode. It isn't a hypervisor in the same
sense as the others listed but acts as a virtual machine that provides a runtime environment to
execute Java applications.
- Java applications are compiled into bytecode, which is executed by the JVM. This allows Java
applications to be platform-independent, adhering to the "write once, run anywhere" (WORA)
principle.
Quiz:
1. Which of the mentioned hypervisors is integrated into VMware's vSphere suite?
2. What distinguishes the Java Virtual Machine from hypervisors like ESXi and Hyper-V?
3. Why is the JVM crucial for Java's "write once, run anywhere" principle?
Rubrics 1 2 3 4 5 Total
Marks