VIRTUAL COMPUTERS…
VIRTUAL COMPUTERS
Virtual Computer என்பது physical hardware computer அல்ல. ஒரு programming language அல்லது software system-க்கு தேவையான imaginary / abstract machine model-ஐ software மூலம் உருவாக்குவது. Simple Tamil: Programmer எழுதும் program, actual CPU-ஐ …
Virtual Computer என்பது physical hardware computer அல்ல. ஒரு programming language அல்லது software system-க்கு……
1. WHY DO WE NEED A VIRTUAL C……
Different computers-க்கு different: CPU Instruction Set Memory organization Operating System Hardware archite……
SIMPLE REAL-LIFE EXAMPLE
Suppose Java program: System.out.println("Hello"); Java source code நேரடியாக Intel/AMD/ARM machine code ஆக மட……
1. VIRTUAL COMPUTER என்றால் A……
இல்லை. Physical computer: CPU RAM Storage Keyboard Monitor Virtual computer: Virtual Instructions Virtual Mem……
IMPORTANT EXAM POINT
Programming language theory-ல் V……
Programming Language Virtual Machine ஒரு programming langua……
Full System Virtual Machine ஒரே physical computer-ல் another complete operating system run செய்வது. Examples:……
BASIC STRUCTURE
High-Level Program ↓ Compiler / Translator ↓ Intermed……
ABSTRACT MACHINE
Virtual computer-க்கு closely……
ஒரு programming language-ன் execution behavior-ஐ explain செய்ய theoretically define செய்யப்பட்ட ……
PHYSICAL MACHINE VS ABSTRACT MACHINE
VIRTUAL INSTRUCTION SET
Physical CPU instruction: ADD MOV JMP LOAD STORE Virtual computer-க்கும் own virtu……
STACK-BASED VIRTUAL MACHINE
பல virtual machines stack-bas……
Need: 10 + 20 Virtual instructio……
empty After: PUSH 10 Stack: 10 Then: PUSH 20 Stack: 20 1……
REGISTER-BASED MACHINE
சில virtual machines register……
R1 = 10 R2 = 20 R3 = R1 + R2 ……
VIRTUAL COMPUTER AND TRANSLATION
Suppose source language: x = a + b Translator அதை virtual instructions-ஆக மாற்றலாம்: LOAD a LOAD b ADD ST……
INTERMEDIATE REPRESENTATION
Virtual computers பெரும்பாலும் Intermediate Representation (I……
High-Level Source ↓ Intermedi……
1. WHY INTERMEDIATE CODE?…
Suppose 3 source languages: Language A Language B Language C and 3 machines: Machine X Machine Y Machine Z Ev……
PORTABILITY
Virtual computer-ன் major benefit: Portability ஒரே intermediate program ……
Java Bytecode ↓ Windows JVM → Windows Linux JVM → Linux macOS JV……
MACHINE INDEPENDENCE
Virtual machine ஒரு standard machine interface provide செய்கிறது. Virt……
JAVA VIRTUAL MACHINE - EXAMPLE
C++ unit என்றாலும் virtual co……
Flow: Test.java ↓ Java Compiler ↓ Tes……
BYTECODE
Physical machine code அல்லாமல் virtual machine……
Bytecode ≠ Source Code Bytecode ≠ Native ……
P-CODE
Programming language history-ல் important term: P-code / Portable Code Pascal implementations ப……
VIRTUAL COMPUTER AS AN INTERPRETER
ஒரு virtual computer-ஐ software interpreter போல implement செய்யலாம். Pseudo logic: Fetch virtual instruction ……
JIT COMPILATION
Virtual machine every instruction-ஐ always interpreter மூலம் மட்டும் execute செய்ய வேண்டியதில்லை. Modern VMs:……
INTERPRETER VS JIT
Interpreter Virtual instruction ↓ Interpret ↓ Execute JIT Virtua……
VIRTUAL COMPUTER COMPONENTS
A virtual computer may conceptually contain: Virtual CPU Vir……
VIRTUAL CPU
Physical CPU-க்கு equivalent conceptual execution componen……
VIRTUAL MEMORY MODEL
Virtual computer programming language var……
Stack Heap Static Area…
+----------------+ | Code | +----------------+ | Static Data | +--------……
VIRTUAL STACK
Function calls மற்றும் local ……
int add(int a, int b) { return a + b; } Conceptual call: main() ↓ add()……
PROGRAM COUNTER
Virtual computer-லும்: Program Counter (PC) next instruction location track செய்ய conceptu……
VIRTUAL COMPUTER AND RUNTIME SYSTEM
Programming language runtime system: Memory allocation Function calls Exception handling……
RUNTIME ENVIRONMENT VS VIRTUAL MACHINE
பல practical systems-ல் இரண்ட……
VIRTUAL COMPUTER AND BINDING
Virtual machine சில bindings runtime-ல் decide செய்ய உ……
Actual function runtime-ல் select ஆகலாம். இந்த pro……
VIRTUAL COMPUTER AND MEMORY MANAGEMENT
Virtual machine language-க்கு automatic memory management support கொடுக்கலாம். Example Java: Object created ↓……
VIRTUAL MACHINE vs EMULATOR
இவை related ஆனால் exactly same அல்ல. Emulator ஒரு particular hardware architecture-ஐ imitate செய்கிறது. Exa……
VIRTUAL MACHINE vs HYPERVISOR
இது exam confusion area. Language VM JVM CLR Purpose: Program/intermediate code ex……
SYSTEM VIRTUAL MACHINE
One physical computer: Physical Hardware ↓ Hypervisor / \ VM 1 VM 2 ↓ ↓ Linux Windows ஒவ்வொரு ……
PROCESS VIRTUAL MACHINE
ஒரு single program execute செய்ய lifetime மட்டும் இருக்கும் virtu……
SYSTEM VM VS PROCESS VM
VIRTUAL COMPUTER ADVANTAGES
Important advantages: Portability Machine independence Simpler compiler design Security……
PORTABILITY - INCH BY INCH
Without VM: Program ↓ Specific CPU Machine Code New CPU வந்தால்: Recompile / Adapt With VM: P……
SECURITY
Virtual machine program மற்றும் hardware இடையே controlled layer ஆக இருக்கலாம். Program ↓ VM ↓ Checks ↓ O……
SANDBOX
Virtual machine applications isolated env……
Untrusted Program ↓ Controlle……
DISADVANTAGES
Virtual computer use செய்வதால் சில disadvantages: Extra execution layer Runtime overhead More memor……
NATIVE EXECUTION VS VIRTUAL MACHINE EXECUTION
Native C++ Source ↓ Native Compiler ↓ Mach……
C++ AND VIRTUAL COMPUTER
Important clarification: Traditional C++ execution: C++ Source ↓ Compiler ↓ Native Object Code ↓ Linker ↓ Exe……
C++ AND VIRTUAL FUNCTIONS ARE DIFFERENT
கவனம்: Virtual Computer மற்றும் Virtual Function completely differe……
virtual void display(); இது v……
MACHINE HIERARCHY
Programming language system-ஐ levels-ஆக பார்க்கலாம்: Level 5 → High-Level Programming Language ↓ Level 4 → Vi……
VIRTUAL COMPUTER AS AN ABSTRACTION
Physical hardware complicated. Programmer physical details: Transistors Registers Bus signals Instruction tim……
ABSTRACTION LAYERS
Application Program ↓ Programming Language ↓ Virtual Ma……
VIRTUAL COMPUTER AND LANGUAGE IMPLEMENTATION
ஒரு programming language implement செய்ய இரண்டு common paths: Direct Compilation ……
HYBRID IMPLEMENTATION
Compilation + interpretation combine செய்தால்: Source ↓ Compiler ↓ Intermediate Code……
FORMAL VIEW
Virtual computer-ஐ mathematical state model-ஆகவும் பார்க்கலாம். Machine state: State = Memory + Registers + S……
STATE TRANSITION EXAMPLE
Virtual instructions: PUSH 5 ……
After PUSH 5: S1: Stack = [5] After PUSH 3: S2: Stack = [5, 3] Af……
Remember this flow: Source Program ↓ Compil……
Confuse செய்ய வேண்டாம்: Virtual Computer ≠ Physical Computer Virtual Computer ≠ Virtual……
VIRTUAL V → Virtual machine I → Intermediate code R → Runtime execution T → Translation U → Uniform platform ……
1. A software-defined abstrac……
Answer: Virtual Machine / Vir……
JVM stands for:
Answer: Java Virtual Machine…
Java compiler produces:
Answer: Bytecode…
Bytecode is executed by:
Answer: JVM…
Virtual machines mainly improve:
Answer: Portability / machine……
P-code is associated with:
Answer: Intermediate portable……
P-code runs on:
Answer: P-machine…
JVM is primarily a:
Answer: Process/language virt……
1. Which mechanism converts in……
Answer: JIT compiler…
1. C++ normally requires JVM?…
Answer: No…
A virtual computer is:…
JVM executes:…
The main purpose of a languag……
Intermediate code improves:…
Which is not native machine c……
JIT means:…
Which is an example of a lang……
A virtual machine based on pu……
Which is the correct order?…
Which statement about traditi……
2 Marks Define Virtual Computer. A virtual computer is an abstract or software-defined machine that prov……
1. Definition 2. Abstract machine concept 3. Intermediate code ……
Virtual Computer ↓ Abstract / Software Machine ↓ Has virtual instructions ↓ Executes intermediate code ↓ Hide……