Computer System Architecture Notes
Computer System Architecture
Introduction
General Concept: This lecture taught by Dr. Ayman AboElHassan at Cairo University covers the architecture of computer systems, focusing on different processor configurations and the processes that manage those systems.
Date: February 17, 2025
Single-Processor Systems
Definition: A single-processor system contains a general-purpose processor that executes one instruction at a time.
Assumption: During this course, we will assume a single-core processor.
Multiprocessor Systems
Definition: Involves two or more processors working together in the same system.
Features:
They share the same memory (RAM).
Each processor has its own private registers and local cache.
They can execute multiple programs simultaneously, increasing the processing speed.
Multicore Systems
Definition: A special type of multiprocessor system that contains two or more processors (cores) on a single chip.
Advantages:
More efficient than connecting multiple single-core chips.
On-chip communication is faster, leading to better performance in executing single programs.
Note: While all multicore systems are multiprocessor systems, not all multiprocessor systems are multicore systems.
Clustered Systems
Definition: Comprises two or more individual computer systems (nodes) that work together.
Characteristics:
They form a parallel loosely-coupled system.
Each node can either be a single processor or a multicore system.
Example Layout: Computer 1, Computer 2, …, Computer n connected via a communication network.
Bootstrapping
Definition: The process of initializing the hardware system by loading the operating system (OS) kernel into RAM.
Role of Boot Loader: Acts as a mini operating system to perform hardware tests and initialize components to locate the OS kernel for loading into RAM.
Multi-stage Boot Loader:
Contains a 1st stage (e.g., BIOS, UEFI) to load further boot processes into RAM.
Contains a 2nd stage that reads the OS kernel from disk/USB (e.g., BOOTMGR, GNU GRUB).
Initial Tests: Power-On Self-Tests (POST) verify CPU, BIOS integrity, RAM, and system buses.
BIOS/UEFI
BIOS/UEFI: Loads the Master Boot Record (MBR) into RAM from the disk.
UEFI Advantages:
Supports disk sizes greater than 2 TB.
Offers animations, mouse support, and faster booting.
Features secure boot functionality.
System Calls
Purpose: Provide an interface between user programs and OS services, enabling user programs to request services from the OS.
Modes: User programs run in User Mode while the OS operates in Kernel Mode.
Operation: When a program requests a service, it issues a system call, switching from user mode to kernel mode.
Execution: Uses trap instructions, transferring control to the OS kernel and managing system resources accordingly.
System Call Types
Categories:
Process Management
File Management
Directory Management
Device Management
Communication
Miscellaneous
CPU Utilization
Concept of Utilization: Utilization = Time Used / (Time Used + Time Wasted).
Prediction: Utilization can be predicted based on the number of programs waiting for I/O.
Example Calculation:
If n is the number of programs and p represents the percentage time waiting for I/O, CPU utilization can be computed as: CPU Utilization = 1 - p^n.
Processes
Definition of Processes: A process is the dynamic execution of a program, which includes the program code, current state, and the resources required for execution.
Process Elements:
Address Space, Code Segment, Data Segment, Stack Segment, and system resources.
Process States: A process can be in a Running, Ready, or Blocked state, based on its execution requirements.
Behavior: Process execution alternates between bursts of CPU usage and waiting for I/O, categorized into CPU-bound and I/O-bound processes.
Process Management
Process Table: Managed by the OS, containing entries for each process, including state, resources used, and identifier information.
Operations: Include creating, terminating, and scheduling processes, among others.
Creating Processes: Uses
forkto create a duplicate of a process andexecvto run a new program.
Threads
Definition: Threads, or Light-weight processes (LWP), represent multiple execution paths within the same process, sharing the same memory space.
Conclusion
This lecture comprises key components of system architecture, bootstrapping, system calls, CPU utilization, and process management. Understanding these foundational elements is essential for comprehending how operating systems manage hardware and software resources effectively.
Computer System Architecture focuses on various processor configurations and system management processes.
Single-Processor Systems
A system with a general-purpose processor executing one instruction at a time.
Multiprocessor Systems
Two or more processors working together, sharing the same RAM and executing multiple programs simultaneously.
Multicore Systems
A type of multiprocessor system with multiple cores on a single chip, enabling efficient on-chip communication.
Clustered Systems
Comprising multiple nodes working together, can consist of single or multicore systems.
Bootstrapping
The initialization process loading the operating system (OS) kernel into RAM, using a boot loader for hardware checks.
BIOS/UEFI
Loads the Master Boot Record (MBR) into RAM, with UEFI supporting larger disks and faster booting.
System Calls
An interface for user programs to request OS services, operating in User Mode and Kernel Mode.
CPU Utilization
Calculated as Utilization = Time Used / (Time Used + Time Wasted). Utilization can be predicted based on the number of programs waiting for I/O.
Processes
Dynamic execution of a program, with states like Running, Ready, and Blocked, balancing CPU usage and I/O waiting.
Threads
Light-weight processes allowing multiple execution paths within the same process, sharing memory.
Conclusion
Key components include system architecture, bootstrapping, system calls, CPU utilization, and process management, vital for understanding OS functions.