Systems Programming - Detailed Notes
What is Systems Programming?
- Systems programming involves creating software that controls and manages hardware
operations, enabling the computer to perform tasks efficiently.
- Example: Writing an operating system like Linux or Windows that manages hardware and
software interactions.
- Role of Systems Programs:
- Systems programs translate user-friendly instructions into machine-level commands.
- Examples include compilers (convert C++ code to binary), loaders (prepare the program
for execution), and file systems (manage how files are stored/retrieved).
- Metaphor: Computers are called a 'beast that obeys commands' because they execute tasks
strictly based on given instructions without independent decision-making.
- Purpose:
- Systems programs make computers:
- User-friendly: Easier to interact with.
- Adaptable: Flexible for various applications.
Early Computing
- Primitive Operations:
- Early computers only understood basic commands, such as turning components on/off
using switches.
- Example: An engineer flipping switches manually to add numbers in a binary system.
- Need for Complexity:
- As requirements grew, users wanted computers to process complex instructions like
calculations.
- Example: Users wanted to input commands such as 'If Y = 10, calculate X = 30 × Y,' but
early machines couldn’t understand this without intermediate programs.
- Modern Shift: Today, computers rely on systems programs (like compilers or interpreters)
to translate these high-level instructions into machine-readable formats.
Key Components of Systems Programs
1. Compilers
- Convert high-level programming languages (e.g., Python, Java) into machine code (binary).
- Example: A C++ program written to calculate interest is converted into binary instructions
that the processor can execute.
2. Loaders
- Prepare machine language programs for execution by loading them into memory.
- Example: When running a compiled Python program, the loader prepares it to interact
with the hardware.
3. Macro Processors
- Allow programmers to use shortcuts or predefined commands.
- Example: Instead of writing repetitive code for a loop, a macro can automate this.
- Example: A macro like '#define SQUARE(x) (x * x)' replaces repetitive operations with a
single command.
4. Operating Systems & File Systems
- Operating Systems:
- Manage hardware and software resources.
- Example: Windows schedules CPU tasks and allocates memory for applications.
- File Systems:
- Organize, store, and retrieve data efficiently.
- Example: NTFS (Windows) or ext4 (Linux) ensures files are stored systematically for
quick access.
Current Scenario
- Usage:
- Over 100,000 computers are operational worldwide across industries, used for
everything from personal tasks to critical operations like healthcare and banking.
- Factors Influencing Productivity:
- Efficiency: How resources (CPU, memory) are utilized.
- Example: An optimized operating system uses minimal memory to process tasks quickly.
- Sophistication: Advanced system programs offer better functionality.
- Example: A modern OS supports multi-tasking and user-friendly GUIs.
- Effectiveness: Systems programs need to meet user requirements.
- Example: A compiler that handles complex languages like Rust enhances productivity for
developers.