CoE 135 Problem Set 1
CoE 135 Problem Set 1
CoE 135 Problem Set 1
I pledge that I answered all the items in this Problem Time, Network, Parallel, Distributed, Clustered, Handheld.
Set to the best of my understanding, and with the aid of
properly cited resources and collaborators in problems I The batch operating system does not let the user
could not solve on my own. I made sure that I cited all interact with the computer directly. Instead, the user
resources and stated the names of all those who guided uses devices like punch cards which are then submitted
me in answering all the items along with their invaluable to the computer operator. The computer operator then
contributions. has to sort these programs into batches that share
similar needs in order to speed up processing. [2].
Raphael Cyron M. Robles
Interactive operating system, on the other hand,
2015-06938
allows the user to interact directly with the operating
system. It is done with the use of a user interface, be
I. P ROBLEMS
it graphical or command line, and allows interaction
1. During your Arch Linux installation procedure in with the OS while multiple progrums are running. [2]
Machine Exercise 1, you were required to set up the boot Time sharing enables multiple users to use the system
loader for Arch Linux. Why is that step required? Why does an to use the system effectively ’at the same time’. The time
Ubuntu installation not require the same procedure? Why do sharing operating system is optimized for responsiveness
we need boot loaders in general What is their role? Give two through frequent switching of the CPU between
examples of boot loaders, and compare their highlight features. multiple jobs. It uses scheduling and multiprogramming
to provide the users a small portion of time. [2]
Setting up the boot loader is required because the A real time operating system features the ability
boot loader is the first piece of software started by the BIOS to handle input data within little and guaranteed
or UEFI, responsible for loading the kernel and initial RAM response time. It must have a well defined and
disk with the wanted parameters and configurations. [1]. fixed time constraints, otherwise it would fail. [3]
Since the default installation of Arch Linux is a minimal The network operating system has the purpose of
base system, the user has to add and configure whatever is allowing file and device access to multiple computers
required, e.g. the boot loader. Ubuntu installation does not connected in a network. It runs on the server which
require the exact same procedure for configuring the boot has the capability to manage data, users, groups,
loader; however, it still requires the installation of a boot loader applications and other networking functions. [2]
which comes preconfigured, only prompting for the user’s Parallel operating systems are the interface between
input to which device the boot loader should be installed on. parallel computers and applications executed on them.
One of the most common bootloaders, and the one that It is designed to speed up program execution times by
comes preconfigured for Ubuntu, is GRUB(GRand Unified ’dividing’ the program and processing it simultaneously.
Bootloader). GRUB supports both UEFI and BIOS firmware, Distributed operating systems operates over a collection of
multi-booting, full support for ext4, ReiserFS v3, VFAT, independent, networked and separate nodes. Jobs are handled
XFS, and Btrfs without zstd compression. rEFInd is a UEFI and distributed along multiple CPUs accordingly. To do this,
boot loader designed to be platform-neutral and to simplify the processors communicate through various communication
booting multiple OSes, auto-detecting kernels and parameters lines(e.g. high speed buses, telephone lines). [3]
without explicit configuration and offers full support for A clustered operating system features multiple computers
VFAT, Btrfs without encryption and zstd compression, ext4 that share a common file system equally. It is used to
without encryption, ReiserFS v3 without tail-packing feature. maximize availability, where if a system fails, another
[1]. one from the cluster can take over, effectively using
multiple computers to acomplish a single task. [3]
Self Grade for Number 1: 4
Handheld operating systems are optimized
2. Discuss the essential properties of the following types of with features that are necessary for handheld
operating systems: Batch, Interactive, Time Sharing, Real devices(e.g. touchscreen interface, network connections).
Self Grade for Number 2: 4
3. mmap() is a system call that is always invoked whenever
our programs start executing according to the output of
our strace experiment in Machine Exercise 3. What are
the use cases of mmap(), including and aside from its
usage in your test programs for the lab? Provide at least
three code snippets that use mmap() in three different ways.
A common use case for mmap() is for dynamic/shared Fig. 3. Mapping with mprotect().
libraries. We mmap() the contents of the program in the
address space of the program if it has dynamic linkage [2].
Synchronization using time functions would be applicable for multithreading or local two player games. Spawning
for multiple threads that each does not necessarily need multiple processes allows better throughput since it takes
a significant amount of time handling the resources(i.e. advantage of multiple cores, with the cost of using separate
you are sure that the program will finish modifying the memory space. An example for this case would be a web
resources before the timer functions, with reasonable wait browser, where a tab can be treated as a new separate process.
times, ends). It would not be applicable for applications
that would result in a highly varying amount of processing Self Grade for Number 11: 4
time(e.g. Fig. 8) where it would be better to synchronise
using mutexes and condition variables to prevent the case R EFERENCES
where threads will still use exclusive resources when [1] ArchWiki, “Category:Boot loaders - ArchWiki,” [Online]. Available:
the timer has already finished for cases that we cannot https://wiki.archlinux.org/index.php/Category:Boot loader [Accessed 20
Sep. 2018].
predict the execution time needed by the thread to finish. [2] TutorialsPoint, “Types of Operating System,” [Online]. Available:
https://www.tutorialspoint.com/operating system/os types.htm
[Accessed 26 Sep. 2018].
Self Grade for Number 10: 4 [3] TeachICT, “Category:Boot loaders - ArchWiki,”
[Online]. Available: http://www.teach-ict.com/
11. Programs tend to perform many I/O operations over as a2 ict new/ocr/A2 G063/332 designing systems/operating systems/
time. We have several methods to maximize CPU utilization miniweb/index.htm [Accessed 26 Sep. 2018].
[4] M.F. Wani, “What are some real world uses of mmap() Linux system
and user experience with I/O, namely, signal-driven I/O, call?,” [Online]. Available: https://www.quora.com/What-are-some-real-
multithreading, and spawning multiple processes. When is it world-uses-of-mmap-Linux-system-call [Accessed 25 Sep. 2018].
best to make use of signal-driven I/O? When is it best to make [5] Shichao’s Notes, “Chapter 6.Kernel Data Structures,” [Online].
Available: https://notes.shichao.io/lkd/ch6/#chapter-6-kernel-data-
use of multithreading? When is it best to make use of multiple structures [Accessed 21 Sep. 2018].
processes? Provide a real-world usage example for each case. [6] K-State, “Blocking and Nonblocking I/O,” [Online]. Available:
http://faculty.salina.k-state.edu/tim/ossg/Device/blocking.html
[Accessed 26 Sep. 2018].
Signal driven I/O is used to handle asynchronous [7] A. Gargi, A. Mujeeb, “Why does the Linux kernel define a lot of
events where the kernel sends a signal when something macros?,” [Online]. Available: https://www.quora.com/Why-does-the-
happens to a file descriptor. It is best used for system Linux-kernel-define-a-lot-of-macros [Accessed 26 Sep. 2018].
[8] B.P. Singh, “Linux kernel Macros and their meaning,” [On-
timers, keyboards, mice, controllers. Multithreading is line]. Available: https://www.linkedin.com/pulse/linux-kernel-macros-
best used for program has mutually independent tasks. meaning-bhanu-prakash-singh [Accessed 26 Sep. 2018].
It can improve the program with the introduction of
parallelism. Examples of use cases would be for really
long computational functions that would be optimized