Revision System Progamming
Revision System Progamming
File System Management: Providing an interface for file operations such as creation,
deletion, reading, and writing, as well as managing file permissions and directory
structures.
Device Management: Managing communication between peripheral devices and the
computer, including device drivers, input/output operations, and interrupt
handling.
Security: Enforcing access controls, authentication mechanisms, and ensuring data
integrity and confidentiality.
User Interface: Providing a user-friendly interface for interaction with the system, which
can be graphical, command-line-based, or a combination of both.
Error Handling: Detecting and handling errors that occur during system operation to
prevent system crashes and data loss.
Resource Allocation: Managing system resources such as CPU time, memory, disk
space, and network bandwidth to optimize performance and ensure fairness among
users and applications.
(b) Describe the following terms as used in system programming. [10 marks]
(i) System call: A system call is a request made by a program to the operating
system kernel for performing tasks such as file manipulation, process
control, or communication. System calls provide an interface between user-
level processes and the kernel.
(v) File locking: File locking is a mechanism used to restrict access to a file or
a portion of a file to prevent concurrent access by multiple processes. It
ensures data consistency and prevents race conditions when multiple
processes attempt to read from or write to the same file simultaneously.
(c) Write down the shell code that will list all the sub directions of the current
directory on Unix. [4 marks]
ls -d */
(d) Outline three differences between memory management and using virtual
swapping. [6 marks]
Memory Management:
Involves managing physical memory (RAM) resources.
Allocates memory to processes, tracks memory usage, and deallocates memory
when processes terminate.
Ensures efficient utilization of available physical memory and prevents
memory fragmentation.
Virtual Swapping:
Involves using secondary storage (such as a hard disk) to supplement physical
memory when it becomes insufficient.
Pages of memory are swapped between RAM and disk to free up space for
active processes.
Helps in accommodating more processes than the physical memory can hold,
but swapping can lead to performance degradation due to disk I/O overhead.
QUESTION TWO [20 MARKS]
(a) Explain the role of controllers in 1/0 components of a computer system.
[6 marks]
Role of controllers in I/O components:
Controllers act as intermediaries between the CPU and peripheral devices,
managing the flow of data between them. They handle tasks such as data
transfer, error detection and correction, and protocol translation to ensure
efficient communication between the CPU and devices.
(e) Discuss two ways that can be used to manage free disk storage for efficient
usage. [4 marks]
Disk Quotas: Disk quotas allow system administrators to set limits on the amount
of disk space that users or groups can consume. By enforcing disk quotas,
administrators can prevent individual users from monopolizing disk resources and
ensure fair allocation of storage space.
Disk Space Allocation Policies: File systems employ different allocation strategies
to manage free disk space efficiently. Techniques such as block suballocation,
delayed allocation, and extent-based allocation optimize disk space utilization by
reducing fragmentation and minimizing wasted space. Additionally, file systems
may employ techniques like compression and deduplication to further conserve
disk space.
QUESTION FOUR [20 MARKS]
(a) Briefly discuss the different types of processes in Unix. [4 marks]
Types of processes in Unix:
1. Foreground Processes: Foreground processes are interactive processes that
run in the foreground and interact directly with the user through the terminal.
They typically receive user input and provide output directly to the terminal.
2. Background Processes: Background processes are non-interactive
processes that run in the background without user intervention. They
continue executing even when the user is not actively interacting with the
terminal and do not require user input.
3. Daemon Processes: Daemon processes are system processes that run in the
background and perform various system-related tasks. They often run as
services, such as web servers, email servers, or print servers, and operate
without direct user interaction.
(b) Explain the different types of Unix commands that can be used in process
management. [6 marks]
Unix commands for process management:
1. ps: The ps command displays information about active processes, including their
process IDs (PIDs), CPU and memory usage, and execution status.
2. kill: The kill command sends signals to terminate or control processes. It allows
users to send specific signals, such as SIGKILL or SIGTERM, to terminate
processes gracefully or forcefully.
3. top: The top command provides real-time monitoring of system processes,
displaying a dynamic view of CPU and memory usage, process IDs, and other
relevant information.
4. nice: The nice command adjusts the priority of processes, allowing users to
change the scheduling priority of processes to allocate CPU resources more
effectively.
5. renice: The renice command allows users to change the priority of running
processes, adjusting their scheduling priority dynamically.
(c) Explain any 5 types of system calls used in file handling and management
in C programming. [10 marks]
System calls for file handling and management:
1. open(): Opens a file and returns a file descriptor for subsequent operations.
2. close(): Closes a file descriptor, releasing associated resources.
3. read(): Reads data from an open file into a buffer.
4. write(): Writes data from a buffer to an open file.
5. lseek(): Moves the file pointer associated with a file descriptor to a specified
position.
6. ioctl(): Performs I/O control operations on a file or device, such as setting flags or
querying device status.
QUESTION FIVE [20 MARKS]
(a) With the use of a diagram explain the windows system architecture.
[10 marks]
Windows system architecture: