Tom Prodehl is a senior technical analyst with Covia Partnership where he works on large scale data distribution. He has programmed in C for six years and worked with OS/2 since its earliest days. You may reach Tom at Covia, Dept. DENND, 5350 South Valentra Way, Englwood, CO 80111.
The Programmer's Essential OS/2 Handbook by David Cortesi is one of several books bringing OS/2 development to programmers' attention. The book differs from many other OS/2 books because the author is not a member of the IBM or Microsoft development team. Cortesi provides an unbiased view of OS/2 capabilities.
The first edition documents OS/2 v1.0, and covers neither the Presentation Manager nor the kernel additions made for v1.1, so you will need another reference for these areas. Cortesi's writing style is straightforward and informal. In fact, this book is one of the more readable reference books I have come across.
The book is divided into two major sections. The first section is 460 pages organized as 16 chapters. The first chapter provides the OS/2 interpretation of common computer science concepts such as processes, semaphores and I/O. It provides a level setting for later in-depth discussions. Chapter two explains the 286 architecture in detail. For example, the book explains why address calculations cannot perform segment arithmetic as done in the DOS environment.
Understanding linking is essential for any OS/2 programmer. Chapter three clearly explains linking, both in general and in particular to OS/2. Chapter four covers the loading and initialization procedure for programs and dynamic link libraries. Chapter five describes how to obtain system information and country dependent information. Chapter six explains process creation and control. It does not describe the debugger system call DosPTrace. Chapter seven details memory allocation for all three types of allocation and discusses named and anonymous memory sharing. Chapter seven also includes both file I/O and file system management. Chapter eight describes threads and how to manage their interaction with interprocess (and interthread) communication constructs such as semaphores, critical sections, and queues. (Pipes are covered in process creation and management in chapter six.)
Chapter nine includes a detailed design study of multi-threaded programming, which should benefit programmers unclear on threads or interprocess communication. Chapters 10, 11, and 12 concentrate on the high-performance interface to the video, keyboard, and mouse respectively. These interfaces provide faster-than-BIOS level access to the underlying hardware. Chapter 13 covers device drivers, but the discussion is brief. In chapter 14 Cortesi provides useful information on accessing the serial port, but he tends to wander off when describing RS-232. Chapter 15 contains a five-page summary of whole disk operations that can be used to treat your drive as a single large file. Chapter 16 touches on device monitors that let a program tap into a device's stream.
These sections introduce the functions for the area and explain how the functions interrelate. The emphasis is not on the parameters of the functions, but on what they perform. Information necessary to operate the functions is included along with a discussion of the structures used. Cortesi is brief when discussing topics he thinks the average programmer will not be interested in. This brevity is probably a good idea with device drivers, but in other areas, such as device monitors, Cortesi may have been too brief. On the meatier subjects of process management, thread management and programming, the file system, and high performance interfaces, Cortesi is thorough and credible.
The second part of the book is a list of most (but not all) functions in OS/2 1.0. Fast safe RAM semaphore functions and session management functions are missing from the book, but the rest are included in alphabetical order. Each function lists parameters, actions, errors, and related functions but also refers the reader to the first section where more information is available. This reference aids the novice programmer by offering more detailed explanations while still giving advanced programmers access to the simple facts without the unnecessary explanations.
The book comes with samples of code to illustrate the text. A disk is available with these samples. The disk also contains a header file that declares the structures used in system calls and $defines for many values. This header file is not compatible with the similar header files provided by Microsoft or Lattice C compilers, which is good if you wish to migrate between one C compiler for OS/2 to another. The samples and header files are also provided in Pascal for those more comfortable with records than structs. The header files are listed in the book's appendices so you don't need the disk to understand the examples.
I highly recommended this book for your OS/2 library. It contains the practical set of OS/2 system calls, a thorough exposition of the development environment and a wealth of practical information.
Programmer's Essential OS/2 Handbook
David Cortesi
M & T Books, 1988
$24.95, 709 pages
($39.95 with disk)
ISBN 0-934375-89-5