Unit1
Computer Hardware Review
Operating System and Hardware
An operating system (OS) is deeply integrated with the computer's hardware, extending its instruction set and managing resources.
The OS requires in-depth knowledge of how the hardware appears to programmers.
Components of a Personal Computer
Components include the CPU, memory, and I/O devices connected via a system bus for communication.
Modern PCs have a complex structure involving multiple buses.
Processors
Role of CPU
The CPU is the "brain" of the computer responsible for fetching and executing instructions.
Basic CPU cycle: Fetch instruction from memory, decode it, execute it, and repeat until the program ends.
Registers are present to hold variables and temporary results.
Special Registers
Program Counter: Holds the address of the next instruction to be fetched.
Stack Pointer: Points to the top of the current stack in memory.
Program Status Word (PSW): Contains condition code bits set by comparison instructions, CPU priority, and mode (user/kernel).
Advanced CPU Designs
Performance Improvement Techniques
Modern CPUs do not fetch and execute one instruction at a time.
Pipeline Design: Instructions are overlapped in execution stages to improve throughput.
Superscalar CPU: Contains multiple execution units, allowing for parallel instruction processing leading to higher performance.
Primary Memory and Hierarchy
Different Memory Types
Memory hierarchy includes:
Registers: Fastest storage inside the CPU (limited capacity).
Cache Memory: High-speed memory that stores frequently used data to minimize access times.
Main Memory (RAM): Serves as the workhorse, holding currently running programs and data.
ROM: Non-volatile memory stored at the factory, cannot be changed post-manufacturing.
EEPROM and Flash Memory: Non-volatile but can be modified.
Magnetic Disk (Hard Disk): Slower than RAM, used for long-term data storage.
I/O Devices
Consist of a controller and the device itself. The controller executes commands sent by the OS.
Device Driver
Software interacting with the controller, running in kernel mode, essential for proper device operation.
Communication Modes: Polling, Interrupts, DMA (Direct Memory Access).
Types of Operating Systems
Mainframe OS
Designed for large-scale processing of jobs, with heavy I/O needs. Supports:
Batch Systems: Processes tasks without user interaction (e.g., insurance claims).
Transaction Processing: Handles many small requests simultaneously.
Time Sharing: Allows multiple remote users to run jobs.
Server OS
Manages sharing of resources among multiple users via networks, providing essential services like file and print services.
Multiprocessor OS
Utilizes multiple CPUs; can manage parallel processing efficiently.
Personal Computer OS
Designed for single-user environments with strong support for multitasking (e.g., Windows, Linux).
Handheld Computer OS
For mobile devices, supporting multitasking and various applications (e.g., Android, iOS).
Embedded OS
Operates on devices not traditionally viewed as computers, like microwaves or cars, often with fixed functions (e.g., Embedded Linux).
Sensor-Node OS
Designed for networks of tiny computers (sensor nodes) used in various applications (e.g., TinyOS).
Real-Time OS
Systems requiring guaranteed task execution within specific time constraints (e.g., hard real-time systems in avionics).
Smart Card OS
Small OS suitable for credit card-sized devices, often running Java applets.
Operating System Concepts
Processes
A process is a program in execution, including address space, program data, and more.
Processes can create child processes, forming a hierarchy.
Address Spaces
Each process has its address space which may be larger or smaller than the actual memory.
File Systems
Manage files and directories, providing system calls for file operations, maintaining a hierarchical structure.
System Calls
Interface for user programs to request services from the OS kernel, handling tasks like process management and file access.
I/O Management
Manages input/output devices. Protection of sensitive user data is crucial, utilizing permission bits (rwx) to control access.
Shell and Command Interpretation
The shell acts as the interface between users and OS, executing command-line inputs and managing processes.
Conclusion
The comprehensive understanding of both the hardware components and software (OS) enables the optimized operation of computer systems across various applications and devices.