0% found this document useful (0 votes)
5 views12 pages

os (1)

The document outlines the evolution of programming systems, operating systems, and language translators, highlighting key developments from early programming languages to modern systems. It details the historical progression from binary machine language to high-level languages, the emergence of operating systems, and the advancements in language translation techniques. Additionally, it discusses the functions of loaders and their design, including absolute and direct-linking loaders, emphasizing their roles in program execution and memory management.

Uploaded by

nilakshbe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views12 pages

os (1)

The document outlines the evolution of programming systems, operating systems, and language translators, highlighting key developments from early programming languages to modern systems. It details the historical progression from binary machine language to high-level languages, the emergence of operating systems, and the advancements in language translation techniques. Additionally, it discusses the functions of loaders and their design, including absolute and direct-linking loaders, emphasizing their roles in program execution and memory management.

Uploaded by

nilakshbe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Evolution of the Components of a Programming System

Introduction
A programming system includes the tools and methodologies used to develop, manage, and execute computer
programs. Over the years, programming systems have evolved significantly, reflecting advancements in
hardware and software technologies.

Historical Evolution
1. Early Programming Systems (1940s-1950s)
• Programs were written in binary machine language, making programming tedious and error-prone.
• Assembly language introduced mnemonic instructions.
Key Components:
• Machine Language (binary instructions)
• Assembly Language (mnemonic symbols)
• Assembler (translates assembly to machine language)
2. Higher-Level Languages (Late 1950s-1960s)
• Introduction of languages such as Fortran, COBOL, ALGOL.
• Simplified programming with more natural language constructs.
Key Components:
• Compiler (high-level code to machine language)
• Loader (loads programs into memory)
• Linker (combines program modules)
3. Structured and Modular Programming (1970s)
• Emphasized clarity, structured control flows, and modularity.
Key Components:
• Structured languages: C, Pascal
• Libraries for code reuse
• Development environments (early IDEs)
4. Object-Oriented Programming (1980s-1990s)
• Software designed using objects representing real-world entities.
Key Components:
• Object-oriented languages: C++, Java
• Classes, inheritance, polymorphism
• Integrated Development Environments (IDEs)
5. Modern Programming Systems (2000-present)
• Focused on productivity, scalability, continuous integration, and cloud computing.

1
Key Components:
• Modern languages: Python, JavaScript, Go, Rust
• Version control: Git, SVN
• Automated Testing Frameworks: JUnit, pytest
• Continuous Integration/Continuous Deployment (CI/CD): Jenkins, GitLab CI/CD
• Cloud Computing Platforms: AWS, Azure, Google Cloud

Evolution of Operating Systems


Introduction
An operating system (OS) is software that manages computer hardware, software resources, and provides
common services for computer programs. It acts as an intermediary between the user of a computer and the
computer hardware.

Historical Evolution
1. Serial Processing (1940s-1950s)
• Computers ran one job at a time, operated manually by programmers.
• No operating systems; programs directly managed hardware.
• Slow and inefficient; considerable downtime between programs.
2. Batch Systems (1950s-1960s)
• Jobs with similar requirements grouped into batches.
• Batch processing improved utilization by minimizing idle time.
• Introduction of job control languages (JCL) for specifying job requirements.
3. Multiprogramming (1960s)
• Enabled multiple programs to reside in memory simultaneously.
• CPU switches jobs to utilize waiting times (e.g., during I/O operations).
• Significant improvement in CPU utilization and throughput.
4. Time-Sharing Systems (1970s)
• Allowed multiple users to interact with the computer simultaneously.
• Enabled interactive computing, with short CPU time slices allocated to users.
• Led to development of UNIX, which introduced concepts like shell and file permissions.
5. Personal Computing (1980s)
• Emergence of personal computers with OS such as DOS, Windows, and Mac OS.
• Graphical user interfaces (GUIs) provided ease of use for non-technical users.
• Focus shifted towards user-friendliness and desktop management.
6. Modern Operating Systems (1990s-present)

