OS/2 2.0 supports four types of applications: full-screen, window, PM,
and DOS/Windows.
- A full-screen application is any OS/2 application that does not
create a PM message queue, and does not rely on the PM mouse and
keyboard processing for input.
- A window application is a full-screen application that also can
run in a window, or PM session.
- A PM application is any OS/2 application that creates a message
queue. Generally, PM applications create one or more windows to
interact with the user.
- A DOS/Windows application runs in an OS/2 DOS session in the
protected, virtual 8086 mode of the 80386 microprocessor. A
DOS/Windows application can be full-screen or windowed, and it can
be run concurrently with other applications.
OS/2 applications can be further classified as pure 16-bit, mixed
16-bit, pure 32-bit, and mixed 32-bit applications.
- Pure 16-bit applications can be run under the 16-bit and 32-bit
versions of the operating system, but cannot take advantage of the
features of the 32-bit programming environment.
- Mixed 16-bit applications can only be run under the 16-bit version
of the operating system. Like pure 16-bit OS/2 applications, they
do not have access to the 32-bit virtual address space; however,
because they have a 32-bit EXE format, they can take advantage of
demand paging.
- Pure 32-bit applications incorporate the flat memory model and
protection mechanisms that are common on a wide range of computer
industry hardware platforms. They can run only under the 32-bit
version of the operating system.
- Mixed 32-bit applications can run only under the 32-bit version of
the operating system, although they can use 16-bit APIs. These
applications can access the entire 32-bit virtual address space.
OS/2 2.0 provides different entry points for 16-bit and 32-bit
functions, making it possible to mix 16- and 32-bit code within a
single EXE module. It is also possible to call 32-bit functions from
a 16-bit C program, and to call 16-bit APIs from a 32-bit C program.
To support this, two different libraries–OS2286.LIB and OS2386.LIB–
are provided and changes have been made to the include file
architecture and to the compiler (such as adding new keywords to
support calling 16-bit functions).
OS/2 2.0 maintains compatibility with previous versions of the
operating system by supplying an interface between 16-bit and 32-bit
code, called a thunking layer. The purpose of the thunking layer is
to convert code and memory objects from 16-bit to 32-bit and back. A
32-bit thunk binds 32-bit code to 16-bit code. A 16-bit thunk binds
16-bit code to 32-bit code. This makes it possible for 16-bit and
32-bit modules to coexist. Memory is addressable from each model
through a technique called tiling.