Skip to content

What's here

  • include/os21x/: the 16-bit OS/2 1.x API (os2.h): types, the Dos calls, Vio, Kbd and Mou, the error codes, and the OS/2 1.x Presentation Manager: windows, messages, frames, menus, dialogs, the controls, the clipboard and pointers (pmwin.h), presentation spaces, fonts and bitmaps (pmgpi.h), and the switch list and profiles (pmshl.h). Every function is __far __pascal with far pointers, as in the IBM and Microsoft toolkits. A 1.x message is a USHORT and its coordinates are SHORT, and the structures are the 1.x ones (QMSG is 26 bytes, bitmaps use BITMAPINFOHEADER), which tests/headers.c checks.
  • include/os2v2/: the 32-bit API (os2.h): the Dos calls (files and extended attributes, large files, memory, threads, semaphores and timers, queues, named pipes, sessions, exception handlers, modules and resources, national language support, messages, file systems and device IOCTLs), the error codes, and the Presentation Manager: windows and messages, frames, menus, dialogs, accelerators, the standard controls (buttons, entry fields, list boxes, combo boxes, scroll bars, MLEs, spin buttons), the clipboard, pointers and cursors (pmwin.h); presentation spaces, colors, lines, areas, paths, fonts and bitmaps (pmgpi.h); the window list and profiles (pmshl.h); and the file dialog (pmstddlg.h). APIENTRY is the C convention, which is what OS/2's _System is. The video, keyboard and mouse calls (Vio, Kbd, Mou), which are 16-bit on every OS/2, are in bsesub.h (see below).
  • lib/call16.c: the thunk from 32-bit code into the 16-bit API, built into libos2.a with a 16-bit stub for each call of bsesub.h.
  • lib/os2-16.lnk, lib/os2-32.lnk: import directives for every entry point of the OS/2 system DLLs (DOSCALLS, VIOCALLS, KBDCALLS, MOUCALLS, MSG, NLS, PMWIN, PMGPI and the rest). The driver gives them to the linker, which keeps only the imports a program uses. They were made by tools/gen-imports.py from the DLL export lists in Open Watcom's bld/os2api/lib286 and lib386 (the names and ordinals only).
  • tools/: gen-imports.py (above), check-headers.py, which checks that every function the headers declare has an import, and check-syntax.sh, which compiles tests/headers.c against both sets of headers and checks the sizes of the structures. CI runs both. os2rc.py is a resource compiler (see below). gen-bsesub.py writes bsesub.h and the 16-bit stubs. os2-imports.py lists the exports of a 16 or 32-bit DLL as import directives, for linking the programs that use it.
  • build-sysroot.sh: builds picolibc with its OS/2 layer, the compiler-rt builtins, and installs the headers and import lists: build-sysroot.sh 32 i386-os2 makes the 32-bit sysroot, and build-sysroot.sh 16 i8086-msdos adds the 16-bit libraries to the DOS sysroot, in lib/os2/<model> (and lib/os2/<model>/dll, below).
  • build-libcxx.sh: builds libc++ and libc++abi for 32-bit OS/2, with exceptions, RTTI and threads, into the i386-os2 sysroot, and the unwinder runtime/unwind-sjlj.c as libunwind.a.
  • examples/: hello.c, sysinfo.c and the PM window pmhello.c (all 16 and 32-bit), and the 32-bit PM program pmnotes.c (a menu, accelerators, dialogs and strings, from pmnotes.rc).