CSE775 - Distributed Objects

Comparison of Windows and Linux

Web Resources:

Linux Tutorials eclipse Code Project SysInternals Best SysInternals Tools Dr. Dobb's Journal Windows Forms COM at MSDN IDL Language base MIDL types OLE data types IDL attributes MIDL data types MIDL Language Reference

Content:

Process Structure, Memory-Mapped Files, Windows to Linux Roadmap - IBM

WindowsLinux
Features
Same as Linux (to the right) plus creation and management of windows through API calls. Multitasking, virtual memory, memory management, shared libraries, demand loading, shared copy-on-write executables, multistack networking including IPv4 and IPv6. See www.kernel.org
Components
Windows Architecture - Wikipedia, Windows Components - Technet, Conceptual Architecture - Wikibooks Linux Architecture - techtinker, Linux kernel map - makelinus, Conceptual Architecture - UWaterloo
Application Programming Interfaces
API - MSDN, C++ standard library - Wikipedia, C and C++ standard library reference - cplusplus, C standard library - Wikipedia Linux Documentation - includes system and library calls, also part of kubuntu help.

Perhaps the easiest way to find needed API calls is to use man -k keyword or apropos keyword and filter the results using grep, e.g., man -k file | grep "(2)" | grep "^f".

Shell
cmd - a text-based shell with simple scripting (batch) model
Visual Studio cmd - basic cmd with paths defined for the Visual Studio tools.
PowerShell - an object-based shell with powerful scripting language.
bash - a powerful text-based shell with composition tools, e.g., sequencing, pipes, composition, and alternation. bash reference
Unique Features
  1. Windows uses Unicode (UTF-16) throughout its core and API. Unicode affects API, e.g., GetLongPathNameA and GetLongPathNameW:
    try PowerShell -command get-childitem .\winbase.h | select-string -pattern 'W$|A$'
    in \"c:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/include\".

    Unicode Effects, Regular Exrpessions Reference

  2. Kernel Objects: Named kernel objects can be shared across processes. Kernel objects have signalled state: see Wait Functions.
  3. Windows Registry is a key:value pair based database used by Windows for configuring the system and its applications.
  4. GUI windows are created and managed by the kernel. That's where the "Windows" name came from.
    Native GUI Programming examples here and here.
    Frameworks like WinForms and the older Microsoft Foundations Classes (MFC_) simply wrap that functionality.
    Even the newest Windows Presentation Framework wraps its functionality in an outter classic window.
  5. Windows messaging provides communication between windows (and window-less message queues) within and between processes. Unlike Linux, windows messages are simply integers that define a type, but the message information must come from another source. Usually through WPARAM and LPARAM inputs to PostMessage and SendMessage API calls in the same process, or using the clipboard (shared memory), perhaps through WM_COPYDATA.
  6. FIFOs, often referred to as Named Pipes are one-way communication channels that can be shared within and between processes. Unlike Linux, they are based on socket-like channels and Read and Write bytes.
  7. Structured Exceptions are notifications that result from either hardware or software events. Structured Exceptions usually are initiated by Windows, but may also be thrown by user code.

    By default, Structured Exceptions are not caught by C++ exception handlers. However, a project compile property can enable catching with C++ exception handling.

  1. Linux is free and comes in many distributions, e.g., ubuntu, kubuntu, knoppix, ...
  2. Linux distributions use package managers, e.g., Advanced Packaging Tool (APT), synaptic, ... to support easy updating and aquiring new open-source tools.
  3. Linux configuration data is kept in files, most in /etc but some in application specific folders.
  4. GUI windows are not created or managed by the kernel. They are provided by Window Applications/Frameworks that sit on top of an XWindow server, all of which are simply tools use the Linux API.
    Xlib context
  5. Posix Message Queues send text messages within and between processes.
  6. FIFOs, often referred to as Named Pipes are one-way communication channels that can be shared within and between processes. Unlike Windows, they are based on files.
  7. Signals are a notification process usually sent by the kernel, but may also be sent by a user program. Signals have the dispositions: Term - terminate the receiving process, Ign - ignore the signal, Stop - stop the recieving process, Cont - continue the process if it is currently stopped, Core - terminate with core dump.

    A process can change signal disposition by using sigaction to bind to a signal handler or set to ignore or take the default action. Signals can also be registered with the C++ infrastructure when using g++ to enable catching as C++ exceptions.