Assignment 1 Comp314
Assignment 1 Comp314
Assignment 1 Comp314
Define the concepts interrupt and trap and explain the purpose of an
interrupt vector.
Interrupt: Interrupt means that during the execution of the program by the
computer, when there is an abnormal situation or special request occurs, the
computer stops the current program and processes the exception processing or
special request, and then returns to the interrupt of the current program after the
processing ends. Continue to execute the original program.
Also, interrupt is asynchronously. It can happen at any time and doesn’t related to
what is the processor doing. Interrupt usually cause by I/O devices or timers.
Interrupt vector: Each interrupt source has a corresponding handler. This handler is
called an interrupt service routine and its entry address is called an interrupt vector.
It provides the Interrupt Service Routine or their addresses to the processor for the
interrupt source.
According to Von Neumann's idea, the basis of the operation of the computer should
be like this:
1. Binary.
2. One-dimensional memory
3. Linear execution of the process, that is, only one instruction is executed at a time.
4. Memory can access programs and data.
Device controllers:
A device controller is an entity in a computer whose primary responsibility to control
one or more I/O devices to enable data exchange between the I/O device and the
computer. It is the interface between the CPU and the I/O device. It receives
commands from the CPU and controls the operation of the I/O devices to free the
processor from complex device control transactions. The role of the controller is to
control and coordinate the actions of the entire computer.Usually requires the
program counter (PC), instruction register (IR), instruction decoder (ID), timing and
control circuit, and pulse source, interrupt, etc.
Device drivers: Device driver is a software that allows computer and devices to
communicate. It can be said that it is equivalent to the interface of the hardware.
The OS can only control the operation of the hardware device through this interface,
scheduling multiple tasks, accept and process interrupts and manage data transfers.
If the driver of a device is not properly installed, it will not work properly.
The main function of high availability cluster software is to automate fault checking
and business switching.
There are two modes of operation. They are supervision mode and user mode.
Supervision mode: The CPU can access all the data in the memory, including
peripheral devices, such as hard disks, network cards, and CPU can also switch itself
from one program to another. That is, its resource access is not restricted.
User mode: Only limited access to memory, and does not allow access to peripheral
devices, the ability to occupy CPU is deprived, CPU resources can be obtained by
other programs.
Direct memory access is a hardware mechanism that allows direct transfer of their
I/O data between peripheral devices and main memory without the involvement of
the system processor. Otherwise, the CPU needs to copy the data for each segment
from the source to the scratchpad and then write them back to the new location.
During this time, the CPU is not available for other jobs. Therefore, using this
mechanism can greatly increase the throughput of communication with the device.
Multicore means there are two or more CPU working together on a same chip.
Therefore, we only need a set of chipsets, a set of storage. Multicore communicate
through the chip internal bus, and shared memory. So that it would take less time
for the execution of the program. In such an architecture, if we run a multi-
threaded program, inter-thread communication will be faster than processors on
sperate chips. Also, the space on the board is small, and the pressure on the layout
and wiring is also small.
The operating system will share some kernel instructions through some interfaces,
this interface is called a system call. The system call interface provides a single and
less function. We always need more than one interface to manipulate and combine
to achieve the complex function. The application is the program that implements this
function and provides an access point. This access point is API. Therefore,
applications interact with the OS through API.
There are two goals to consider when designing an OS. The first goal to consider
when designing an OS is efficiency.
The operating system makes full use of the computer's memory, CPU, I / O
equipment and other resources. It also enables the reasonable organization of
computer workflows to further improve system resource utilization and increase
system throughput. The second goal to consider is convenience.
The design of the operating system should try to make the computer system easier
to use. Convenience and effectiveness are the two most important goals when
designing an operating system.
11. Explain why a modular kernel may be the best of the current operating
system design techniques.
The benefit of using the modular kernel is, at the time of booting, the modular
kernel will load only the required kernels. Since, the modular kernel is subdivided
into modules. So, per the need, only the selective kernels will be loaded.
Therefore, the booting time reduces. Similarly, per the application running, the
selective kernel will be loaded and run. If only the small modules are in use, then
the size of the kernel become small and can be loaded easily. New modules can be
generated easily.
Control Unit: It takes care about the correct implementation of the tasks and
their completion time.
Processing Unit: Computation of info.
Memory: Info Storage
Input: To input the info into the computer.
Output: To out the info from the computer.
Memory and the processing unit use the following registers to communicate:
It processing is a procedural processing and clock signals, IR and the reset signals
are used to control the FSM.
Between the processor and the I/O interface, the data is being exchanged by
the I/O ports.
The I/O ports are the points of interface.
The two types of I/O mapping are as follow:
Isolated input/output.
Memory mapped input/output.
Random access memory is those from which the central processing unit at
any time can able to access the array value.
The operations performed by the memory are as follows:
Fetch (fetching the address).
Store (address, value).
2. Define system call, and list the main types of system calls. Elaborate on how a
system call interacts with a standard C library and hardware under a dual-
mode operating system environment. (10 marks)
System Call: It is a demand made to the kernel by a program which may incorporate
making and executing new procedures, equipment related administrations and
speaking with indispensable kernel administrations. System calls give a critical
interface between a procedure and the operating system. They are otherwise called
kernel calls.
A library or API is given by the systems that cooperate between an operating system
and ordinary projects. On Windows NT, ntdll.dll library has API, which is a piece of
local API, and Unix write systems have API, which is an actualized some portion of C
library like glibc. This furnish system calls with wrapper capacities which uncover a
normal capacity calling tradition for utilizing the system call and make it measured.
The wrapper's primary capacity is to put every one of the ions in the fitting processor
registers which are to be passed to the system. Thusly the library, between the OS
and the application, builds portability. A change to kernel mode isn't caused by the
call to the library work and is ordinarily a subroutine call. Control is exchanged to the
kernel by the real system call as in Unix-like systems, fork and execve system calls
are summoned by fork and execve C library capacities. Making the system call
specifically in the application's code isn't doable.
A trap ought to be gained and the procedure ought to be ended or halted hurriedly if
the client procedure tries to execute a favored direction yet a piece of the operating
system code must be permitted to execute the special guidelines. Two unique
methods of the operation, which are client mode and screen mode, are required for
the CPU to have the capacity to separate between the client procedure and an
operating system code. There is a bit called the mode bit which is added to
equipment sign of the present mode i.e. screen mode (0) or client mode (1). The OS
plays out those operations which the client couldn't execute because of the idea of
special guidelines. This done by the client by asking for OS some assignment and the
kernel at that point influences a system to call to play out the operation. CPU mode
is changed to the system mode before the proper kernel code starts to execute the
operation at whatever point a system call is made or a trap, an intruder, or flag is
created. A short time later, the CPU mode is changed back to the client mode
Virtual Machines (VMs) are what we often call Simulators. Instead of a physical
machine, we use software to emulate hardware so that end users can
manipulate software through such an environment. All software executed in a
virtual machine can only use resources in the virtual machine.
Virtual machines can be roughly divided into System Virtual Machines and
Process Virtual Machines. A system virtual machine is a platform that can
execute an operating system, while a program virtual machine can only execute a
specific program as its name suggests.
Virtual systems will vary depending on the virtual technology. For example,
virtualization technology is divided into Full Virtualization and Para Virtualization,
which affects the choice of hardware resources and operating systems that
virtual machines can use.
For Java programs, it only knows one operating system (or a kind of machine). This
system is called JVM, and for JVM, the bit code file is its executable file! That is, the
file whose name is .class. Ideally, Java programs don't take care of which platform to
implement. Just know how to execute on the JVM. As for how the JVM
communicates with the underlying platform, it is the JVM's own business.
References:
www.wikipedia.com
www.quora.com
www.umanitoba.ca/comp3430/