Assignment 1
Assignment 1
2016
201301768
Question 1
i. Define an Operating Systems and explain two (2) of its core functions in a
computer system. [5marks]
ii. What is an Operating System Kernel and where does is reside within the
computer system? Justify why the Kernel resides where it does. [2marks]
An operating system kernel is a computer program that serves as an intermediary layer
between the hardware and the application programs.
The kernel resides at the core of a computer operating system.
The kernel makes it possible for software to interact with the hardware of the operating
system, when a service request is received, the kernel translates it into instructions for
the CPU or other electronic components of the computer to execute.
iii. Explain the concept of virtual memory and why it is useful. [2marks]
Virtual memory is a memory management technique that is implemented using
hardware and software. It also provides an interface identical to the underlying bare
hardware.
VM allows users to extend the use of physical memory by disk
it also allows users to have memory protection, because each virtual address is
translated to a physical address.
iv. Writing an operating system that can operate without interference from
malicious or undebugged user programs requires some hardware
assistance. Name three hardware aids for writing an operating system,
and describe how they could be used together to protect the operating
system. [6marks]
a. Monitor/user mode
With the mode bit, we are able to distinguish between a take that is executed on
behalf of the operating system, and one that is executed on behalf of the user. 0:
monitor mode. 1: user mode.
b. Timer
c. We can use the timer to prevent a user program from running too long, which
would ensure that the operating system maintains control. Before turning over
control to the user, the operating system ensures that the timer is set to interrupt.
If the timer interrupts, control transfers automatically to the operating system
d. Memory protection with base and limit registers.
The base register holds the smallest legal physical memory address; the limit
register contains the size of the range. This protection is accomplished by the
CPU hardware comparing every address generated in user mode with the
registers. Any attempt by a program executing in user mode to access monitor
memory or other users memory results in a trap to the monitor, which treats the
attempt as a fatal error.
Question 2
i. Differentiate between User goals and System goals when designing
Operating Systems. [4marks]
User goal
Convenience
Security
Speed
Reliability
User-friendliness
Ease of learning
Fault tolerant
Usability
System goal
Ease of design
implementation
Maintenance
Portability
Minimum number of errors
Adaptability
Well-defined Interfaces
ii. Explain using an example why separation of policy from mechanism is an
important design principle for Operating Systems. [5marks]
The separation of mechanism and policy is important to provide flexibility to a system. If
the interface between mechanism and policy is well-defined, the change may affect
only a few parameters. On the other hand, if interfaces between these two are vague or
not well-defined, it might involve much deeper change to the system. Once the policy
has been decided it gives the programmer the choice of using his/her own
implementation. Specifically, separating these two policies provides flexibility in a variety
of ways. First, the same mechanism can be used to implement a variety of policies, so
changing the policy might not require the development of a new mechanism, but just a
change in parameters for that mechanism from a library of mechanisms. Second, the
mechanism can be changed for example, to increase its efficiency or to move to a new
platform, without changing the overall policy
iii. What is direct memory access (DMA)? For what types of operations is
DMA useful? Explain your answer. [4marks]
Direct memory access is a feature of computer systems that allows certain hardware
subsystems to access main system memory (RAM) independently of the CPU.
DMA is useful for transferring large quantities of data between memory and devices. It
eliminates the need for the CPU to be involved in the transfer, allowing the transfer to
complete more quickly and the CPU to perform other tasks concurrently.
iv. Why is caching an important principle is computing? [2marks]
Since almost all application workload is dependent upon I/O operations, caching is used
to improve application performance (TechTarget, 2015)
The main reason cache is important is that it increases the real speed of a processor by
providing the processor with data more quickly. A processor can only crank through data
if it is being given data and any delay that exists between when the processor requests
data and when the processor receives it means that clock cycles are being left idle
which could have otherwise been used.
QUESTION 3
All of the processor-level instructions are limited to using 32-bit registers, hence
all native math functions are similarly limited regarding their range and precision.
The amount of physical memory that can be accessed drops to 4 GB, even if
there is more memory installed.
All other software you wish to run on the system must be 32-bit and will be
constrained by these same parameters.
ii.What are system calls? Give two (2) examples of system calls. [3marks]
System call is the programmatic way in which a computer program requests a service
from the kernel of the operating system it is executed..
Examples of system calls include:
a. write()
b. read()
iii. State one (1) advantage and one (1) disadvantage of symmetric and
Asymmetric multiprocessing [2marks]
Symmetric multiprocessing
Advantage
A symmetric cryptosystem uses password authentication to prove the receivers identity.
Disadvantage
Treats all processes as equal and I/O can be processed on any CPU.
Asymmetric
Advantage
The primary advantage of public-key cryptography is increased security: the private
keys do not ever need to be transmitted or revealed to anyone
Disadvantage
A disadvantage of using public-key cryptography for encryption is speed there are
popular secret-key encryption methods which are significantly faster than any currently
available public-key encryption method.
QUESTION 4
Linux Operating
Linux Operating System has primarily three components
Kernel Kernel is the core part of Linux. It is responsible for all major activities of this
operating system. It consists of various modules and it interacts directly with the
underlying hardware. Kernel provides the required abstraction to hide low level hardware
details to system or application programs.
System Library System libraries are special functions or programs using which
application programs or system utilities accesses Kernel's features. These libraries
implement most of the functionalities of the operating system and do not requires kernel
module's code access rights.
iii. What is the role of application program interface (APIs) and why use APIs
rather than making direct system calls to the kernel?[3marks]
An I/O device (controller) is busy transferring data from the device buffer to the
device. It goes from idle to transferring. This is the peak for I/O device. It goes back
to idle when the transfer is done until the next request.
The CPU curve shows a peak when the transfer is done because the CPU is notified
by the device through an interrupt (Stack Exchange Inc, 2016).
References
West, Joel; Dedrick, Jason (2001). "Open Source Standardization: The rise of Linux in
the network era"(pdf). Knowledge, technology and Policy.Springer.14 (2):88112.Retrieved 2 August 2016.
Lewine, Donald A. (1991). POSIX Programmer's Guide (pdf). O'Reilly and Associates,
Inc.p.1, Retrieved 2 August 2016.
MakeUseOf. (2016). Retrieved from http://www.makeuseof.com/
Shankar. (2016). Retrieved from ALLInterview.com: http://www.allinterview.com
Stack Exchange Inc. (2016). Retrieved from http://unix.stackexchange.com
Techopedia Inc. (n.d.). Retrieved from techopedia.com: https://www.techopedia.com
TechTarget. (2015, April). Retrieved from searchstorage.techtarget:
searchstorage.techtarget.com
http://www.tutorialspoint.com/
http://www.compiletimeerror.com
http://www.brighthub.com
https://www.cs.umd.edu/class/sum2003/cmsc311/Notes/Memory/virtual.html
http://www.slideshare.net/MELJUN2009/meljun-cortes-operating-system