Open Watcom v2 Documentation

repository·master·Indexed 22 days ago

https://github.com/open-watcom/open-watcom-v2

A fork of the Open Watcom compiler suite providing C, C++, and FORTRAN development tools for DOS, Windows, and OS/2. This documentation covers the source tree layout, build processes, and specific library implementations, including a modern C++ standard-conformant IOStreams library using the 'stream' namespace and standard thread libraries (POSIX, C++ 2011 std::thread, and C 2011 threads.h).

Tokens
84.9K
Snippets
175
Records
375
Agent score
77%

What's inside Open Watcom v2

  1. Overview of the stripped-down ncurses component

    master

    The bld/ncurses directory contains a specialized, stripped-down version of ncurses. It is not a full terminal emulation library; instead, it only includes the components necessary to compile the Linux versions of Watcom VI and WD. Specifically, it contains the terminfo parts required for these tools.

    While the code is derived from ncurses-5.3, it is not licensed under the GPL. It uses an MIT-style license compatible with the Open Watcom license.

  2. Overview of the WDM Driver Sample

    master

    The miniwdm directory contains a sample Windows Driver Model (WDM) driver designed to work with a system PCI device within a VirtualBox virtual machine.

    Key characteristics:

    • Functionality: The driver does not implement device-specific logic; its primary purpose is to claim a PCI device and insert itself into the WDM driver stack.
    • IOCTL Support: It supports one custom IOCTL (Input/Output Control) code that returns the PCI IDs of the claimed device.
    • Usage Example: A sample application is provided in the app directory to demonstrate how to use the custom IOCTL to retrieve device information.
  3. Overview of the WHPCVT Help Conversion Process

    master

    WHPCVT is a program used to convert GML (GNU Markup Language) documentation source into OS-dependent online help files. The process follows three main steps:

    1. Modify GML Source: Adjust your GML documentation to include online help-specific information (like hyperlinks, popups, or images).
    2. Format with WHP Layouts: Use WHP (Watcom Help Project) layouts and macros to format the GML book into a system-independent .WHP file.
    3. Convert to OS-Dependent Help: Convert the .WHP file into specific formats such as Windows RTF, OS/2 IPF, or InfoBench IB help.

    The .WHP format is designed to be OS-independent and easy for GML to generate, though it is not necessarily easy for humans to read directly.

  4. Overview of DOS/32 Advanced DOS Extender

    master

    DOS/32 Advanced DOS Extender is a high-performance, 32-bit flat protected mode environment designed for DOS Extended applications. It serves as a 'Plug&Play' replacement for DOS/4GW, specifically optimized for WATCOM C/C++ and FORTRAN 77 compilers.

    Key features include:

    • High Compatibility: Emulates DOS/4GW, DOS/4GW Professional, and other compatible extenders, allowing use in existing protected mode programs without code modification.
    • Performance: Optimized for fast mode translating (Protected to Real and Real to Protected mode switching).
    • Configurability: Supports hundreds of configurations via environment variables or an external setup program to adjust allocated selectors, callbacks, virtual stacks, DOS transfer buffer size, and more.
    • Developer Tools: Includes Null-Pointer Protection, Extended Memory Blocks Checking, and a built-in Debug Mode to assist in creating error-free 32-bit applications.
  5. Overview of ZLib.Ada

    master

    ZLib.Ada is a thick binding interface for the ZLib data compression library. It provides Ada-style access to the ZLib C library functions.

    Key features and recent updates include:

    • Packages: ZLib and ZLib.Streams.
    • New Routines: Is_Open routines added to both packages.
    • Error Handling: Includes a Status_Error exception.
    • Compatibility Note: The ZLib.Read generic routine now requires initialization for the Read_Last parameter. This allows for the use of new parameters Allow_Read_Some and Flush.
  6. Overview of Open Watcom thread libraries

    master

    The Open Watcom threads project aims to provide standard thread libraries for the Open Watcom toolchain. It is currently developed independently of the main Open Watcom codebase and is intended to be merged into the main distribution once it reaches maturity.

    The project focuses on three primary standard thread libraries:

    1. POSIX threads (pthreads)
    2. C++ 2011 std::thread
    3. C 2011 threads.h

    Note that due to resource constraints, only a subset of these libraries may be available or fully implemented for specific target platforms at any given time.

  7. Overview of the Windows NT Video Miniport Programming Example

    master

    This sample implements a Windows NT video miniport designed for virtual SVGA chips, specifically targeting the VirtualBox hypervisor. It may also function with Bochs or QEMU, though testing for those is not guaranteed.

    The implementation is divided into two functional components:

    1. boxv module (boxv*): A collection of routines used to set modes on the virtual SVGA chip.
    2. miniport module (videomp*): The core implementation of the Windows NT video miniport interface.

    Note that this miniport provides only minimal mode setting and palette access. It does not support hardware cursors; all drawing operations are delegated to framebuf.dll (the default Windows NT framebuffer display driver).

  8. Use the DOS trace utility

    master

    The trace utility is a tool designed to trace DOS system calls, modeled after the UNIX trace/strace tools. It allows developers to monitor INT 21h subfunctions during program execution.

    Key Features & Behavior:

    • Crash Resilience: The tool writes output to a file directly from the interrupt handler. This ensures that trace data is written to disk even if the traced application crashes and renders the system unusable.
    • Tracing DOS Extenders: While it does not trace protected mode activities, it can trace DOS extended applications because DOS extenders must call DOS in real mode. You may need to use the -e switch to trace across EXEC calls.
    • Limitations: If the DOS Critical Flag (InDOS) is set, no logging can be performed.

    Usage Documentation: Detailed usage instructions are located in the trace.man file.

  9. Use DotZLib for ZLib operations in .NET

    master

    DotZLib provides a .NET wrapper for ZLib1.dll with the following capabilities:

    • Memory Buffers: Support for inflating and deflating memory buffers.
    • Streaming: .NET streaming wrappers for the gz streams part of zlib.
    • Checksums: Wrappers for the checksum components of zlib.

    For implementation details and specific usage patterns, refer to the DotZLib/UnitTests.cs file, which contains examples of how to call the library.

  10. Use the zlibpas Pascal interface

    master

    The zlibpas unit provides a Pascal (Delphi, Kylix) interface to the zlib data compression library. It is designed to provide access to the full-fledged zlib functionality, including features like checksums that may be missing from standard Borland ZLib class wrappers.

    Key Technical Details

    • Type Mapping: C and zlib types (e.g., int, uInt, long, uLong) are translated directly into Pascal types of similar sizes (e.g., Integer, LongInt) to avoid namespace pollution. Note that unsigned integers are not converted to Pascal unsigned integers.
    • Calling Convention: The interface uses the cdecl keyword. This means it is not compatible with old Turbo Pascal. For DOS and Windows16, it assumes __pascal; for Windows32, it assumes __fastcall (except for callbacks).
    • Limitations: The gz* function interfaces are not translated to avoid C runtime library interfacing problems and because functions like gzprintf cannot be directly translated into Pascal.
  11. Understand TinyXML printing modes

    master

    TinyXML offers three primary ways to output XML:

    1. Print( FILE* ) and SaveFile(): Uses C-style FILE* streams. This produces "pretty printed" (human-readable) output with whitespace. It is fast and has low memory overhead.
    2. operator<<: Uses C++ std::ostream. This produces "network printing" mode, which is condensed (no line breaks) and intended for machine-to-machine transmission.
    3. TiXmlPrinter: A class used to output to a std::string or memory buffer. This is a more specialized API for refined printing control.
  12. Use ZLIB with ILE RPG

    master

    For ILE RPG programmers, ZLIB provides an interface via an RPGLE member.

    • The /copy member defining the ZLIB API prototypes can be found in ZLIB/H(ZLIB.INC).
    • Refer to the comments within ZLIB/H(ZLIB.INC) for detailed usage information.

    Important Notes:

    • Encoding: This implementation does not handle conversion between ASCII and EBCDIC. Text data code conversions must be performed explicitly.
    • File Access: Always open zipped files in binary mode.