0% found this document useful (0 votes)
49 views

OS Assignment1

This document is an assignment submission for the Operating Systems course at COMSATS University Islamabad. It contains answers to 3 questions. The submission is by the group of Muhammad Haseeb, Rida e Noor Gillani, and Warisha Altaf with their registration numbers. It was submitted on 19th March 2022 to Ma'am Memoona Malik. The first question defines header files, lists functions in the <linux/rbtree.h> header file, and explains that read() and write() system calls are used by scanf() and printf() respectively for context switching between user and kernel mode. The second question defines cloud computing and its types, explains the client-

Uploaded by

muhammad haseeb
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views

OS Assignment1

This document is an assignment submission for the Operating Systems course at COMSATS University Islamabad. It contains answers to 3 questions. The submission is by the group of Muhammad Haseeb, Rida e Noor Gillani, and Warisha Altaf with their registration numbers. It was submitted on 19th March 2022 to Ma'am Memoona Malik. The first question defines header files, lists functions in the <linux/rbtree.h> header file, and explains that read() and write() system calls are used by scanf() and printf() respectively for context switching between user and kernel mode. The second question defines cloud computing and its types, explains the client-

Uploaded by

muhammad haseeb
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Operating System

Assignment 1

Submitted By Group:
Names: Muhammad Haseeb,
Rida e Noor Gillani,
Warisha Altaf.
Reg No.: FA20-BCS-053,
FA20-BCS-078,
FA20-BCS-093.

Date of Submission:
19th March, 2022
Submitted To:
Ma’am Memoona Malik
COMSATS Institute of Information Technology, Islamabad Campus
Department Of Computer Science
Operating Systems – CSC322

BCS – IVB

Assignment #1 Marks: 40
Mapped to CLO1

Q1: Marks [3+3+4]

a) What are header files?


Answer a:
The header files are used to specify how the functions in the source file are defined. In the case of
the kernel header files, these functions and structures are within the kernel itself. Header files are
used to check if the function used in the program or source file is correct as the function signature
(return value and parameters) is present in the header file. In header files the actual implementation
of the function is not necessary. Example: if I want to use the function

int foo(double param);

in a program I do not need to know how the implementation of foo is, I just
need to know that it accepts a single parameter (double) and returns an
integer.

b) Mention the functions included in the <linux/rbtree.h> header file.


Answer b:
Following functions are included in <linux/rbtree.h> header file:

 rb_add() : insert node into tree


 rb_add_cached() : insert node into the leftmost cached tree
 rb_find_add() : find equivalent node in tree or add node
 rb_find() : find key in tree
 rb_find_first() : find the first key in tree
 rb_next_match() : find the next key in tree
 rb_for_each() : iterates a sub-tree matching key

c) Which system call(s) are used by “ scanf” and “ printf” functions of the “ stdio”
library in Linux (POSIX) and why?
Answer c:
A system call calls a function which is inside the kernel.

write() system call is used for during the invocation of printf() C method. This system call only writes
a few sequence of bytes. printf() converts the data in sequence of bytes and then write() system call
is called to write it on the screen.

read() system call is used for during the invocation of scanf() C method. scanf() function is used to
read the formatted data either from the keyboard or from the file stored in the file system.

These system calls are necessary for context switching from user mode to the kernel mode.
Q2: Marks [5+3+3+4]

a) What is cloud computing? Provide examples.


Answer a:

Cloud Computing:

Cloud computing allows the usage of system resources over the internet. It means that the
hardware of another computer can be accessed by making a connection with it over the internet
and utilizing and performing tasks on the actual hardware of a computer. Cloud computing is mostly
used in business companies because it saves the cost and increases the productivity, efficiency and
speed.

Types of cloud computing:

There are four types of cloud computing:

1. Public Clouds: These are cloud environments typically created from IT infrastructure
not owned by the end user.
2. Private Clouds: These are loosely defined as cloud environments solely dedicated to a
single end user or group.
3. Hybrid Clouds : It is a seemingly single IT environment created from multiple
environments connected through local area networks (LANs), wide area networks
(WANs), virtual private networks (VPNs), and/or APIs.
4. Multiclouds: These are a cloud approach made up of more than 1 cloud service, from
more than 1 cloud vendor—public or private
Examples:

 Microsoft azure
 Dropbox
 Google Drive.

b) Explain the role of clients and servers in client server computing.


Answer b:
In a client server model a Centralized powerful computer that provides different services to a
number of less powerful computers are called as server. The clients can access the data present on
the server by making a request to it. A server requires the resource management where a server
synchronizes and answers client demands or requests. Client programs control the user interactions.

Example:

An e-commerce website provides a graphical user interface to the user and user can make an
order on the website which sends a request to the server for certain services and then server
responds to the user requests and performs the specific tasks which are needed.

c) What are the responsibilities of an operating system in client server computing


