en:docs:fapi

This is part of Family API which allow to create dual-os version of program runs under OS/2 and DOS

Note: This is legacy API call. It is recommended to use 32-bit equivalent

2021/09/17 04:47 · prokushev · 0 Comments
2021/08/20 03:18 · prokushev · 0 Comments

Family API

Family API (FAPI) is a subset of Control Program API which can be used to write binary portable applications. Such applications can be run as on OS/2 as on DOS system without any modifications.

It is known 3 versions of original Family API 1.00, 1.10 and Mapper from MS-DOS 4.0.

Also exists side Family API implementation:

Versions up to 1.10 is a original OS/2 Family API. 1.20 and higher is a osFree extensions.

Dual OS applications

It is possible to write programs which will run on OS/2, DOS and Windows NT from one binary. Moreover, same source code can be used without any #ifdef and other preprocessor statements. Such portability achieved via Family API. Family API is OS/2 API emulation layer on top of DOS. OS/2 executable file is in NE (New Executable) file format. NE file consist of two parts:

  1. Legacy DOS MZ EXE format part;
  2. NE EXE part.

Using Family API MZ part of file used to provide loading and dynamic linking mechanism to load and link NE. Also Family API file contains emulation library which translates OS/2 API calls to DOS interrupt calls. So, same file can be executed as in OS/2 as in DOS. Windows NT contains OS2 Subsystem (os2ss.exe) which provides OS/2 API layer on top of Windows NT kernel. So, Family API allows to support 3 OSes using one binary file.

For current time only 16-bit Family API supported.

Writing portable tools

Documentation

Compatibility

Feature DOS 16-bit Real Mode DOS 16-bit Protected Mode 1) OS/2 16-bit Protected Mode
Max memory 640KB 16MB 2) 16MB
Virtual memory No No 1Gb
Multitasking No No Yes
Multithreading No No Yes
Long filenames Yes 3) Yes 4) Yes 5)
Extended attributes Yes 6) Yes 7) Yes 8)
App EXE name change Yes 9) Yes 10) Yes

Remarks

For implementation details refer to Implementation details section.

Notes

1)
Requires DPMI host with 16-bit client support
2)
Actually depends on DPMI host and current CPU
3) , 4)
Supported since version 1.20 Requires LFN driver under DOS or run in Windows 9x VDM.
5) , 8)
Starting from OS/2 1.??
6) , 7)
Under OS/2 BOX only
9) , 10)
Under DOS 3 and higher