Day 01Part 04- Operating sysytem for computer-Who executes the Program and where program is resides.
Contents
- 1 Operating System for Computers – Day 01, Part 04
- 2 Who Executes the Program and Where Does the Program Reside?
- 3 Introduction
- 4 Where Does a Program Reside?
- 5 1. Storage (Secondary Memory – Hard Disk, SSD, etc.)
- 6 2. RAM (Primary Memory – Temporary Storage During Execution)
- 7 3. CPU Cache (Temporary Fast Memory)
- 8 Who Executes the Program?
- 9 1. CPU (Central Processing Unit – The Brain of the Computer)
- 10 2. Operating System’s Role in Execution
- 11 Step-by-Step Execution Process
- 12 Conclusion
- 13 Day 01Part 04- Operating sysytem for computer-Who executes the Program and where program is resides.
- 14 iv semester cs3451-introduction to operating systems
- 15 Installation and Configuration of Operating System
- 16 UNIT-I Operating Systems Functions
- 17 Operating-System.pdf
Operating System for Computers – Day 01, Part 04
Who Executes the Program and Where Does the Program Reside?
Introduction
A program is a set of instructions written to perform a specific task. To execute a program, the Operating System (OS) manages its loading, execution, and termination. But where does a program reside, and who executes it? Let’s break it down.
Where Does a Program Reside?
1. Storage (Secondary Memory – Hard Disk, SSD, etc.)
Before execution, a program is stored in secondary memory (HDD, SSD, or external storage).
Example: Applications like MS Word, Chrome, or a game are stored as files on the hard disk.
2. RAM (Primary Memory – Temporary Storage During Execution)
When a user runs a program, the OS loads it from secondary storage into RAM.
Why? Because RAM is much faster than a hard drive and provides quick access for the CPU.
Example: When you open a browser, the program moves from disk to RAM.
3. CPU Cache (Temporary Fast Memory)
Some frequently used instructions are stored in CPU Cache to speed up execution.
Why? Cache memory is faster than RAM and reduces the CPU’s waiting time.
Who Executes the Program?
1. CPU (Central Processing Unit – The Brain of the Computer)
The CPU fetches, decodes, and executes instructions of a program.
The Control Unit (CU) directs the operation, while the Arithmetic Logic Unit (ALU) performs calculations.
2. Operating System’s Role in Execution
The OS acts as a manager, handling:
Process scheduling – Decides which program runs and for how long.
Memory management – Allocates RAM to active programs.
Resource allocation – Assigns CPU, disk, and input/output devices.
Step-by-Step Execution Process
User clicks to open a program (e.g., a browser).
The OS loads the program from storage into RAM.
CPU fetches and processes instructions from RAM.
Execution continues until the program is closed or task is completed.
The OS clears memory after execution to free up resources.
Conclusion
Programs reside in secondary storage (HDD/SSD) and move to RAM during execution.
The CPU executes the program with the help of the OS.
The OS plays a crucial role in managing memory, CPU scheduling, and execution.
Want to learn more about process management or scheduling in OS? Let me know!