OS/2 2.0 Frequently Asked Questions, Programmer's Edition Prerelease version 0.2; May 24, 1992 Compiled by Barry Jaspan, This FAQ is for programming and development-related issues for OS/2 2.0. It is freely distributable. Direct all responses and questions to bjaspan@athena.mit.edu. Mention of a product does not constitute an endorsement. Answers to questions closer to the bottom of the list may rely on information given in prior answers. Customers outside the United States should not necessarily rely on 800 telephone numbers, part numbers, or upgrade policies contained in this list. Many of the answers below refer to anonymous ftp from HOBBES.NMSU.EDU (128.123.35.151). The name 'hobbes' is used as a shorthand to refer to this machine. Release Notes: This FAQ list is finally beginning to take form. However, it is still in the startup phase; many of the questions do not have answers associated with them. PLEASE CONTRIBUTE ANY INFORMATION YOU CAN. Changes: 1.3 2.1 4.1 New questions: 1.10 Questions addressed in this release: (a * indicates that no answer is available; all answers are currently incomplete) 1. Languages, Compilers, Debuggers ---------------------------------------------------------------------- (1.1) What programming languages come with OS/2 2.0? (1.2) What C/C++ development environments are available? (1.3) What are the differences between the two available versions of GNU C? (1.4) How can I view the GNU C texinfo (.texi) files? (1.5) What other programming languages are available for OS/2? (Esp. inexpensive ones.) (1.6) Which of these compilers can be used to generate PM apps? (1.7) What is REXX? How do I write and run a REXX program? (1.8) What debuggers are available for OS/2? (1.9)* Where can I get documentation on the OBJ/LIB/EXE format used by OS/2 2.0? (1.10)* Please summarize this information, and tell me what I need to do OS/2 development. 2. Tools, Toolkits, Accessories ---------------------------------------------------------------------- (2.1) What programming editors are available for OS/2? (2.2) What programming tools/toolkits/accessories are available for OS/2? (2.3) What GNU tools are available and where can I find them? (2.4) Is a socket library available? How can I use it? 3. Programming, Porting ---------------------------------------------------------------------- (3.1)* How can I recompile public domain/shareware source code for OS/2? (3.2)* How can I port my DOS program to OS/2? (3.3)* How can I port my Windows program to OS/2? (3.4)* Is OS/2 suitable for real time programs? (3.5) How do I write an OS/2 device driver? (3.6)* How can I simulate (Unix feature) under OS/2? (a) fork (b) fork/exec (c) select() (d) job control (3.7)* How does programming PM compare to programming X? 4. Documentation, Help ---------------------------------------------------------------------- (4.1) Where can I get information on OS/2 APIs and programming? (4.2) Where can I get sample code? (4.3) Are there any OS/2 programming classes or seminars? (4.4)* What are good reference books for programming in OS/2 and PM? 5. Miscellaneous ---------------------------------------------------------------------- (5.1) What is available for multimedia programming under OS/2? (5.2)* What is available for AI/neural net programming under OS/2? ====================================================================== 1. Languages, Compilers, Debuggers ---------------------------------------------------------------------- (1.1) What programming languages come with OS/2 2.0? The original BASIC and BASICA (for systems with BASIC in ROM), DOS's QBASIC, and OS/2's REXX come with OS/2 2.0. See question #1.7 for information on REXX. (1.2) What C/C++ development environments are available? IBM, Borland, Jensen and Partners Internatioen (JPI), Watcom, Zortech, (1.a subsidiary of Symnatec), and Microway all offer C or C++ compilers. [Information, prices, phone numbers?] IBM: Workset/2, $295(*) or $749(**) Includes C Set/2, PM Debugger, Workframe/2, Toolkit. Microway: C++, $595 Watcom C 9.0: does not include headers/libs JPI: C, C++, $180 Glockenspiel: C++(?) Two flavors of the GNU C compiler are available, both on hobbes. GNU C/C++ 2.1 is in /pub/os2/2.0/gnu/gcc-2.1, and emx/gcc is in /pub/os2/2.0/programming/emx-0.8d. See question #3 for information on the differences between the two. XXX Explain the difference between C Set/2 and the Developer's Toolkit ($199). (*) This price is currently only for the US, until September 15, and only via 1-800-3-IBM-OS2. (**) In Canada, the price is $749 (plus taxes) for Workset/2 and the Technical Library. [Can they be purchased separately?] The offer is good only until July 31 and you must be a licensed user of IBM's 1.2/1.3 Toolkit or one of two other products [which?]. For further information, refer to the IBM Canada announcement dated May 20. (1.3) What are the differences between the two available versions of GNU C? The two versions of GNU C that are available were ported to OS/2 with different goals and philosophies in mind and therefore have different characteristics. However, both systems include a fairly complete C library and can be used to compile useful programs, although their support of Unix-specific semantics differs. Furthermore, both systems are being actively developed and are constantly improving. GNU C/C++ 2.1 (gcc) supports C and C++, and can create PM programs. It produces "native" 32 bit .OBJ files that are linked with OS/2's LINK386.EXE, and can be linked together with .OBJ files produced by IBM C Set/2 and other compatible compilers. The mailing list os2gcc@charon.mit.edu exists for discussion of this port; send mail to os2gcc-request@charon.mit.edu for subscription information. emx/gcc 0.8d, also based on GNU C 2.1, supports only C and can create PM programs. emx's goal is to make porting Unix programs easier by emulating Unix semantics as closely as possible. It produces programs that can run both under OS/2 using EMX.DLL and under DOS using the EMX DOS extender. emx/gcc uses standard Unix development tools like ld and nm, and attempts to support Unix-isms like select(). A version of gdb exists that can debug emx/gcc programs. An emx-related mailing list exists; send mail to LISTSERV@ludd.luth.se with a subject of "help" for subscription information. (Note that this is a *NEW* address for the emx discussion list.) (1.4) How can I view the GNU C texinfo (.texi) files? All utilities needed to compile/view/tex the files are readily available for OS/2. The GNU texinfo package, available on hobbes in pub/os2/all/gnu/gnuinfo.zoo, includes makeinfo.exe for compiling texinfo, info.exe for viewing them, and texinfo.tex and texindex.exe for TeXing them. (1.5) What other programming languages are available for OS/2? (Esp. inexpensive ones.) Virtually all of them: Assembler, COBOL, Pascal, Fortran, Smalltalk, Modula-2, LISP, Forth, Perl, and more. [Vendors, ftp sites, phone numbers, prices?] Pascal: Microway ($595), JPI ($180) Modula-2: JPI ($180), Stonybrook Fortran: Microway ($595), Watcom Cobol: IBM Cobol/2 Smalltalk: Digital Smalltalk/PM V Perl 4.0.10: hobbes LISP: hobbes XScheme: hobbes J: hobbes (1.6) Which of these compilers can be used to generate PM apps? IBM C Set/2 can generate PM apps. Workset/2 includes many sample programs and the complete on-line reference. GNU C/C++ 2.1 can generate PM apps, and includes a sample program that does it. emx/gcc can too, with some limitations (what are they?). The commercial C and C++ compilers can, and all of JPI's can, too. [I do not know whether you need the IBM Toolkit and/or documentation with any of these products.] (1.7) What is REXX? How do I write and run a REXX program? REXX is the IBM SAA (Systems Application Architecture) standard, user-friendly programming language. It is available for IBM mainframes, Unix, the Amiga, DOS (Mansfield's Professional REXX), Windows, and many other platforms. It has been a part of standard OS/2 since Version 1.3. Programs written in REXX that do not use system-specific libraries are fully portable. OS/2 2.0 comes with an online REXX reference, and printed REXX documentation is available (Mike Cowlinshaw's REXX book, IBM's twin guides). The Usenet group comp.lang.rexx discusses REXX programming. (1.8) What debuggers are available for OS/2? IPMD, a PM-based debugger, ships with C Set/2. It is capable of source- and assembly-level debugging multithreaded 16 bit and 32 bit OS/2 applications EMX includes gdb, the GNU debugger. There are also several commercial debuggers on the market: Multiscope, others? [details?] (1.9) Where can I get documentation on the OBJ/LIB/EXE format used by OS/2 2.0? 2. Tools, Toolkits, Accessories ---------------------------------------------------------------------- (2.1) What programming editors are available for OS/2? OS/2 2.0 comes with the Enhanced Editor (EPM). GNU Emacs 18.58 is available. It requires you to have EMX installed on your machine, but it comes with all the EMX files you will need. Emacs is available on hobbes in /pub/os2/2.0/gnu/emacs. (If you want to recompile emacs, you will need the full EMX distribution; see question 1.2.) Several public-domain vi clones are available, including Stevie and levee [others?]. The MKS Toolkit also includes vi. Many other text editors are available: QEDIT, Brief, Epsilon, KEDIT, and more. [Vendors, phone numbers, prices?] (2.2) What programming tools/toolkits/accessories are available for OS/2? The IBM Programmer's Toolkit, included in Workset/2, includes many tools. tsipp: The tinfXX.zoo guide has a lot on this. You might also want to mention the $295 special from IBM. Borland's forthcoming ObjectVision for OS/2 and IBM's Workframe/2 probably deserve mention here. The MKS Toolkit, available from MKS ($349 USD, 800-265-2797 or inquiry@mks.com), has over 160 Unix tools, including Korn shell, tar, vi, awk, grep, tail, cpio, and so forth. It also contains a Lex and Yacc capable of generating C, C++, and Turbo Pascal code. (2.3) What GNU tools are available and where can I find them? OS/2 1.x versions of most of the standard GNU utilties are available on various OS/2 ftp sites, and they will work under OS/2 2.0. Either gcc or emx/gcc should be able to compile 2.0-specific versions of any of them; if you port any, please announce it. EMX also comes with a collection of utilities that are necessary or useful to use it. (2.4) Is a socket library available? How can I use it? IBM's TCP/IP 1.2 ($200, part #02G6968) includes an optional Programmer's Toolkit ($500, part #02G6973). The toolkit presumably provides the necessary header files and libraries to compile TCP/IP programs with IBM C Set/2. [Is this true? I don't know anyone with the toolkit.] You do not need to purchase the Programmer's Toolkit, however. If you have the base package and IBM C Set/2, you can use the TCPIPDLL.DLL directly. A 32 bit socket library interface to do this for you will be available shortly. Hopefully, it will also be possible to call TCP/IP functions from programs generated with gcc. Keep your fingers crossed. 3. Programming, Porting ---------------------------------------------------------------------- (3.1) How can I recompile public domain/shareware source code for OS/2? Most publicly available OS/2 programs come with binaries (since there is currently only one OS/2 architecture). If you are porting source code from another system (for example, Unix), you will first need to acquire a compiler. See section 1 for information on compilers; in particular, note that the GNU C compiler is available. You should realize that many publicly available programs have already been ported to OS/2. Check the many FTP sites carrying OS/2 programs before you reinvent any wheels (the OS/2 User's FAQ contains information on FTP site). (3.2) How can I port my DOS program to OS/2? (3.3) How can I port my Windows program to OS/2? To the first approximation, you don't have to --- OS/2 2.0's DOS support is excellent, and your DOS program will probably just work; similarly, OS/2 2.0 supports Windows 3.0 (and soon 3.1) programs. See the OS/2 User's FAQ for details. [But this doesn't answer the question...] (3.4) Is OS/2 suitable for real time programs? (3.5) How do I write an OS/2 device driver? There's a book called "Writing OS/2 2.0 Device Drivers in C" from Van Nostrand-Reinhold. There's also IBM's flood of printed material. (3.6) How can I simulate (Unix feature) under OS/2? (a) fork (b) fork/exec (c) select (d) job control (3.7) How does programming PM compare to programming X? 4. Documentation, Help ---------------------------------------------------------------------- (4.1) Where can I get information on OS/2 APIs and programming? IBM publishes the following so-called "redbooks" on OS/2 2.0, and you can order them directly from IBM. Volume 1: Control Program: GG24-3730 Technical information on Memory Management, Task Mangement, Support, Installation Considerations, Hardware Considerations, Boot Manager, National Language Considerations, Intel 386 architecture, Channel Architecture and SCSI. Documents config.sys. Volume 2: DOS and Windows Environment, GG24-3731 MVDM,8086 Emulation,MVDM DOS emulation, Device Drivers, Memory Extender Support, Installing and Migrating Applications, Windows Applications, DPMI, Running DOS apps,DOS settings, VMB. Volume 3: PM and Workplace Shell GG24-3732 Not Available yet Volume 4: Application Development GG24-3774 Technical programming info (includes list in C) Overview, Object-Oriented Apps, PM application model, flat memory model, building PM app, Workplace AOAShell and System Object Model, Direct Manipulation (Drag/drop), PM resources, Multitasking Considerations, SAA CUA considerations, App Migration, Mixing 16 and 32 bit application modules, compiling and link editing (SOM), Adding Online Help, Problem Determination, Managing Development, Naming conventions. Volume 5: Print Subsystem, GG24-3775 Not Available yet. You can order any of these publications from: United States: (213) 621-6710 Canada: (800) 465-1234 The IBM Programmer's Toolkit, included in Workset/2, includes a complete on-line syscall reference. Printed information is available fromd either IBM (800-426-7282) or Van Nostrand-Reinhold (get the 800 number of the OS/2 User's FAQ). You can also ask questions on comp.os.os2.programmer. (4.2) Where can I get sample code? There is a lot of sample code included in the IBM Toolkit, and 4 sample programs (with source) included with C Set/2. GNU C/C++, from hobbes, includes a sample C, C++, and C++ PM program. (4.3) Are there any OS/2 programming classes or seminars? Yes. Call IBM at either 1-800-3-IBM-OS2 in U.S. (or the PS/2 Help Center). Local IBM branches frequently hold OS/2 classes and seminars. I haven't seen third party efforts in this regard, but I know they exist. (4.4) What are good reference books for programming in OS/2 and PM? 5. Miscellaneous ---------------------------------------------------------------------- (5.1) What is available for multimedia programming under OS/2? OS/2 2.0 Multimedia package is forthcoming -- due any day now. We'll know more soon. (5.2) What is available for AI/neural net programming under OS/2?