2
• OS evolved to support advanced multitasking, virtual memory, and security features.
• Introduction of networked and distributed operating systems.
• Integration of virtualization and cloud computing.
• Major modern operating systems: Windows, Linux, macOS, Android, and iOS.

Functions and Features of Modern OS


• Process Management: Scheduling and execution of processes.

• Memory Management: Efficient allocation and deallocation of memory resources.


• File System Management: Handling files and directories, ensuring data persistence.
• Device Management: Control and communication with peripheral devices.
• Security Management: Protecting system resources, authentication, and access control.

Impacts of OS Evolution
• Improved resource utilization and efficiency.
• Enhanced user experience and accessibility.

• Increased reliability and robustness of computing systems.


• Facilitated widespread adoption of computing technology.

Evolution of Language Translators


Introduction
A language translator is a software tool that translates programs written in high-level programming languages
into machine code understandable by computers. Translators have evolved significantly, improving efficiency,
portability, and ease of programming.

Types of Language Translators


1. Assemblers
• Translate assembly language into machine language.
• Assembly language consists of mnemonic codes representing machine-level instructions.

2. Compilers
• Convert high-level language (HLL) code to machine language in one go.
• Perform syntax checking, semantic analysis, optimization, and code generation.
• Produce executable files directly.

3. Interpreters
• Translate and execute code line-by-line at runtime.
• Allow immediate execution and debugging.

• Generally slower than compiled programs due to runtime translation.

3
Historical Evolution
1. Early Translators (1950s-1960s)
• First assemblers developed to ease binary coding.

• Early compilers like Fortran compiler significantly automated coding tasks.


2. Optimization and Efficiency (1970s-1980s)
• Compilers became more sophisticated, introducing code optimization techniques.
• Introduction of intermediate code representation for portability.

• Development of interpreters for languages like BASIC and Lisp for interactive environments.
3. Modern Translators (1990s-present)
• Advanced compiler techniques: Just-In-Time (JIT) compilation, dynamic translation.

• Popularization of interpreted and hybrid approaches (e.g., Python, Java bytecode).


• Enhanced debugging, profiling, and optimization capabilities integrated into IDEs.

Key Functions of Language Translators


• Lexical Analysis: Converts source code into tokens.
• Syntax Analysis (Parsing): Checks grammatical structure and constructs parse trees.
• Semantic Analysis: Validates semantic rules, assigns meaning.
• Intermediate Code Generation: Abstract code representation for optimization.

• Optimization: Improves performance of generated code.


• Code Generation: Translates optimized intermediate code into target machine code.

Machine Structure, Machine Language, and Assembly Language


Introduction
Understanding machine structure, machine language, and assembly language is foundational to comprehend-
ing how computers execute instructions and manage operations at a hardware level. These three layers form
the bridge between software and hardware, where human-written instructions are eventually translated into
actions performed by circuits and transistors.

Machine Structure
Definition: Machine structure refers to the internal organization of a computer system’s hardware compo-
nents that interact to fetch, decode, and execute instructions.
Key Components:

• Central Processing Unit (CPU)


– Control Unit (CU): Directs all operations in the system, interprets instructions, and generates
control signals.
– Arithmetic Logic Unit (ALU): Performs mathematical calculations (addition, subtraction,
etc.) and logical comparisons (AND, OR, NOT).

4
• Registers: Small storage units within the CPU for holding operands, instructions, or memory ad-
dresses temporarily.
– E.g., Accumulator (ACC), Base Register (BX), Stack Pointer (SP).
• Main Memory (RAM): Holds both program instructions and data during execution.

• System Buses:
– Data Bus: Transfers actual data.
– Address Bus: Transfers location addresses to memory or I/O.
– Control Bus: Transfers control signals like Read/Write or Interrupt.

• Input/Output Devices: Allow interaction with the external world. Examples include keyboard,
mouse, display, network cards.
Example Architecture: Von Neumann Model
• Single memory space for both data and instructions.

