twoOStwo virtual machine NetSys GmbH. Product and technology
Presentation plan Virtual Machine technology overview twoOStwo solution twoOStwo technology details OS/2 specific optimizations
Virtual Machine technology overview What is the Virtual Machine? Who needs it and what for? 3 ways to design Virtual Machine Strategy N1: API emulation Strategy N2: pure emulation Strategy N3: quasi-emulation
What is the Virtual Machine? Virtual machine Real PC Virtual machine... Host operating system Guest operating system
Legacy software users for migration Who needs it and what for? Developers for distributed systems development and testing Students in computer training centers Sales people for sales activities and demonstration IT people for systems support optimization
3 ways to design Virtual Machine Pure emulation OS independent and reliable, but very slow API emulation Fast, but OS dependent and not reliable Quasi-emulation Fast, reliable and OS independent
Strategy N1: API emulation Devices Guest OS application Call API 1 Call API 2... Call API N... Guest OS API emulator Host OS API Host OS
Strategy N2: pure emulation Devices Emulator Guest OS Instruction 1 Instruction 2... Instruction N... Emulated PC Host OS API Host OS
Strategy N3: quasi-emulation Devices Exceptionhandler Guest OS Instruction 1 Instruction 2... Instruction N... Emulated PC Host OS API Host OS
twoOStwo solution What is the 2os2 product? Quasi-emulation VM technology Processor emulation Devices emulation Networking emulation
What is the 2os2 product? Quasi-emulation VM technology based solution OS/2 v3, OS/2 v4 (FixPack 12, 15), OS/2 v4.5 runs under WinNT/2000 Strongly OS/2 focused solution IDE HDD, CD-ROM, COM, LPT, DESKO-keyboard support VESA 2.0 SVGA support Full networking support Very fast and reliable Open for any non-standart devices integration
Quasi-emulation VM technology Monitor Guest OS Host OS Application API call OS API Guest OS code... Exception Native execution Emulation section Real hardware
Processor emulation CPU Segment model GDT LDT IDT Interrupts exeption IRQ int n Paging model PDE PTE Command system Instruction emulation Protection & privelege Ring 0Ring 3
Devices emulation Emulation schema Guest OS code Host OS API Passthrough schema Guest OS code Redirect module... Real devices Real Devices Emulation devices
Networking emulation Filter Internal buffer Special driver Real network card Virtual network card VM Protocols PC
twoOStwo technology details General system architecture Multy-VM architecture Multy-thread architecture Code-under-control technique Code-scanning technique Breakpoints types Host/guest OSes layout GDT/LDT/IDT emulation Multitasking support Paging emulation
General system architecture Driver interface NT device driver VM monitor Interrupt redirection Exception emulation x86 emulation NT binary resource VGA emulation... Other devices emulation VM interface NT application ioctl() User interface IOHooks NT DLL
Multy-VM architecture Driver Host OS Guest OS Monitor Application Monitor Application Monitor Application
Multy-thread architecture MFC SDI application GUI thread VGA emulation DriverMonitor Hooks VGA thread VM thread
Code-under-control technique Exception handler Ring 0 Ring 3 Ring 1 Ring 2 Host OS kernel Guest OS general instruction priviledge instruction Application of emulation «bad» instruction
Scanning technique Code scanner Guest code … «bad» instruction 1 … «bad» instruction N … branch(call)... Interrupt handler Emulator scanning
Breakpoints types Software breakpoints Hardware breakpoints xor ax,ax smsw push ax xor ax,ax int 3 dw ? push ax xor ax,ax smsw push ax DR0 = ADDR (smsw) DR1 DR2 DR3
Host/guest OSes layout DriverMonitor Host OS (Ring 0) Guest OS (Ring 0) Host OS (Ring 3) Guest OS (Ring 3) Application Guest OS kernel Guest OS applications Host OS kernel
GDT/LDT/IDT emulation Host OS context Monitor context GDT LDT IDT GDT LDT IDT Guest OS context GDT LDT IDT Save context lgdt,lldt,lidt emulation
Multitasking support Host OS context Monitor context Monitor Guest OS context Task 1 Task N Emulator... Task manager Task 1 Task N... Task manager
Paging emulation Host OS context Monitor and guest OS context page transformation Page catalogue CROSS PAGE Page catalogue CROSS PAGE Page manager Page manager
OS/2 specific optimizations Native kernel calls technique Emulated kernel calls technique
... call sys1 … call sys1... Native kernel calls technique... instr1 … instrN emulated ret Guest code sys1 Context saving Exception analyzing Instruction decoding Instruction emulating Async events check Timer adjusting Code pointer calculating Context restoring Exception handler... call sys1_fast … call sys1_fast... instr1 … instrN native ret Guest code sys1_fast
... call sys1 … call sys1... Emulated kernel calls technique... emulated instr1 … emulated instrN emulated ret Guest code sys1 Context saving Exception analyzing Instruction decoding Instruction emulating Async events check Timer adjusting Code pointer calculating Context restoring Exception handler... call sys1_fast … call sys1_fast... set of instr1 … set of instrN native ret Guest code sys1_fast