斗 长 Multiple os Personalities ¥斗 ★★ o Environment subsystems provide exposed documented interface betweenapplicationand windowsnative AP o Each subsystemdefinesa different set of APIs and semantics o Subsystemsimplement these by invokingnative APs o Example. Windows Createfile in Keme 32 d calls native ntCreateFile
21 Multiple OS Personalities Environment subsystems provide exposed, documented interface between application and Windows native API Each subsystem defines a different set of APIs and semantics Subsystems implement these by invoking native APIs Example: – Windows CreateFile in Kernel32.Dll calls native NtCreateFile
斗 长 Multiple os Personalities ¥斗 ★★ .. exes and dllsyou write are assodated with a subsystem Speafiedby LinK/SUBSYSTEMoption Cannot mix callsbetween subsystems
22 Multiple OS Personalities .exes and .dlls you write are associated with a subsystem – Specified by LINK /SUBSYSTEM option – Cannot mix calls between subsystems
斗 长 Environment Subsystems ¥斗 ★★ o 3 environment subsystemsoriginally providedwithNT o Windaws-WindowsAPl (originally 32-bit, nowalso 64-bit 9 OS/2-l.x dharacter-modeapplicationsonly Removed in Windas 2000 o Posix-only Posix 1003.1 bare minimumUnix services-no networking windowing threads Removed in XP/Server 2003-enhanced version shipswith Services For Unix 3.0 23
23 Environment Subsystems 3 environment subsystems originally provided with NT: Windows –Windows API – (originally 32-bit, now also 64-bit) OS/2 - 1.x character-mode applications only – Removed in Windows 2000 Posix - only Posix 1003.1 – bare minimum Unix services -no networking, windowing, threads – Removed in XP/Server 2003 – enhanced version ships with Services For Unix 3.0
斗 长 Environment Subsystems ¥斗 ★★ o Of the three, Windowsprovidesaacess to the majority of NT native functions o Of the three, windows is required to be running System crashesif Windows subsystem process exits POSiX and os/2 subsystems are actually Windowsapplications POSi &os/2 start on demand (first timean apps run) v Stay runninguntil systemshutdown
24 Environment Subsystems Of the three, Windows provides access to the majority of NT native functions Of the three, Windows is required to be running – System crashes if Windows subsystem process exits – POSIX and OS/2 subsystems are actually Windows applications – POSIX & OS/2 start on demand (first time an app is run) ✓ Stay running until system shutdown
斗 长 App calls Subsystem ¥斗 ★★ o Function is entirely implemented in user mode Nomessage sent to environment subsystemprocess No Win NT exective systemservice called Examples: PtinRecto, IsRectEmptyo o Function requires one/ more callsto nT exective Examples. Windows ReadFileo/riteFileo implemented using yo systemservices NtReadFileo/NtWriteFileO
25 App calls Subsystem Function is entirely implemented in user mode – No message sent to environment subsystem process – No Win NT executive system service called – Examples: PtInRect(), IsRectEmpty() Function requires one/more calls to NT executive – Examples: Windows ReadFile()/WriteFile() implemented using I/O system services NtReadFile()/NtWriteFile()