Sie sind auf Seite 1von 10

KATLEGO MAPLANKA

2016

201301768

[COMPANY NAME] | [Company address]

ASSIGNMENT 1(CSI 354)

Question 1
i. Define an Operating Systems and explain two (2) of its core functions in a
computer system. [5marks]

An Operating Systems is a collection of software that directs a computer's operations,


controlling and scheduling the execution of other programs, and managing storage,
input/output, and communication resources.
Its core functions
(1) manage the computer's resources, such as the central processing unit, memory, disk
drives, and printers,
(2) establish a user interface,

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

i. Computer system performance may be affected by the Operating System


version which sits on top of hardware. Discuss. [10marks]
When you install a 32-bit operating system on a 64-bit computer, the effect is an instant
conversion of a 64-bit processor to a 32-bit processor.

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.

Hardware memory such as video memory will consume a portion of the


addressable memory instead of being moved above it or having RAM remapped
around the hardware memory addresses.

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

i. Operating system is interrupt driven. Explain why. [4marks]


An interrupt is a signal from a device attached to a computer or from a program
within the a computer that causes the main program that operates the operating
system to stop and figure out what next to do.
To effectively manage many processes the kernel makes use of interrupts. This
signal to a processor indicating that an asynchronous event has occurred. Here the
current sequence of instruction is temporarily suspended, as a sequence
appropriate to the interruption is stated in its place. Its purpose is to alert the
operating system when a special event occurs so that it can suspend is current
activity and deal appropriately with the new situation.

ii. Discuss the structure of one Operating System example. [4marks]

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.

System Utility System Utility programs are responsible to do specialized, individual


level tasks.

Kernel Mode vs User Mode


Kernel component code executes in a special privileged mode called kernel mode with full
access to all resources of the computer. This code represents a single process, executes in single
address space and do not require any context switch and hence is very efficient and fast. Kernel
runs each processes and provides system services to processes, provides protected access to
hardware to processes.

iii. What is the role of application program interface (APIs) and why use APIs
rather than making direct system calls to the kernel?[3marks]

Role of application program interface:


Operating Systems
An API can specify the interface between an application and the operating system.
POSIX, for example, specifies a set of common APIs that aims to enable an application
written for a POSIX conformant operating system to be complied for another POSIX
conformant operating system. Linux and Berkeley Software Distribution are examples of
operating systems that implement the POSIX APIs. Microsoft has shown a strong
commitment to a backward compatible API, particularly within the windows API (Win32)
library, such that older applications may run on newer versions of Windows using an
executable-specific setting called Compatibility Mode.
iv. Design an interrupt timeline and describe what happens at each stage on the

timeline, for a single I/O device. [4 marks]

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

Das könnte Ihnen auch gefallen