• Program counter (PC) points to the next instruction.


• Uses sequential fetch-decode-execute cycle.

Machine Language
Definition: Machine language is a set of binary instructions that a computer can execute directly. It is the
lowest level of code, often represented in bits (0s and 1s).
Features:
• Each instruction contains an opcode and one or more operands.

• The code is tightly coupled with the hardware architecture.


• Difficult for humans to understand or debug.
Example:
10110000 01100001 ; MOV AL , 61 h ( Move hexadecimal 61 into AL register )
11001011 00000011 ; ADD CL , 3 ( Add value 3 to CL register )

Advantages:

• Fastest possible execution.


• No translation overhead.
Disadvantages:

• Not portable across architectures.


• Not human-readable.
• Prone to human error.

5
Assembly Language
Definition: Assembly language is a low-level programming language that uses symbolic mnemonics to
represent machine-level instructions.
Characteristics:

• One-to-one correspondence with machine language.


• Uses human-readable symbols (e.g., ADD, MOV, SUB).
• Allows the use of labels, constants, macros, and comments.
• Needs to be translated to machine code using an assembler.

Sample Instructions:
MOV AX , 0005 h ; Load the number 5 ( in hex ) into register AX
ADD AX , 0003 h ; Add 3 to AX
MOV [2000 h ] , AX ; Store the result into memory address 2000 h

Structure of Assembly Instruction:


• Label (optional): Named reference for jumps or loops.

• Mnemonic: Operation like MOV, ADD, SUB, JMP.


• Operands: Registers, constants, or memory locations.
• Comment: Denoted by a semicolon (;) to explain instruction.

Extended Example:
START : MOV AX , 0040 h ; Load hex 0040 into AX
MOV BX , AX ; Copy AX into BX
INC BX ; Increment BX
CMP BX , 0045 h ; Compare BX to 0045 h
JNE START ; Jump back to START if not equal

Applications
• Writing bootloaders and BIOS code.
• Programming microcontrollers (e.g., Arduino, 8051).
• Device drivers and OS kernel modules.

• Performance optimization in real-time systems.

6
Loaders
Loader Schemes
A loader is a system software component responsible for loading machine language programs into memory.
It prepares the code for execution by the processor, ensuring correct address translation, linking external
symbols, and managing memory layout.

Fundamental Functions of a Loader


• Allocation: Assign memory space to the program.
• Loading: Read instructions/data into memory.
• Relocation: Modify code/data addresses to match memory allocation.
• Linking: Resolve symbolic references among program modules.
• Execution: Transfer control to the executable code.

1. Compile-and-Go Loader
Working:
• Source code is compiled and immediately loaded into memory.
• Execution begins directly after compilation.
• No object file or loader module is created.
Example:
$ cc program . c
$ ./ a . out \ textit {( executed immediately after compilation )}

Advantages:
• Simple implementation.
• Fast startup for development/debugging.
Disadvantages:
• Compilation must be repeated for every run.
• Source code must be available.
• Inefficient memory usage; no memory reuse.

2. Absolute Loader
Working:
• Loader reads object code with absolute addresses.
• Loads it directly into those addresses without modification.
Format:
• Header Record: Program name, start address.
• Text Record: Instructions/data with absolute addresses.

7
• End Record: Entry point address.
Example:
H COPY 0000 0018
T 0000 141033282030...
E 0000

Advantages:
• Fast and efficient loading.
Disadvantages:
• No support for relocation.
• Programmer must manage memory.

3. Relocating Loader
Working:
• Uses relocation table to adjust all absolute addresses.
• Loader calculates the new address based on actual load position.
Relocation Formula:

New Address = Original Address + Relocation Offset

Advantages:
• Programs can be loaded at any memory location.
• Memory is better utilized.
Disadvantages:
• Requires relocation table and address scanning.

4. Direct-Linking Loader (DLL)


