Operating System
Operating System
1)A program that acts as an intermediary between a user and the computer hardware.
2) OS is a resource allocator(Manages all resources).
3) OS is a control program(Controls execution of programs to prevent errors).
Goals of OS:
Make the computer system convenient to use
Execute user programs and make solving user problems easier
Provides the basis/environment for application programs to run
Manages the computer hardware in an efficient manner
Components of a Computer System:
1)Hardware: provides basic computing resources CPU, memory, I/O devices
2)Operating system: Controls and coordinates use of hardware among various applications and users
3)Application programs: Define the ways in which the system resources are used to solve the computing problems of the users
4)Users: People, machines, other computer
Interrupts:
1)The occurrence of an event is usually signaled by an interrupt from either the hardware or the software.
2)Hardware may trigger an interrupt at any time by sending a signal to the CPU through the system bus.
3)Software may trigger an interrupt by executing a special operation called a system call (also called a monitor call).
4)When the CPU is interrupted, it stops current execution and immediately transfers execution to a fixed location.
5)The fixed location usually contains the starting address.
6)On completion, the CPU resumes the interrupted computation
Importance of Interrupts:
• It helps us to perform a task which is of higher importance when the processor is busy with another task.
• Interrupt alerts the processor to a high priority condition the interruption of current code the processor is executing.
• Processor responds by suspending its current activities, saving its state and executing a function called interrupt handler
Storage unit:
The CPU can load instructions only from memory
Basic unit of computer storage is the bit
A bit can contain one of two values, 0 and 1
A byte is 8 bit
Example: A computer that has 64-bit registers and 64-bit memory addressing typically has 64-bit (8-byte) words.
Computerstorage measured in collection of bytes. A kilobyte or KB is 1,024 bytes ,a megabyte or MB is 1,0242 bytes ,a gigabyte or
GB is 1,0243 bytes ,a terabyte or TB is 1,0244 bytes, a petabyte or PB is 1,0245 byte
Storage structure:
Main Memory
• Main memory is usually too small to store all needed programs and data permanently.
• Main memory is a volatile storage device that loses its contents when power is turned off or otherwise lost.
Secondary Memory
• The main requirement for secondary memory is that it be able to hold large quantities of data permanently.
• The most common secondary-storage device is hard disk, solid state disk, magnetic disk, which provides storage for both
programs and data.
Caching:
• Information in use copied from slower to faster storage temporarily
• Faster storage (cache) checked first to determine if information is there
• If it is, information used directly from the cache (fast)
• If not, data copied to cache and used there
• Cache smaller than storage being cached
• Cache management is important design problem
• Cache size and replacement policy
COMPUTER SYSTEM ARCHITECTURE
• Types of computer system based on number of general purpose processor
• Single processer system : There is one main CPU capable of executing a general-purpose instruction set, including instructions
from user processes. Other special purpose processors are also present which perform device specific tasks.
• Multiprocessor system : These systems have two or more processors in close communication, sharing the computer bus and
sometimes the clock, memory, and peripheral devices.
ADVANTAGES:
• Increased throughput: By increasing the number of processors, more work are done in less time.
• Economy of scale: Multiprocessor systems can cost less than equivalent multiple single-processor system
• Increased reliability: If functions can be distributed properly among several processors, then the failure of one
processor will not halt the system, only slow it down
TYPES:
1. Symmetric Multiprocessing – each processor performs all tasks
2. Asymmetric Multiprocessing – each processor is assigned a specific task.
• Cluster systems: Gather together multiple CPUs to accomplish computational work. They are composed of two or more
individual systems coupled together.
Multiple systems working together
• Usually sharing storage via a storage-area network (SAN)
• Provides a high-availability service which survives failures
TYPES:
Asymmetric clustering has one machine in hot-standby mode
Symmetric clustering has multiple nodes running applications, monitoring