Overview of System Architecture
System Architecture refers to the structure and organization of a computer's hardware and software.
It outlines how different components of a computer system work together to perform tasks. Key
components include:
1. Central Processing Unit (CPU): The brain of the computer, responsible for executing
instructions.
2. Memory (RAM): Temporary storage that holds data and instructions for quick access by the
CPU.
3. Input/Output Devices (I/O): Components like keyboards, mice, monitors, and printers that
allow user interaction and data communication.
4. Storage Devices: Hard drives, SSDs, and other devices that store data permanently.
5. System Bus: A communication pathway that transfers data between different components of
the system.
These components are integrated and managed by system software, which coordinates the
functioning of the entire system.
Types and Goals of System Software
System Software refers to the software that manages and controls the computer hardware and
provides a platform for application software to run. The main goals of system software are to:
1. Facilitate Efficient Use of Hardware: System software ensures that the hardware resources
are utilized efficiently and optimally.
2. Provide User and Application Interaction: System software allows applications and users to
interact with the hardware, providing a user interface and APIs (Application Programming
Interfaces).
3. Ensure System Stability and Security: It manages system operations, ensuring that the
system runs smoothly and is protected from external threats.
Types of System Software:
• Operating Systems (OS): The core software that manages all hardware and software
resources. Examples include Windows, Linux, and macOS.
• Device Drivers: Software that controls and manages the operations of specific hardware
devices.
• Utility Programs: Software designed to perform maintenance tasks like virus scanning, disk
cleanup, and file management.
• Firmware: Software embedded in hardware components that controls their low-level
functions.
Operating System: Overview, Structure, and Services
Overview:
The Operating System (OS) is the most crucial system software that manages hardware and software
resources and provides services to computer programs. It handles everything from managing memory
and processes to handling input and output operations.
Structure of an Operating System:
• Monolithic Structure: All OS functions (e.g., process management, memory management) are
integrated into a single system.
•
• Layered Structure: OS is divided into layers, each built on top of the lower one, with the lowest
layer being the hardware.
• Microkernel Structure: Only essential functions are kept in the kernel, with other services
(e.g., drivers, system servers) running in user space.
Services Provided by the Operating System:
• Process Management: Creating, scheduling, and terminating processes.
• Memory Management: Allocating and deallocating memory to processes.
• File System Management: Organizing, storing, retrieving, and managing data on storage
devices.
• Device Management: Controlling and interfacing with hardware devices.
• Security and Protection: Ensuring authorized access and safeguarding the system from
malicious threats.
System Calls
System Calls are the interface between the operating system and user programs. They allow user-
level programs to request services from the kernel. Examples of system calls include:
• Process Control: Create, terminate, and manage processes.
• File Management: Open, read, write, and close files.
• Device Management: Request and release control of hardware devices.
• Information Maintenance: Get and set system data (e.g., date, time, process attributes).
• Communication: Facilitate communication between processes (e.g., sending and receiving
messages).
System calls are invoked through a specific instruction that switches the mode of operation from user
mode to kernel mode.
Programs, Processes, and Threads
• Programs: A program is a set of instructions written in a programming language that performs
a specific task. It is static and does not perform any action until executed.
• Processes: A process is an instance of a program in execution. It includes the program code,
current activity (such as program counter and registers), and the allocated memory.
• Threads: A thread is the smallest unit of a process that can be scheduled for execution.
Multiple threads can exist within the same process, sharing the same resources but running
independently.
Process Life Cycle
The Process Life Cycle describes the stages a process goes through from creation to termination. The
main states include:
1. New: The process is being created.
2. Ready: The process is ready to run and is waiting for CPU allocation.
3. Running: The process is currently being executed by the CPU.
4. Waiting: The process is waiting for some event (e.g., I/O completion).
5. Terminated: The process has finished execution and is awaiting removal from memory.
Here's a visual representation of the process life cycle:
• Figure 2: Process Life Cycle Diagram
o New → Ready → Running → Waiting → Terminated
Operations on Processes
The operating system performs several operations on processes, including:
• Process Creation: Initiating a new process.
• Process Scheduling: Determining which process should be executed next by the CPU.
• Process Termination: Ending a process once it has completed its task.
• Process Synchronization: Ensuring that processes running concurrently do not interfere with
each other.
• Inter-process Communication (IPC): Facilitating communication between processes.
User Mode and Kernel Mode Programs
In modern operating systems, the CPU operates in two distinct modes:
1. User Mode: The mode in which user applications run. In this mode, the CPU has limited
access to system resources, preventing user programs from directly interacting with hardware.
2. Kernel Mode: The mode in which the operating system runs. In this mode, the CPU has
unrestricted access to system resources, allowing it to manage hardware and execute system
calls.
Switching Between Modes:
When a system call or interrupt occurs, the CPU switches from user mode to kernel mode to perform
the required tasks, then switches back to user mode once the task is complete.