OS Assignment1
OS Assignment1
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
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.
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]
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.
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.
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.
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.
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.
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.
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.
It is helpful for developers to build new Apps and see changes continuously on screen.
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.
b) How Arduino works? List the tasks you can perform using Arduino.
Answer b:
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.
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.