architecture?
Answer c:
The server client network operating systems are the most common types of network operating
systems. These type of system operates on a single server and multiple clients. The network
operating system is installed on the server machine which is the central hub of all the clients. Due to
the centralized server it is the most secure network. The most important function of the network
operating system is to provide the useful and appropriate services to the client requests in a very
secure manner. Using this model a company can build a very large network. These are mostly used
in education systems, business and other organizations which uses a server.

Microsoft, UNIX, Linux are the most common examples of client server operating systems.
d) Differentiate between desktop and mobile operating systems.
Answer d:
Mobile operating system and desktop operating system vary in multiple ways. Following are the
most common difference between both operating systems:

 Mobile operating system uses less RAM while desktop OS needs huge memory to operate.
 Mobile OS uses only a flash drive to store the data while desktop OS uses both hard drives
and flash drives to store data.
 Mobile OS uses touch screen or touch pads while desktop OS uses several input output
devices like keyboard, mouse, monitor etc.
 The most important difference is the booting time. Mobile OS takes less time to boot while
desktop OS boots much slower.
 Examples of the Mobile OS are iPhone, Android, Windows Mobile OS, Web OS etc. And
examples of the desktop OS are Windows 10, Mac OS, Windows Vista, etc.
Q3: Marks [3+3]

a) Differentiate between the multiprocessor and multicore systems. Discuss their pros
and cons.
Answer a:
Multiprocessor Vs Multicore Systems:

 In a multicore system only one CPU is present and it has multiple cores whereas in
Multiprocessor there are several CPUs.
 Since Multi core only consists of 1 CPU so it’s cost is less than multiprocessor.
 If you want to run a single program multi core system is faster but if you run multiple
programs in multiprocessor system than multiprocessor is faster.

Pros of Multi core System:

 Cores are energy efficient so it provides high performance at low energy.

 Multiple CPU cores are placed on the same die so cache coherency is higher in Multi core
system.
Cons of Multi core System:

 If you are using a dual-core then its speed should be double than the single-core but you
will get 70-80% more speed only in reality.
 Not all operating systems support multi core.

Pros of Multiprocessor System:

 More work is done in a shorter period of time because more than one processors are
working at a time.
 Multiple processors are working if one processor is not working then the job can be done
with the help of other processors. This increases reliability.
 If you are providing lots of work on single processor then it will result in more
consumption of battery but if the work is divided into various processors then it will
provide better battery efficiency.
 It is an example of true parallel processing because more than one processes executing at
the same time.
Cons of Multiprocessor System:
 As more than one processor are working at a particular instant of time, So the
coordination between these are complex.
 The buses, memory, and I/O devices are shared, if some processors are using some I/O
then another processor has to wait for its turn and this will result in the reduction of
throughput.
 To have the efficient working of all the processors at a time, we need to have a large main
memory and this will in return increase the cost.

b) What are the benefits of emulation and virtualization?


Answer b:
Benefits Of Emulation:

 Emulator is typically a program that lets you run software from a completely different
device on your computer and the process is called emulation.

 We can play video games and run different operating systems for example, you can put
a Mac operating system on your Windows computer.

 We can run apps that normally wouldn't work on your computer.

 It is helpful for developers to build new Apps and see changes continuously on screen.

 It uses full hardware and software imitation.

Benefits Of Virtualization:

 Virtualization is the creation of a virtual rather than actual version of something, such
as an operating system, a server, a storage device or network resources.

 It Reduces upfront hardware and continuing operating costs.

 It Minimize or eliminates downtime.

 It Increases IT productivity and responsiveness.

 It Simplifies data center management.

 It provides faster applications and resources.


Q4:. Marks [3+4+2]

a) Why do application softwares are operating system specific?


Answer a:
The application software is operating system specific because they don’t know
where the user interface is and they need a user interface to execute its functions
properly. The operating system allows application software to use system
resources(hardware) and interconnect with it. It provides an environment to the
application softwares to run.

b) How Arduino works? List the tasks you can perform using Arduino.
Answer b:

Arduino is a board based on microcontroller (ATMEL AVR). Microcontrollers are integrated circuits


where instructions are recorded which you write with the programming language that you can use
in the Arduino IDE environment because of that you can create programs that interact with the
circuitry on the board.

The Arduino microcontrollers has communication ports and input/output ports that connect with
different peripherals which are connected to microcontrollers, which is in charge of processing the
data.

List of tasks that can be performed by the Arduino are:

 It is able to read inputs.


 It can light on sensors
 Send a twitter message
 It can activate different motors
 It can turn on LEDs
 Through it we can publish something online.
c) Describe dynamically linked libraries.
Answer c:
A dynamic library is a programming concept in which shared libraries with special functionalities are
launched only during program execution which also minimizes overall program size and facilitates
improved application performance for reduced memory consumption. In most software programs,
distributing specific functionalities into separate modules allows loading as needed.

A dynamic library is never part of an executable file or application and during runtime a link is
established between a dynamic library and executable file or application.

You might also like