Working:
• Supports linking multiple object modules.
• Maintains External Symbol Table (ESTAB).
• Performs linking and relocation during loading.
Phases:
• Pass I: Build ESTAB from Header and Define records.
• Pass II: Load Text records, resolve references using ESTAB.
Advantages:
• Supports modular programming.
• Facilitates external references and reuse.
Disadvantages:
• Complex structure and management.

8
5. Dynamic Loader
Working:
• Loads modules only when required at run time.

• Uses shared objects or dynamic link libraries.


• Useful in memory-constrained environments.
Advantages:
• Reduces initial load time.

• Saves memory by sharing common code (e.g., libc.so).


Disadvantages:
• Runtime overhead due to delayed loading.

• Complex dependency resolution.

Design of an Absolute Loader


Introduction
An Absolute Loader is a simple form of loader used to load executable machine code into memory at the
exact addresses specified in the program. It assumes that the program contains correct memory locations
and requires no relocation or linking. This makes it fast but inflexible.

Features
• Fixed Memory Addresses: The object code contains absolute addresses, and the loader places the code
into these exact memory locations.

• No Relocation or Linking: The loader does not modify addresses or resolve external references.
• Due to its straightforward operation, it’s easy to implement but lacks flexibility.

Structure of Object Program for Absolute Loader


• Header Record (H): Program name, starting address, length.
• Text Record (T): Contains actual object code with starting addresses.
• End Record (E): Indicates the end of the program and may specify the start execution address.

Example:
H COPY 001000 00107 A
T 001000 1 E 141033 281030 300015 ...
T 00101 E 15 482039 3 C1003 ...
E 001000

9
Working of Absolute Loader
1. Read the header record to determine the starting address.
2. For each text record:
• Read the starting address and object code.
• Place the code at the exact specified location in memory.
3. Read the end record and transfer control to the starting address.

Steps in Design of Absolute Loader


• Open the object file.
• Read one record at a time.
• If the record is a text record, convert object code to machine code.
• Write machine code into memory at the specified address.
• If end record is reached, jump to the specified address.

Advantages
• Extremely fast loading since no relocation/linking is needed.
• Simple to implement and understand.

Disadvantages
• Cannot handle programs that need to be loaded at different memory locations.
• No support for multiple modules or external references.
• Programmer must handle all memory-related details.

Use Cases
• Useful for bootstrapping or loading very small, self-contained programs.
• Common in early operating systems and simple embedded systems.

Illustration

Figure: Loading
memory blocks using Absolute Loader

10
Design of a Direct-Linking Loader
Introduction
A Direct-Linking Loader (DLL) is an advanced loader that performs both linking and relocation at load
time. It is designed to manage large applications that consist of multiple object modules. It uses external
symbol definitions to combine all required modules into a single executable.

Key Features
• Two-pass loading process.
• Maintains an External Symbol Table (ESTAB).
• Handles external references across object modules.
• Adjusts relocation using modification records.

Structure of Object Program


• Header Record (H): Program name, starting address, and program length.
• Define Record (D): Lists symbols defined in the module with addresses.

• Refer Record (R): Lists external symbols referenced by this module.


• Text Record (T): Actual object code with its relative address.
• Modification Record (M): Instructions needing address adjustment.

• End Record (E): Indicates end of module and entry point.

Pass I: Building ESTAB


• Start with program load address.

• Read each module’s header and define records.


• Assign absolute addresses to symbols and store in ESTAB.

Pass II: Loading and Relocation


• Load the text records into memory using the addresses from Pass I.
• Apply modification records to adjust code.
• Resolve external references using ESTAB.

• Transfer control to the starting address from the end record.

Advantages
• Enables modular program development.

• Supports program relocation.


• Reduces recompilation by linking separately compiled modules.

11
Disadvantages
• Requires more memory and processing time.
• Complex implementation and debugging.

Use Cases
• Suitable for large-scale software systems.
• Used in modern operating systems and multi-module application development.

Illustration

Figure: Workflow of a Direct-Linking Loader with two object modules

12

You might also like