NOVEMBER 2017 MODULE I OPERATING SYSTEM KNEC PAST PAPERS

1.
(a) Outline three functions of the job-control language in a computer system.
ANSWERS:

  1. Program execution
  2. File manipulation
  3. Job sequencing

(b) Explain each of the following terms as used in operating systems:
(i) spooling
ANSWERS: Spooling refers to putting jobs or tasks in a queue for later processing, typically used with printing jobs.

(ii) event hook
ANSWERS: Event hook is a mechanism in which a software program intercepts events like signals or messages that are sent during a computer’s operation, often allowing custom behavior.

(iii) context switch
ANSWERS: Context switch occurs when the CPU switches from one process or task to another, requiring the operating system to save the state of the old process and load the saved state for the new one.

(c) Assume the following load measurement queue: 39, 150, 68, 111, 115, 123, 52, 49 with the highest limit following first and 49 as the smallest. With this set of data, distribute the load in terms of time using the following disk scheduling algorithms: (i) shortest seek time first
ANSWERS: (Skipped due to being a diagram-related question)

(ii) scanning using head movement towards 0
ANSWERS: (Skipped due to being a diagram-related question)

(d) Explain two reasons why application programs are temporarily stored in the main memory of a computer system.
ANSWERS:

  1. To allow faster access to data and execution of instructions, as RAM is faster than secondary storage.
  2. To allow multitasking, enabling the operating system to switch between tasks quickly.

2.
(a) Outline three examples of system calls for each of the following:
(i) File manipulation
ANSWERS:

  1. Open a file
  2. Close a file
  3. Read/Write to a file

(ii) Communications
ANSWERS:

  1. Send message
  2. Receive message
  3. Establish connection

(b) Explain two modes of processing supported by multiprogramming operating systems.
ANSWERS:

  1. Batch Processing: Jobs are collected and processed together in batches.
  2. Time Sharing: Multiple users share system resources at the same time.

3.
(a) Several programs can be run simultaneously using a multiprogramming operating system.
(i) Explain the dispatcher’s role in this kind of processing.
ANSWERS: The dispatcher manages the selection and switching between processes, ensuring that the CPU is efficiently utilized by distributing processor time among processes.

(ii) Explain the problem associated with this mode of processing.
ANSWERS: One problem is resource contention, where multiple programs may compete for limited resources such as CPU time or memory, potentially causing delays.

(b) Jacques intends to adopt an operating system for his company’s network system. Explain the criteria he should consider when choosing one.
ANSWERS:

  1. Scalability: The OS should be capable of handling increased workloads.
  2. Security: The OS should provide robust security features to protect data.
  3. Compatibility: The OS must support the hardware and software used by the company.

4.
(a) The operating system uses various approaches for interfacing with users. Describe the two approaches.
ANSWERS:

  1. Command-Line Interface (CLI): Users type commands to interact with the operating system.
  2. Graphical User Interface (GUI): Users interact with the system using graphical elements like windows, icons, and menus.

(b) Explain each of the modes of programmable clocks as used in I/O device management:
(i) one-shot
ANSWERS: A mode where the clock generates an interrupt once and then stops until it is restarted manually.

(ii) repetitive
ANSWERS: A mode where the clock generates interrupts at regular intervals.

(c) Distinguish between the CPU-bound and I/O-bound jobs during time sharing processing.
ANSWERS:

  • CPU-bound jobs require more processing time and less input/output interaction.
  • I/O-bound jobs require more input/output operations than processing time.

(d) An I/O device is used in directory sorting using various logical structures. Describe three such structures that the operating system supports.
ANSWERS:

  1. Single-level directory
  2. Two-level directory
  3. Tree-structured directory

5.
(a) Outline three objectives of I/O scheduling in a computer system.
ANSWERS:

  1. To improve system throughput by optimizing I/O requests.
  2. To reduce the waiting time for processes requiring I/O.
  3. To ensure fairness in allocating I/O resources among processes.

(b) A system disk has been diagnosed to be having low access speed. Explain three ways in which the operating system could improve the performance of such a disk.
ANSWERS:

  1. Disk Defragmentation: Rearranging disk fragments to make data access faster.
  2. Caching: Using a faster storage medium to store frequently accessed data.
  3. Using a better disk scheduling algorithm like Elevator or C-SCAN to optimize disk usage.

6.
(a) Outline two examples for each of the following types of resources within a computer system:
(i) external
ANSWERS:

  1. Printers
  2. Network storage devices

(ii) internal
ANSWERS:

  1. CPU
  2. Memory

(b) With the aid of a diagram, describe three of the layered structures of the file system as used in operating systems.
(Skipped due to being a diagram-related question)

(c) Distinguish between deadlock avoidance and deadlock prevention as used in operating systems.
ANSWERS:

  • Deadlock avoidance dynamically checks whether a system is in danger of deadlock, ensuring that the system stays in a safe state.
  • Deadlock prevention uses policies to ensure that at least one of the conditions for deadlock does not hold.

(d) Explain two situations under which a preemptive scheduling decision would be made by the operating system during interrupt processing.
ANSWERS:

  1. When a higher-priority process becomes ready.
  2. When a process exceeds its allocated time quantum.

7.
(a) Explain the disadvantages associated with linked-allocation method.
ANSWERS:

  1. Slow access time as each block points to the next.
  2. Reliability issues, as corruption of one pointer could lead to data loss.

(b) Explain the purpose and key feature of the following methods:
(i) Absolute path and relative path as used in file management.
ANSWERS:

  • Absolute Path: Specifies the location of a file or directory from the root directory.
  • Relative Path: Specifies the location of a file or directory relative to the current directory.

(c) Outline two factors that may affect the allocation of time and resources in a multithreaded system.
ANSWERS:

  1. The number of active threads running.
  2. The priority of each thread.

(d) Distinguish between process state and processor scheduling as used in process management.
(i) Running state and ready state
ANSWERS: Running state means the process is currently executing instructions, while in the ready state, a process is waiting to be assigned to the CPU.

(ii) Blocked state and terminated state
ANSWERS: Blocked state means the process is waiting for some event (like I/O completion), while terminated state means the process has finished execution.