-
Notifications
You must be signed in to change notification settings - Fork 77
Version | Compilers | Status | Tests |
---|---|---|---|
4.52 (Warp) | GCC 4.7.3 | Compiled | 27/28 |
OS/2 is a proprietary operating system developed by Microsoft and IBM, first released in 1987. Originally it was intended as a protected mode successor of PC DOS. First versions were 16-bit, but later IBM released 32-bit versions starting from 1992. It also has compatibility with DOS and Windows 3.x applications. OS/2 has its own graphical system called Presentation Manager. It has being sold under the name of eComStation since IBM discontinued its support. Also Arca Noae is going to present its own version of OS/2 with lot of improvements under the name of Blue Lion.
Latest official release is 4.52, though eComStation should be also fully compatible. OS/2 can be easily installed on a virtual machine, but you should keep in mind several things:
- Use IDE hard drives and CD-ROM for better compatibility.
- It may have installation problems on HDD with a size greater than 2-3 GB, so try to reduce it in case of any problems.
- Just use floppy images supplied with installation box (usually 3 of them) to launch the installation process.
- During the setup it may hang up on LAN configuration. You can reboot it and launch the LAN installation manually from the programs menu.
To simplify software installation you can use Arca Noae's package manager which provides lot of open-source software out of the box. Just follow the instructions.
To build the library (as well as most of other available software) you need a UNIX-like environment, including bash
shell, make
utility and others. The best and easiest way to get them is to use the above mentioned package manager. Here is a list of packages you need first:
- bash
- gcc
- kbuild-make
- libc-devel
- os2tk45
Use Paul Smedley's ports to get the latest versions of CMake and GCC. A great source of software for OS/2 was Hobbes archive (discontinued). Please note, that CMake is not capable to run compiled tests, so use library's own script.
Note: OS/2 lacks support for process-wide names semaphores, thus they are not available across it. Also memory mapping commits all the pages at the moment of allocation.
os2tk5
packages comes with good documentation of API available in the system in the form of .INF files, which can be viewed with VIEW.EXE
utility.
There are two ways of using GCC:
- EMX environment with old GCC 2.x.
- kLIBC runtime library which provides POSIX compatibility layer, and GCC (including the latest 6.x versions) on top of it.
The first one is outdated, but some parts of it are still used for development. The best option is the kLIBC runtime library which makes porting also easier.
After installing GCC from any source, you need to be sure that it is configured correctly. To do that, add several environment variables in C:\CONFIG.SYS
file (restart is required after changing it):
- Add path to your compiler binary to the
PATH
variable, i.e.c:/usr/local473/bin
. - Add GCC prefix path to the
PATH
variable, i.e.c:/usr/local473/libexec/gcc/i386-pc-os2-emx/4.7.3
. - Set
MAKESHELL
toc:\usr\bin\bash.exe
(or where it is).
GCC on OS/2 can generate object files in two different object formats (controlled by -Zomf
flag when compiling): a.out and OMF. a.out can be converted to OMF using emxomf.exe
tool, but not vice versa. OS/2 executes OMF binaries. One of the drawbacks of the a.out format is that there are no debuggers to understand its debug symbols (except ancient port of gdb
for EMX). After compiling binary objects one of the two main linkers is invoked (controlled by -Zomf
flag when linking): GNU ld
(comes from binutils
) or emxomfld.exe
. The former only supports a.out format, the latter supports only OMF format (but can make automatic conversion from the a.out
format). emxomfld.exe
also uses one of the third-party linkers (i.e. Watcom, IBM), which you need to define.
For example, to use Watcom linker, define the following environment variables:
- Set
EMXOMFLD_TYPE
toWLINK
. - Set
EMXOMFLD_LINKER
towl.exe
(should be in yourPATH
).
If you are going to use Watcom linker with GCC, also install additional packages:
- gcc-wlink
- watcom-wlink-hll
Description of other linkers are available here. But be noted, that CMake uses GCC with OMF object type for compiled binaries.
To run CMake correctly, you need to specify full paths to compilers, as well as paths to kLIBC headers and libraries: -DCMAKE_C_COMPILER=/usr/local473/bin/gcc.exe -DCMAKE_CXX_COMPILER=/usr/local473/bin/g++.exe -DCMAKE_C_FLAGS="-I/usr/include -L/usr/lib" -DCMAKE_CXX_FLAGS="-I/usr/include -L/usr/lib"
.
To run tests, use a separate script from the scripts
directory as CMake is not able to run compiled tests (due to internal errors).
You need at least OS/2 Warp version which has TLS support.
- EDM2 is one of the best source of information for OS/2.
- Installation guide for VirtualBox
- FixPacks information
- GCC options specific for OS/2
- make options on OS/2
- Utilities and some other software for OS/2
- Memory management specifics
- IBM OS/2 Developer's Toolkit 4.5