List the elements of a computer system.
What are the two modes in which a program can execute? Compare them.
-
User mode – Task / process is executed on behalf of user
-
Kernel mode – Task / process is executed on behalf of the OS
What is an operating system?
An operating system is a program that manages a computer’s hardware / resources. It provides the interface between the user and the computer hardware. It also controls the execution of application programs and acts as an interface between applications and the computer hardware.
State the functions of an operating system.
What are the main purposes of operating system?
-
Provide interface between user and computer hardware
-
Manage all resources of the computer
-
Support for installing and executing application programs
List the services of operating system.
-
Program execution
-
Access to I/O devices
-
Controlled access to files
-
System access
-
Error detection and response
-
Accounting
What is an instruction execution?
Program consists of a set of instructions stored in memory. Processor executes a program by executing the set of instructions. Instruction execution consists of two steps – FETCH instruction from memory one at a time and EXECUTE. Processing required for a single instruction is called an instruction cycle.
List the categories of Processor action.
-
Processor-memory: Data transfer from processor to memory or from memory to processor.
-
Processor-I/O: Data transfer between a peripheral device (I/O module) and the processor.
-
Data processing: processor performs arithmetic / logic operation on data.
-
Control: An instruction that may alter the sequence of execution.
List the types of memory in a computer system.
What is a cache memory? State the need for cache memory.
Cache is a small, volatile and fastest memory in a computer and is typically placed between the processor and main memory. It stores a copy of the frequently used instruction / data present in the main memory and provides high-speed access to a processor. It improves the utilization of the processor and the system throughput.
What is meant by principle of locality of reference?
Locality of reference can be used to predict what instructions and data a program will use in the near future based on its accesses in the recent past. Locality of references is of two types:
-
Temporal locality – Programs tend to reuse data and instructions they have used recently in the near future.
-
Spatial locality – in programs, instructions and related data tends to cluster.
What is a disk cache?
Disk cache is a technique by which a portion of main memory is used as a buffer to temporarily hold data that are to be read out to disk. Disk cache improves performance in two ways:
-
Disk writes are clustered. Instead of many small transfers of data, we have a few large transfers of data. This improves disk performance and minimizes processor involvement.
-
Some data destined for write-out may be referenced by a program before the next dump to disk. In that case, the data are retrieved rapidly from the software cache rather than slowly from the disk.
What is an interrupt? List the classes of interrupts.
What is an interrupt? State its advantage.
An interrupt is a signal that indicates the occurrence of an event to the operating system. Interrupts are generated from a device attached to a computer or from a program within the computer. Interrupts provide a way to improve processor utilization.
Program |
Generated by some condition that occurs as a result of an instruction execution, such as arithmetic overflow, division by zero, attempt to execute an illegal machine instruction, and reference outside a user’s allowed memory space. |
Timer |
Generated by a timer within the processor. This allows the operating system to perform certain functions on a regular basis. |
I/O |
Generated by an I/O controller, to signal normal completion of an operation or to signal a variety of error conditions. |
Hardware failure |
Generated by a failure, such as power failure or memory parity error. |
What are the approaches taken to handle multiple interrupts?
Two approaches can be taken to handle multiple interrupts.
-
The first is to disable interrupts while an interrupt is being processed
-
A second approach is to define priorities for interrupts and to allow an interrupt of higher priority to cause a lower-priority interrupt handler to be interrupted