home *** CD-ROM | disk | FTP | other *** search
-
- ΓòÉΓòÉΓòÉ 1. And the Readers Say . . . . ΓòÉΓòÉΓòÉ
-
- OS/2 2.1 Unleashed should be read cover to cover. I highly recommend this book
- to OS/2 users of all experience levels, from beginner to advanced.
-
- -John Hoffman, NBC
-
- As an experienced user of OS/2 and PCs in general, it's my opinion that users
- new to OS/2 will not be left confused by nor will advanced users be left
- disappointed by OS/2 2.1 Unleashed. Recommended without reservation. And I
- can't wait to get hold of the second edition!
-
- -Bob Weeks
-
- OS/2 2.1 Unleashed is by far and away the best and most complete authority on
- OS/2 2.1. The text is useful for both the novice and the experienced user.
-
- -Ray Theiss, Team OS/2
-
- This is far and above the best book about OS/2 that I've ever seen. In fact,
- it's probably the best book on any operating system I've read in the past 15
- years!
-
- -Chip Rabinowitz, Chief Technical Officer, Innovative Data Concepts, Inc.
-
- It's the book I would have written if I had the technical knowledge, the
- editorial sophistication, and the dedication to the dissemination of knowledge
- so thoroughly demonstrated by Moskowitz and Kerr, et al.
-
- -Adrian Brancato Technical Services, N.C. Department of Corrections
-
- In my opinion, OS/2 2.1 Unleashed is the most comprehensive (read best!) book
- about OS/2 available anywhere. The book gets into all aspects of OS/2 and will
- likely become the premier reference for everyone that has a question about
- OS/2. -Steven Hoagland
-
- If you need a reference work on 2.1 (and who doesn't) and need it written in a
- clear, concise manner by the foremost experts in their fields, bundled with a
- diskette of utilities that would cost you twice the price of the book alone,
- OS/2 2.1 Unleashed is the way to go.
-
- -Paolo Pignatelli, The Corner Store
-
-
- ΓòÉΓòÉΓòÉ 2. Title Page ΓòÉΓòÉΓòÉ
-
- OS/2 2.1
- Unleashed
-
- David Moskowitz and David Kerr, et al
-
-
- ΓòÉΓòÉΓòÉ 3. Copyright and Trademarks ΓòÉΓòÉΓòÉ
-
- Copyright (C) 1993 by Sams Publishing
-
- FIRST EDITION
-
- All rights reserved. No part of this book shall be reproduced, stored in a
- retrieval system, or transmitted by any means, electronic, mechanical,
- photocopying, recording, or otherwise, without written permission from the
- publisher. No patent liability is assumed with respect to the use of the
- information contained herein. Although every precaution has been taken in the
- preparation of this book, the publisher and author assume no responsibility for
- errors or omissions. Neither is any liability assumed for damages resulting
- from the use of the information contained herein. For information, address Sams
- Publishing, 11711 North College Avenue, Carmel, Indiana 46032.
-
- International Standard Book Number: 0-672-30240-3
-
- Library of Congress Catalog Card Number: 92-62682
-
- 96 95 94 93 5 4 3 2
-
- Interpretation of the printing code: the rightmost double-digit number is the
- year of the book's printing; the rightmost single-digit, the number of the
- book's printing. For example, a printing code of 93-1 shows that the first
- printing of the book occurred in 1993.
-
- Trademarks
-
- All terms mentioned in this book that are known to be trademarks or service
- marks have been appropriately capitalized. Sams Publishing cannot attest to the
- accuracy of this information. Use of a term in this book should not be regarded
- as affecting the validity of any trademark or service mark. OS/2 is a
- registered trademark of International Business Machines Corporation.
-
- Composed in Garamond and MCPdigital by Prentice Hall Computer Publishing
-
- Printed in the United States of America
-
-
- ΓòÉΓòÉΓòÉ 4. Ordering Information ΓòÉΓòÉΓòÉ
-
- Sams
-
- To order this book or any Sams publication, call 1-800-428-5331 between 9:00
- a.m. and 5:00 p.m. EST. For faster service please have your credit card
- available.
-
- I.V. League
-
- To receive a free copy of the PSP Product Catalog, or to order any of the books
- reviewed here, please call 1-800-342-6672. All orders are shipped next day
- air.
-
-
- ΓòÉΓòÉΓòÉ 5. Contents ΓòÉΓòÉΓòÉ
-
- Introduction
-
- Installation Issues
- Hardware Considerations
- Preliminary Planning
- OS/2 2.1 Installed as the Only Operating System
- Dual Boot
- Boot Manager
- Installing OS/2 2.1
- Disk Install
- CD-ROM Install
- Network and Response File Install
- Multimedia
- Troubleshooting
- Disk 1 Doesn't Seem to Work!
- Phase 2 Boot Produces White or Blank Screens
- Can't Find COUNTRY.SYS
- ROM BIOS Problems
- Trap 2 Problems
- Nonsupported SCSI Adapters
- Creating a Single Disk Boot
-
- Multiple Desktop Views
- The Major Configurations
- OS/2 2.1_The Workplace Shell
- Objects and the Workplace Shell
- Changing to an Object Orientation
- Existing Applications and the Workplace Shell
- OS/2 1.3_The Original Desktop
- OS/2 1.3 System Programs
- Copying 1.3 Programs from Disk
- Windows 3.1_Windows Compatibility
- Windows Groups and Applets
- The Windows Desktop Versus Win-OS2
- Accessibility of the Workplace Shell
- Configuring the System
- INI and RC Files
- INI Files
- RC Files
- Booting from a Disk
- Boot Disks
- Using the MAKEINI Utility
- OS/2 1.3
- Windows 3.x
- OS/2 2.1
- Multiple Configurations
- Configuration Maintenance
- Unique Configurations
- The CMD.EXE Configuration
- Setting Up the Configuration
- Replacing the Command Processor
- Setting Up a New Default Command Processor
- Setting Up Multiple Command Processors
-
- System Configuration, Setup, and Tuning
- A Brief Introduction to Multitasking
- Sessions and Processes and Threads, Oh My!
- Cache: HPFS and FAT
- CONFIG.SYS
- Making Changes
- How to Setup a RAM Disk_When and Why
- Sample Configurations
- The Minimum System
- Recommended Minimum System
- A Better System
- A Power-User System
- Performance Tuning
- Change Boot Manager Operation
- Migration
-
- The Workplace Shell
- Getting Started
- Pop-Up Context Menus
- Feedback
- Where to Find Help
- Online Manuals and Tutorials
- Learning to Use the Shell
- Copying, Moving, and Deleting
- If You Don't Have a Mouse . . .
- Rearranging Your Desktop
- Using Find to Search for Objects
- Opening Objects
- Opening Multiple Command Lines
- Where Has My Window Gone?
- Using the Window List
- Obtaining the Desktop Pop-Up Menu
- Shutdown and Lockup
-
- Workplace Shell Objects
- The Workplace Object Hierarchy
- The Root Object Class
- The File System Base Class
- The Abstract Base Class
- The Transient Base Class
- Dormant and Awakened Objects
- Shadows of Objects
- Object Identifiers
- Creating Objects
- Using Templates
- Create Another Menu Item
- From a REXX Command
- Creating Your Own Drag-and-Drop Object
- Object Settings
- The General Settings Page
- The Window Settings Page
- Folder Objects
- Folders as Directories on Your Hard Disk
- The View Pages
- The Include Pages
- The Sort Page
- The Background Page
- Work Area Folders
- Creating Another View of the Desktop
- The Startup Folder
- File Objects
- The Type Page
- The Menu Page
- The File Pages
- Printing File Objects
- Program Objects
- The Program Page
- The Session Page
- The Association Page
- Inside the System Setup Folder
- Colors and Fonts
- Keyboard, Mouse, and Touch
- System Settings
- Country Settings
- The Workplace Shell and Networks
- Network Folder
- Network Group Object
- Server Object
- Network Directory Object
- Network Printer Object
- Login and Logout
-
- Configuring the Workplace Shell
- CONFIG.SYS Settings
- The OS/2 Shell
- The Workplace Shell Process
- Starting Workplace Shell Components
- Restarting Applications and Objects
- Setting the Object Snooze Time
- Turning Off the Shell's Error Handler
- Master Help Index and Glossary Database
- User and System Initialization Files
- Identifying the Command-Line Processor
- Replacing the Workplace Shell
- The OS2.INI and OS2SYS.INI Files
- Contents
- The INI.RC File
- Making the Desktop Look Like Windows
- Creating Your Own Desktop
- Threads of the Workplace Shell
- User Input and Tasking Threads
- Specialist Threads
- How the Workplace Shell Protects Itself-and You
- Process-Level Protection
- Exception Handlers
- Recovering from Errors
-
- Command-Line Interface
- Managing Command Windows
- Creating New Command Objects
- Customizing Settings
- Fonts
- Mode Command
- Prompt
- Environment
- Getting Help
- Printing Options
- Starting Sessions
- START
- DETACH
- Syntax and Symbols
- Command Tables
- Programming with Command Files
- Alternate Command Processors
-
- Virtual DOS Machines
- General Virtual DOS Machine Parameters
- Virtual DOS Machine Defaults
- Accessing DOS Settings
- Specific DOS Versions
- MVDM Window Management
- DOS Settings
- COM_DIRECT_ACCESS
- COM_HOLD
- COM_SELECT
- DOS_AUTOEXEC
- DOS_BACKGROUND_EXECUTION
- DOS_DEVICE
- DOS_HIGH
- DOS_STARTUP_DRIVE
- DOS_UMB
- DOS_VERSION
- EMS_FRAME_LOCATION
- EMS_MEMORY_LIMIT
- IDLE_SECONDS
- IDLE_SENSITIVITY
- INT_DURING_IO
- KBD_BUFFER_EXTEND
- KBD_CTRL_BYPASS
- MEM_EXCLUDE_REGIONS
- MEM_INCLUDE_REGIONS
- MOUSE_EXCLUSIVE_ACCESS
- PRINT_TIMEOUT
- VIDEO_FASTPASTE
- VIDEO_MODE_RESTRICTION
- VIDEO_ONDEMAND_MEMORY
- VIDEO_RETRACE_EMULATION
- VIDEO_ROM_EMULATION
- VIDEO_SWITCH_NOTIFICATION
- VIDEO_WINDOW_REFRESH
- XMS_MEMORY_LIMIT
- Maximizing Common Applications
- Borland's Arago dBXL/Quicksilver 2.5
- dBase IV 1.5/Runtime 1.5
- Lotus 1-2-3 Version 3.1+
- Procomm Plus 2.x
- WordPerfect 5.1
- Integrating MVDMs Into the OS/2 Environment
- Clipboard
- Rudimentary MVDM-OS/2 Communications
- LANs and VDMs
-
- WIN-OS/2_Windows in OS/2
- Installation
- Migration and Setup
- OS/2 Setup
- Clipboard and Dynamic Data Exchange
- Windows Setup (the INI Files)
- Running Windows Applications
- Seamless Windows
- Screen Blanker
- Screen Capture and Other Utilities
- Full-Screen Sessions
- Running WIN-OS/2 in a VMDISK Session
- Drivers
- Printers
- Video Adapter
- Fax
- Differences Between Microsoft Windows 3.1 and the WIN-OS/2 Environment
- Managing Memory
- Failures, Fractures, and Faults
- Local Ctrl-Alt-Del
- Troubleshooting
- Applications Don't Work
- Applications That Used to Work, Don't
- True Type Fonts Don't Work
- Fatal Exit Codes
- Summary
-
- File Systems and Drive Objects
- File Systems
- The File Allocation Table
- The Installable File System
- The High Performance File System
- Lazy Write
- HPFS Performance Versus FAT Performance
- HPFS Versus FAT_Other Factors
- Shutdown
- Disk Support
- Optimizing Your File Systems
- Making the Most of Long Filenames
- Extensions
- Workplace Shell Drive Objects
- Drive Objects
- Deleting Files
- Laying Out Your Data
- Security
- Making Multiple Drives Work with the Workplace Shell
- Swap File and Spooler
- Dealing with Fragmentation
- OS/2 Disk Utilities
- File Attributes
- Extended Attributes
- Special Extended Attribute-File Type
- Attach a Comment or Key Phrase to Your File
- Attaching an Icon in Extended Attributes
- Reclaiming Disk Space from Extended Attributes
- Avoid Losing EAs When Sending Files
- Alternatives to Drive Objects
- OS/2 1.3 File Manager
- Windows File Manager
- Command Line
- Summary
-
- The Video Subsystem
- The Base Video Handler
- The Video Virtual Device Driver
- The SVGA Command and PMI Files
- Switching Between Full-Screen and Presentation Manager Applications
- The Presentation Manager Display Driver
- The WIN-OS/2 Device Driver
- Full-Screen WIN-OS/2
- WIN-OS/2 Window
- Changing Display Resolutions
- Why Would I Want to Change Resolution?
- Supported Resolutions for Presentation Manager
- Display Mode Query and Set (DMQS)
- The Effect on WIN-OS/2
- Colors and the Palette Manager
- 16 Fixed Colors
- 256 Colors
- Direct Color
- Black-and-White Liquid Crystal Displays (LCD)
- Alternative Color Scheme
- Bigger Cursors
- Installing Display Drivers
- Using Installation Tools
- Manually Changing Display Drivers
- Fonts and Display Drivers
- Fonts Provided by the Display Driver
- International Standards and How They Affect Fonts
- Where to Get Display Drivers
- How to Select the Best Video Adapter for OS/2 2.1
- Resolution, Performance, and Flicker
-
- Printing
- Print Workplace Objects
- Printer Object
- Job Object
- Port Object
- Printer Driver Object
- Queue Driver Object
- Spooler Object
- Differences Between OS/2 2.1 and OS/2 1.3 Print Subsystems
- WIN-OS2 Print Subsystem
- WIN-OS2 Control Panel
- WIN-OS2 Print Manager
- Network Printing
- Network Printer Object
- Job Objects in a Network Printer Object
- Distributing Printer Drivers for Network Users
- Printing to a Network Printer
- Print Subsystem Configurations
- Print to File
- Port with Multiple Printer Objects (Sharing)
- Printer Object with Multiple Ports (Pooling)
- Multiple Printer Objects with Multiple Ports
- Separator Files
- DOS Considerations
- WIN-OS2 Considerations
- Printing from OS/2 Applications
- Workplace Shell Drag and Drop
- Print Screen Key
- OS/2 Online Help and View Program
- PICVIEW Applet
- PMCHART Applet
- Describe
- Lotus 1-2-3/G (Version 1.1)
- Troubleshooting
- Cannot Print Under OS/2 2.1
- Printing Starts When DOS Application Ends
- DOS Application Holds Up Other Printing
- Cannot Print from DOS with a Security Device on LPT1
- DOS Application Creates Many Print Jobs
- Forms Mismatch Message
- Job Stays in Printer Object Without Printing
- Performance Tips
- Replacing Printer Drivers
- Printing Text on a Postscript Printer
- References
- User References
- Application Developer References
-
- Productivity Applets
- The Origin of Applets
- Of Time and Planning-PM Diary
- Daily Planner
- Activities List
- Calendar
- Monthly Planner
- Tune Editor
- Archiving
- Integrating the Five PM Diary Applets
- Database
- Alarms
- PM Chart for Business Presentations
- Using the Toolbar
- Opening Existing Files
- Selecting and Manipulating Objects
- Using Clip Art
- Using Worksheet Data and Importing Other Formats
- Text and Labeling
- Using Draw, Color, and Style
- PM Terminal
- Modes of Operation
- Configuring PM Terminal
- The Icon Editor
- The Enhanced PM Editor
- Basic Editing Techniques
- Power Features
- Macros
- Understanding the Options Menu
- Printing and Formatting
- Other OS/2 Applets
- Seek and Scan Files-OS/2 2.1's Most Useful Applet!
- Pulse-Monitor CPU Performance
- Clipboard Viewer-Exchange Data Between OS/2 and WINOS/2
- Picture Viewer
- Sticky Pad
- Summary
-
- Learning to Program-Tools, Tips, and Techniques
- Basic OS/2 Programming Concepts
- Working with Messages
- Multitasking and Multithreading
- Dynamic Link Libraries
- Language Choices
- Object-Oriented Programming
- Picking the Tools
- Language Compilers and Interpreters
- Developer's Toolkits
- Debuggers
- Class Libraries
- CASE Tools
- IBM's Offerings
- Borland's Offerings
- Other Vendors
- Shareware and Freeware
- Installing the WorkSet/2
- Installing the WorkFrame/2
- Installing the C Set/2 Compiler
- Installing the IBM Developer's Toolkit for OS/2 2.1
- Starting and Testing the WorkFrame/2
- Using the WorkFrame/2
- The Window Lists
- The Switch List and the Window Shade
- Adding Tools to the Working Environment
- Building a Project
- Base and Composite Projects
- Setting C Set/2 Compiler Settings
- Editing Source Files
- Using the Online Documentation
- Good Luck!
-
- REXX Programming
- REXX Versus Batch
- Differences
- Error Conditions/Debugging
- When to Use REXX Programs
- Why REXX is Faster-the Role of Extended Attributes in REXX
- An Introduction to REXX Basics
- Features and Concepts
- REXX Instructions
- Debugging REXX Programs
- Built-In Functions
- Using OS/2 Commands in REXX Programs
- Using REXXTRY
- More Advanced REXX
- REXX Boilerplates
- Using REXX Queues
- Reading and Writing OS/2 Files with REXX
- Using the STREAM Function
- Using the NOTREADY Condition
- Using REXX Extensions
- The ADDRESS Instruction
- Built-In Functions Versus Libraries
- Using REXX Libraries
- The REXX Utility Library in OS/2 2.1
- Searching Files and Directories
- Saving Information
- Obtaining Drive Information
- Controlling Screen Input and Output
- REXX and the Workplace Shell
- Creating Workplace Shell Objects
- Creating Folders
- Creating Program References
- Creating Object Shadows
- Destroying Objects
- Registering Object Classes
- REXX and the OS/2 Communications Manager
- The HLLAPI Function
- REXX and the Enhanced Editor
- Using the VREXX Package
-
- Troubleshooting
- Installation Failure Recovery
- Preparing for Installation
- CONFIG.SYS Changes
- Selective Install
- Catastrophic Installation Failure
- Problem Prevention and Recovery Preparation
- Critical Files Backup
- The Workplace Shell Backup Utility
- Boot Disks
- CHKDSK C: /F
- Post-Installation Failure Recovery
- System Configuration (CMOS)
- System RAM
- HPFS-Related
- FAT-Related
- Keyboard
- Mouse
- Workplace Shell
- Video
- Printer
- CD-ROM Drives
- OS/2 Error-Logging Facilities
- PSTAT
- The LOG.SYS and SNA Format
-
- Networking
- LAN Components: Wiring and Adapters
- Protocols
- Workstation Software
- Server Software
- LAN Server
- Adapter/Protocol Installation
- Requester/Server Installation
- Operating LAN Server
- Command-Line Utilities
- Workplace Shell Operations
- Requester Menus
- MVDM Sessions
- Advanced Server Options
- LAN Manager
- One-Step Installation
- Command-Line Operation
- Full-Screen Menu Interface
- Novell NetWare Requester for OS/2
- Graphical Installation
- Operating the Requester
- DOS Sessions
-
- Multimedia
- What Is Multimedia?
- CD-ROM
- Audio and Sound Effects
- Animation and Graphics
- Overall
- OS/2 as a Multimedia Platform
- IBM Ultimedia
- OS/2 Support for Multimedia Devices
- Base OS/2 CD-ROM Support
- Windows 3.1 Multimedia
- Multimedia Sampler
- Compton's MultiMedia Encyclopedia
- National Geographic Multimedia Mammals
- MMPM/2 in Detail
- Sound Support
- CD-Audio Support
- Video Playback/Capture
- Computer-Controlled Laser Disc
- Installation of MMPM/2
- Using Unsupported CD-ROM Drives
- Other SCSI CD-ROM Drives
- Using DOS CD-ROM Drivers
- Managing DOS Configuration
- WIN-OS/2 Multimedia
- Multimedia Development Environment
- Future Multimedia
- Conclusion
-
- Freeware, Public Domain Software, and Shareware
- Finding Shareware
- OS/2 Unleashed Companion Disk
- 4OS2
- TE/2_Terminal Emulator/2
- DiskStat
- LH2
- Deskman/2
- Galleria
- PMScrapbook
- INIMaint
-
- Bulletin Board Systems
- CompuServe
- Internet
- Transferring Files
- FTP Commands
- File Extensions
- Anonymous FTP Sites
- Multi-Net BBS
- Bulletin Board Systems
-
- OS/2 System Messages
-
- Index
-
-
- ΓòÉΓòÉΓòÉ 6. Foreward ΓòÉΓòÉΓòÉ
-
- Late in the evening of March 31, 1992, a dedicated team of designers and
- programmers in Boca Raton, Florida, completed final testing of the OS/2 2.0
- operating system. Their efforts have been rewarded with the success of the OS/2
- 2.0 product.
-
- More than 2 million copies of OS/2 2.0 have been shipped, greatly exceeding
- industry and analyst expectations. More than 1,300 applications are available
- for OS/2, including major products from industry-leading software corporations.
- As each month passes, more and more OS/2 applications are launched.
-
- the achievement of the OS/2 operating system has not gone unnoticed within the
- industry. To date, OS/2 2.0 has received 12 industry awards, including the
- following:
-
- PC Magazine, Technical Excellence
- Information Week, 1992 Top Products-the 10 most likely to succeed
- PC Week Labs, Top Product 1992
- Corporate Computing, Best Buy
- Datamation, Product of the Year, PC Software category
-
- 1993 marks the availability of OS/2 2.1. We have incorporated many
- improvements to the operating system, including performance enhancements,
- support for Windows 3.1 applications, compatibility with many more printer and
- video devices, power management for portable computers, and MMPM/2, the
- multimedia extension for OS/2.
-
- It is my pleasure to introduce OS/2 2.1 Unleashed, an excellent companion book
- to the OS/2 2.1 product. Within these pages, you will find many valuable tips
- and techniques that you can use to improve your productivity and enhance the
- value of OS/2. With each chapter, you will learn how you can get the most from
- OS/2, how to tune your DOS applications, and how to integrate your Windows 3.1
- applications with the Workplace Shell.
-
- The authors span our industry and possess years of experience with the OS/2
- operating system. Several of the suthors are members of the original OS/2
- design and development team, bringing an unequalled level of OS/2 knowledge to
- a single book.
-
- Ths OS/2 development team is dedicated to providing you with a quality
- operating system product. We value learning from your experiences, and I
- welcome you to the family of OS/2 users. You can exchange ideas with other
- OS/2 users, the OS/2 development and support team, and the authors of OS/2 2.1
- Unleashed by participating in the OS/2 forums on CompuServe.
-
- Welcome to OS/2 2.1 Unleashed.
-
- James A.Cannavino
- Senior Vice President, IBM
- General Manager, IBM Personal Systems
-
-
- ΓòÉΓòÉΓòÉ 7. Learning to Program-Tools, Tips, and Techniques ΓòÉΓòÉΓòÉ
-
- In This Chapter
-
- Basic OS/2 Programming Concepts
- Language Choices
- Object-Oriented Programming
- Picking the Tools
- Installing the WorkSet/2
- Starting and Testing the WorkFrame/2
- Using the WorkFrame/2
- Building a Project
- Editing Source Files
- Using the Online Documentation
- Good Luck!
-
- OS/2 2.1 can be such an enjoyable environment to use, it's easy to forget that
- its primary (and rather mundane) purpose is to control the execution of
- computer programs. Similarly, in the course of executing these programs, it is
- easy to dismiss your favorite application and regard it simply as a consummate
- companion or ever-present business tool. Easy to dismiss, that is, unless you
- are a programmer. The simple and obvious truth of the matter is that every
- program you use, from spreadsheets to word processors to communications
- programs, needs to be written. The typical OS/2 programmer does not take this
- simple fact for granted, and you don't have to either. You don't need to be a
- professional programmer to learn how to program OS/2. All it takes is a little
- bit of hard work and perseverance.
-
- This chapter is intended to provide new OS/2 programmers with an understanding
- of the issues that must be tackled before successfully developing OS/2
- programs. I'll begin by introducing a few of the programming issues that make
- developing applications for OS/2 unique, and then I'll delve into the
- programming languages and tools you might use to create your own masterpieces.
- Because it is currently the most widely used collection of development tools
- available for OS/2 programming, I'll conclude with a discussion of IBM's
- WorkSet/2 product.
-
-
- ΓòÉΓòÉΓòÉ 7.1. Basic OS/2 Programming Concepts ΓòÉΓòÉΓòÉ
-
- For application developers, OS/2's expanded capabilities do not come without a
- price. Moving to the OS/2 platform from DOS or Windows means tackling a new set
- of programming challenges and problems. At the same time, the multitasking and
- memory protection afforded by OS/2 gives the programmer a stable and dependable
- development environment. OS/2 quickly catches and shuts down programming errors
- that typically cause simple operating systems to freeze up or become corrupt.
- Although OS/2 forcibly stops errant programs, the rest of the operating system
- continues to function normally. For this reason alone, writing programs under
- OS/2 is much easier and considerably less frustrating than writing similar
- programs under other less-protected operating systems.
-
- The topic of OS/2 programming is a large and complex one. Because OS/2 offers
- the user so much flexibility with regard to graphical interfaces, process
- control, device support, and system services, the programmer faces a daunting
- array of development tasks. Even a simple program that does little more than
- displaying a window with an innocuous "Hello World" message may span several
- pages of code. This additional complexity is understandably intimidating for
- many programmers.
-
- Don't panic. The key to successfully mastering OS/2 programming involves
- patience and a slow, deliberate approach. You're likely to succeed if you don't
- try to learn everything at once. Although a comprehensive treatment of
- programming issues is beyond the scope of this chapter, several concepts are
- crucial to writing effective and efficient OS/2 applications. Specifically, the
- intelligent use of multithreading and dynamic link libraries (DLLs) can go a
- long way toward making your programs run faster, occupy less space, and operate
- in a way that a typical user might expect. Remember, a program that simply
- works is not necessarily a good OS/2 program.
-
-
- ΓòÉΓòÉΓòÉ 7.1.1. Working with Messages ΓòÉΓòÉΓòÉ
-
- As you probably know, the Workplace Shell is the graphical interface you are
- presented with when you start OS/2. The Workplace Shell, in turn, runs on top
- of a subsystem called the Presentation Manager (PM). Programs that run in the
- PM environment and use the graphical presentation services it provides are
- called PM programs. Strictly speaking, it is possible to write OS/2 programs
- that are not PM programs, but this is the exception. The reason for this is
- simple: OS/2 was designed as a graphical environment, and a program needs to
- use the services that PM provides if it wants to take advantage of this fact.
- Still, there are many programs that do not use PM and operate in text mode.
- Device drivers, command-line utilities, data entry applications, and terminal
- emulators are a few of the program types that do not require-and are sometimes
- restricted by_a PM interface.
-
- The Presentation Manager is based on an event-oriented messaging system. PM
- programs spend much of their time waiting for the user to initiate actions. As
- the user interacts with the PM interface, OS/2 generates event messages. For
- example, when a user clicks the button, a "Button Clicked" message is
- generated. When the user strikes a key on the keyboard, a "Key Pressed" message
- is generated. Some events may generate a flurry of messages, depending on the
- action's complexity. Programs may also send customized messages to themselves
- or other applications.
-
- Programs using the traditional programming model execute blocks of code and
- pause for user input when necessary. PM programs, on the other hand, react to a
- stream of messages. This unique programming approach takes a little getting
- used to, especially if you have a lot of experience using the older procedural
- methods. The message-based model is a difficult hurdle facing the novice PM
- programmer, but once conquered, the rest of the learning experience is
- considerably easier.
-
-
- ΓòÉΓòÉΓòÉ 7.1.2. Multitasking and Multithreading ΓòÉΓòÉΓòÉ
-
- One of OS/2's great strengths is its capability to run more than one program at
- a time. This feature, called multitasking, enables the machine's user to work
- simultaneously on several tasks at once. This capability's benefit becomes
- clear the first time you try to format a floppy disk while working in a
- spreadsheet or the first time you do a communications download while typing a
- memo with your word processor. Instead of waiting for a program to finish a
- lengthy task, multitasking effectively enables you to break away and do
- something else until the program is finished.
-
- OS/2 uses a powerful multitasking variant called preemptive multitasking. Under
- the preemptive model, programs share the processor in a manner mandated by the
- operating system. Each program executes for a discrete period of time: a time
- slice. When the program's time slice ends, the operating system forcibly
- suspends the application and allows other programs to execute. This model
- ensures that no single program can monopolize the system's most precious
- resource: the microprocessor. Microsoft Windows, by comparison, uses
- cooperative multitasking. This model relies on the good behavior of individual
- programs to guarantee equal access to the processor. Because applications need
- to voluntarily yield the processor to other programs, a single, greedy program
- can dominate the entire operating system.
-
- Multitasking alone, however, has several inherent limitations. For example,
- take the case of a user who is working on a document and wants to print a rough
- draft. Ideally, the user wants to tell the word processor to print the job in
- the background while she or he continues to edit the document in the
- foreground. With traditional multitasking operating systems, the individual can
- switch out and start another application; however, they still constrain the
- word processor to a single strand of execution and force the program to send
- the entire job to the printer before returning control to the user. Although
- there are ways around this problem, none are elegant, and all are
- resource-hungry.
-
- Multithreading allows multiple parts of the same program to execute
- simultaneously. In the previous example, an OS/2 word processor could use a
- separate thread to process the print job and return control to the user almost
- immediately. The background thread would continue spooling the print job to the
- printer without locking up the program's user interface.
-
- From a technical perspective, OS/2 distinguishes between processes and threads.
- A process contains its own main thread, virtual memory address space, file
- handles, and other crucial system resources. OS/2 considers these resources
- private and ensures that they are not accessible by other processes that may be
- running on the system. A process may create other threads that execute in
- parallel to the process' main thread. These threads can be created much more
- quickly than separate processes and can communicate with each other through
- shared memory.
-
- I cannot overemphasize the importance of using efficient multithreading
- programming techniques. Too often, OS/2 programmers concentrate on
- sophisticated processing algorithms or impressive user interfaces without
- paying enough attention to the intelligent use of OS/2's multithreading
- facilities. Some programmers try to compensate for this by replacing the mouse
- pointer with the dreaded "ticking clock" icon and waiting for the lengthy
- processing to conclude. Although this helps to notify you to wait for a task to
- finish, it doesn't take advantage of the operating system services that make
- OS/2 so powerful. More importantly, it doesn't make the program as responsive
- or effective as it should be.
-
-
- ΓòÉΓòÉΓòÉ 7.1.3. Dynamic Link Libraries ΓòÉΓòÉΓòÉ
-
- Dynamic link libraries are collections of code, data, and resources that are
- separated into external files. They are occasionally a source of confusion, not
- because they are particularly hard to understand, but because it is sometimes
- difficult to decide when and where they should be used. The simple truth is
- that all but the most trivial OS/2 programs can effectively use DLLs.
-
- When you run a program that uses DLLs, the operating system figures out which
- DLLs the program needs and loads them into memory. Once a DLL is loaded, the
- program can call functions in the DLL as if they resided in the executable
- file. Data and PM resources embedded within the DLL can also be accessed and
- manipulated seamlessly. A DLL that is loaded into memory can share its code and
- data resources with any process running on the machine. This is tremendously
- useful when you want to share a piece of code between several separate
- programs.
-
- Consider, for example, a large accounting system that includes several
- programs. Most programs have a significant amount of code in common-both the
- accounts receivable module and the accounts payable module might need to
- retrieve information from the master ledger database. By placing the routines
- that interact with ledger files into a single DLL, you can ensure that only one
- copy of the code is simultaneously in memory. This procedure also ensures that
- only one copy of the code needs to be shipped with the system. This saves
- storage space and requires less memory-two of the sacred cows for programming
- in any environment. Figure 14.1 illustrates how such an accounting system might
- use DLLs to minimize duplicated code and wasted memory.
-
- Dynamic link libraries are excellent mechanisms for extending OS/2's system
- services or for providing your own new operating system services. If a
- developer wants to provide electronic mail services to OS/2 programs, code can
- be placed in a DLL and installed in a directory on the LIBPATH. In this way,
- any application that knows which functions are in the DLL can access and use
- the E-mail services.
- Figure 14.1. A hypothetical accounting system DLL usage.
-
- Note: When choosing names for your DLLs, try to think up something that is
- intuitive and specific. If you choose a generic name, chances are high
- that someone else might use the same name when building a DLL. You can
- imagine the resulting chaos if both DLLs were installed on the same
- system. (Don't laugh, this is not an uncommon occurrence.) You could
- name an accounting DLL containing common code something like ACCCMMN.DLL
- or CMMNACC.DLL, not COMMON.DLL. An even better solution is to
- incorporate your company's name or initials into the DLL name.
-
-
- ΓòÉΓòÉΓòÉ 7.2. Language Choices ΓòÉΓòÉΓòÉ
-
- A variety of language compilers and interpreters are available that support the
- creation of native 32-bit OS/2 applications. IBM has compilers that support
- programs written in C, C++, Macro Assembler, COBOL, and FORTRAN. Programming
- languages that are offered or supported by third-party vendors include Ada,
- Basic, C, C++, COBOL, FORTRAN, Modula-2, Pascal, Prolog, Smalltalk, and many
- others. Clearly the number of development options available to the OS/2
- programmer is growing at a rapid pace.
-
- Since the early days of OS/2, C has been its primary programming language. C
- has traditionally been the mainstream language that has received the strongest
- support from IBM and third-party developers. The vast majority of existing OS/2
- applications are written in C, and most companies regard C as the language of
- choice for OS/2 development. I think you will find that it is the language with
- the largest variety of supporting programming tools and utilities.
-
-
- ΓòÉΓòÉΓòÉ 7.3. Object-Oriented Programming ΓòÉΓòÉΓòÉ
-
- Lately, a lot of talk has surrounded object-oriented programming (OOP), and no
- discussion of OS/2 programming is complete without some mention of it. Most
- contemporary computer languages encourage the use of a programming style called
- structured programming. Programmers who employ this model can write complex
- programs quite easily, so it comes as no surprise that these languages have
- prospered. However, a common complaint about structured languages is that as a
- program grows in size it becomes considerably more difficult to understand and
- support. By the time a C or Pascal program nears 75,000 lines of code it has
- typically turned into a maintenance nightmare. It is rare to find a programmer
- that can completely understand all the nuances of a program that large.
-
- Object-oriented languages (including C++) are designed to help alleviate the
- burden of maintaining large programs. In doing so, these languages have also
- bridged a conceptual gap that has always existed between the way a program is
- written and the way people interact with the world. Perhaps the following
- example most clearly demonstrates this. In the real world, a person doesn't
- need to understand the details of how the internal combustion engine operates
- just to drive a car.
-
- In the course of our day-to-day lives, we constantly deal with objects. Objects
- are items that possess distinct characteristics and traits. Basketball objects
- are round, book objects have pages, and ice cube objects are cold. There are a
- whole range of actions that you can perform on or with these objects. You can
- bounce a basketball and read a book. Sometimes these actions can modify the
- attributes of the object. If you heat an ice cube it is no longer ice, it is
- water. OOP uses these sorts of object/action relationships as the foundation
- for a programming technology. Programmers create their own objects by first
- defining object classes. These classes provide a description of an object's
- traits (class variables) and possible actions (class methods). Individual
- objects that belong to a particular class are called instances. When you want
- to perform an action on or with the object, you send an object instance a
- message telling it to execute one of its methods.
-
- As an example, take the programmer who has been asked to design an automobile
- class. Such a class might contain data that describes the car's various
- attributes. There may be one variable that details the car's color, another
- that identifies how many doors the car has, and yet another that represents the
- direction the car is facing. Because objects describe both data and potential
- actions, the car class might contain a method that controls the engine's
- acceleration. Another method might turn the car left or right. The developer
- could then create an instance of this class, and by sending a message to it,
- execute the "TurnLeft" method. This method, in turn, would change the value of
- the variable that stores the direction the car is facing.
-
- Perceiving a programming task as simply defining the interactions between
- preexisting objects can help to dramatically reduce program complexity. But OOP
- can also reduce the program's physical number of source code lines. The key
- lies in using an object-oriented programming mechanism called inheritance. An
- object class that is said to be inherited from another object class is called a
- derived object class; the original object class is called the base object
- class. Instances of the derived class get all of the same variables and methods
- as instances of the base class. Only the variables and methods that make the
- inherited class unique need to be added to the new class definition. As an
- example, you could create a derived car class called SportsCar. Instances of
- this class would still have the Color, NumDoors, and FacingDirection variables.
- These instances would also have the same turning and acceleration methods.
- These variables and methods would be automatically available to the SportsCar
- class, even though they are not directly defined in that class' definition.
- Then you could augment your derived class by giving it additional variables and
- methods to represent insurance penalties and better performance
- characteristics.
-
- Sophisticated programs construct large hierarchies of object classes, each
- inheriting the attributes and methods of its base class. This cuts down
- dramatically on the amount of code duplicated in the system and allows buy
- fixes and performance improvements to cascade down the inheritance chain
- without physically changing every object class definition.
-
- Although C remains the dominant language in OS/2 development, it's getting a
- lot of competition from object-oriented languages such as C++ and Smalltalk.
- Object-oriented languages are especially well suited for writing graphical
- programs, and PM programs in particular. This is because, in many ways, the PM
- programming interface model is already object- oriented. User interface
- controls in PM have an inherent knowledge of their internal state, and programs
- manipulate these internal states by sending messages to them. For instance, an
- entry-field control "knows" what its current contents are, and you can either
- set or query this value by sending specific messages to it.
-
-
- ΓòÉΓòÉΓòÉ 7.4. Picking the Tools ΓòÉΓòÉΓòÉ
-
- Developers use programming environments in much the same way that a secretary
- might use a word processor or an accountant might use a spreadsheet. Without an
- effective set of tools at your disposal, OS/2 programming rapidly becomes a
- difficult and unpleasant opponent. Many products fall under the nebulous
- category of "development tools," so before you start concentrating on specific
- products, it's probably beneficial to review the classes of tools that you
- might want to use. One phrase that you will encounter often is integrated
- development environment, or IDE. IDEs provide a single access point for all the
- development tools that you might need. Instead of interacting with an editor,
- compiler, and project control system as separate components, an IDE couples
- them together so that they work in harmony. For example, a common feature
- implemented in many IDEs relates to the processing of compiler error messages.
- Most compilers display a line number when they encounter a programming error
- that prevents them from continuing. Many IDEs enable the user to select the
- error message text, and by performing some action, start the programmer's
- editor and place the cursor on the offending line. This is a dramatic
- improvement over the separate tool approach. Using separate tools, this
- operation usually requires the programmer to pipe the compiler's output into a
- file, examine the file to find the line number, and then use the cursor keys or
- editor "jump" command to move manually to the line. As you might imagine, IDEs
- are especially useful for inexperienced programmers who have not yet mastered
- the arcane art of command-line compilers and make files.
-
-
- ΓòÉΓòÉΓòÉ 7.4.1. Language Compilers and Interpreters ΓòÉΓòÉΓòÉ
-
- When programmers talk about tools, they are actually talking about several
- classes of products. Perhaps the most obvious of these is the language
- compiler. Depending on the product you purchase, this could be a command-line
- compiler, a compiler functioning inside an integrated development environment,
- or a compiler that is built into an integrated environment. Borland's C++, for
- example, can function as a command-line compiler. The IBM C Set/2 compiler,
- when used inside the WorkFrame/2 environment, runs in a PM window that is part
- of an integrated product. Finally, the incremental compiler supplied with
- Digitalk's Smalltalk/V is built into the development environment.
-
- Note: Most vendors ship their command-line compilers with a make program. The
- make program enables you to describe your program's structure so that
- the compiler only recompiles those modules that have changed or are
- dependent on the modules that have changed. Although this may not seem
- like such a big deal for smaller programs, for a large project with many
- source files, this becomes a very valuable and desirable capability. If
- your compiler is of the command-line variety, ensure that you acquire a
- make program that will work with it.
-
-
- ΓòÉΓòÉΓòÉ 7.4.2. Developer's Toolkits ΓòÉΓòÉΓòÉ
-
- Some compilers might require you to invest in a developer's toolkit if you want
- to take advantage of all of OS/2's programming interfaces. The C Set/2 and
- Symantec's C++ compilers require the IBM Developer's Toolkit to write PM
- programs because it supplies the crucial header files needed to use functions
- in the standard OS/2 DLLs. The IBM toolkit also offers online documentation;
- utilities for creating icons, bitmaps, and dialog boxes; and other programming
- conveniences that help to make your life easier. Other vendors may decide to
- license the header files directly from IBM and provide their own utilities.
- This approach, which is the one taken by Borland, makes purchasing a separate
- toolkit unnecessary.
-
- Note: If you need to develop Workplace Shell objects, be sure your compiler
- provides som bindings. If it doesn't, you may have to also acquire the
- IBM Developer's Toolkit.
-
-
- ΓòÉΓòÉΓòÉ 7.4.3. Debuggers ΓòÉΓòÉΓòÉ
-
- An important item in any developer's toolbox, professional or otherwise, is an
- effective debugger. A debugger enables you to easily move through your
- program-a line at a time if necessary_to investigate the values of program
- variables, registers, and memory segments. A good debugger helps you specify
- certain lines at which to stop execution (breakpoints). A good debugger also
- helps you to select a particular variable or memory address and stop execution
- when its value is changed (watchpoints). Almost every compiler vendor supplies
- a debugger with their compiler (or sells a debugger compatible with their
- compiler as a separate product).
-
-
- ΓòÉΓòÉΓòÉ 7.4.4. Class Libraries ΓòÉΓòÉΓòÉ
-
- The concept of a class library is intimately coupled with object-oriented
- programming. Class libraries are collections of objects that programmers can
- incorporate into their own programs. Because objects are complete unto
- themselves, a programmer need only know how to use the object-the rest is up to
- the object library. Some vendors have taken the idea of a class library and
- extended it to the idea of an applications framework. Technically speaking,
- applications frameworks are simply large class libraries, but they are usually
- constructed so they completely shape and direct the way you develop your
- program. Applications frameworks, because they try to be so comprehensive,
- usually contain a large collection of user-interface objects. Many also
- incorporate a variety of general-purpose classes.
-
- Examples of application frameworks on the DOS and Windows side of the fence
- include Borland's TurboVision, the Object Windows Libraries (OWL), and the
- Microsoft Foundation Classes (MFC). Borland says that a version of OWL for OS/2
- is in the works; because it will be based on a set of class libraries developed
- for Windows NT, OS/2 developers will probably have to wait a while before these
- frameworks become widely available. However, more specialized class libraries
- are available from a variety of other third-party sources. In addition, most
- C++ compilers ship with general-purpose class libraries of some sort. The
- Smalltalk language is notable because its standard implementation calls for a
- large set of ready-to-use object classes.
-
-
- ΓòÉΓòÉΓòÉ 7.4.5. CASE Tools ΓòÉΓòÉΓòÉ
-
- If you need to get a program or prototype together as quickly as possible, you
- might be interested in one of the CASE tools available for OS/2 PM. CASE, which
- stands for computer aided software engineering, can quickly generate parts of
- your program's user-interface or execution logic. Tools like Gpf 2.0 from Gpf
- Systems or Case:PM VIP from Caseworks Inc. enable you to construct dialog boxes
- and windowed interfaces using a variety of easy-to-use editors and code
- builders. When your design is completed, the CASE tool generates the C code
- necessary to carry out your interface. The generated code is usually
- extensively commented and can be very useful as a learning aid that shows
- various programming techniques and operations. However, because the code is
- usually limited to the user interface, you need to modify it in strategic areas
- and add the customized functionally that your application requires. The CASE
- tools generally suggest where you should add your own processing logic and help
- you incorporate it into the final executable file.
-
- Caution: Most CASE tools do not come with a compiler or debugger and may also
- require that you purchase a developer's toolkit. Although this isn't
- a major failing, don't forget to factor these expenses into your
- purchasing decision.
-
-
- ΓòÉΓòÉΓòÉ 7.4.6. IBM's Offerings ΓòÉΓòÉΓòÉ
-
- During OS/2's development, IBM realized that a key to getting developers to
- write quality 32-bit applications was to provide them with a robust and
- sophisticated suite of tools. Their answer was the C Set/2 compiler and
- debugger, the Developer's Toolkit, and the WorkFrame/2 (bundled together, IBM
- calls these tools the WorkSet/2). Because IBM's tools are so important and are
- in such widespread use, I will provide a more detailed look at these tools in
- later sections.
-
- The C Set/2 compiler is a native 32-bit C and C++ compiler that can build
- full-screen text-mode, windowed text-mode, and PM programs (with the optional
- Developer's Toolkit). The compiler supports all the standard OS/2 system
- facilities such as multithreading, DLLs, and double-byte character sets. As of
- 2.1, the compiler also supports the creation of virtual device drivers (VDDs)
- and programs written in C++ (including advanced features like templates and
- exception handling). Hardware and software manufacturers typically use VDDs to
- allow integrated operation of their products in the OS/2 environment. The
- compiler supports IBM's Systems Application Architecture (SAA) and the American
- National Standards Institute (ANSI) C language specification.
-
- A 32-bit PM debugger accompanies the C Set/2 compiler. With this debugger, you
- can view your source in its native format, assembly language, or a combination
- of the two. It has extensive support for breakpoints and watchpoints, in
- addition to an interesting variable monitor display with which you can display
- structures in detail or collapse them into a single entity. You can easily
- trace and examine linked lists and other dynamic data structures that depend on
- pointer links. Absent, however, is the capability to cast an arbitrary piece of
- memory into a given structure.
-
- Tip: Like many PM-based debuggers, effective use of the C Set/2 debugger often
- requires opening many separate windows for variable inspectors, source
- views, register displays, and so on. Therefore, I highly recommend using
- the debugger with a high- resolution display adapter (800x600) and a
- large monitor (15 inches diagonal or greater). At normal VGA resolutions,
- you can easily run out of screen real estate.
-
- One of the most innovative components of IBM's tool offering is the
- WorkFrame/2. In its simplest form, it is an integrated development
- environment. Perhaps the most interesting facet of the WorkFrame's approach is
- that it is inherently tool-independent. Unlike Borland's IDE, which forces you
- to use the environment's built-in editor, the WorkFrame enables you to use
- your own text editor. You can usually easily integrate any external tool into
- the WorkFrame environment. You can add most third-party utilities and
- development tools to the WorkFrame environment simply by filling in a dialog
- box.
-
-
- ΓòÉΓòÉΓòÉ 7.4.7. Borland's Offerings ΓòÉΓòÉΓòÉ
-
- Borland's popular and elegant development products have long been favorites of
- professional and amateur programmers. Borland was the first company to release
- a comprehensive and affordable C++ compiler for DOS and Windows platforms. IBM
- realized early on that versions of Borland's C++ products would help
- dramatically boost developers' interest in OS/2. Borland's C++ comprises
- several separate components. Although a host of accompanying utilities are
- included, the main tools are the IDE, the command-line compiler, and the
- debugger. Figure 14.2 shows the IDE and the debugger in action. Although
- integrated programming environments have been around for years, Borland set the
- standard when it introduced its DOS-based C++ product in 1990. Since then, the
- company has continued to refine the IDE's interface, and OS/2 programmers now
- have the opportunity to use a faithful port of the DOS favorite.
- Figure 14.2. Borland's C++ for OS/2.
-
- The OS/2 version takes advantage of the operating system's capability to
- efficiently multitask (editing source files while seamlessly compiling in the
- background). Borland's grouping of programs into projects allows the built-in
- compiler to generate internal dependency lists with ease. The compiler only
- recompiles those modules that need it, saving you time that might be wasted if
- the system recompiled all your source code every time you made a change to a
- module. The IDE's editor also offers syntax highlighting. With this interesting
- feature, you can display various parts of your program in different colors,
- depending on the function. You might specify that reserved words, for example,
- should appear in black and variable names should appear in green. This feature
- is definitely an acquired taste and takes a little time to get used to.
-
- The IDE has its own built-in compiler, but Borland also supplies the same
- compiler in a command-line version, complete with accompanying make program.
- One of the IDE's biggest deficiencies is that to fully take advantage of it you
- need to use the editor supplied with the environment. Although this editor is
- more than adequate for most programmers, it may not have the same features or
- keyboard mappings of your favorite text editor. Although you can change the
- keyboard mappings (with some difficulty), you'll have a hard time simulating
- features that are not built-in to the IDE's editor. With the command-line
- version of the compiler, you are not tied into using the IDE and its editor. If
- you opt to use the command- line version, you lose the IDE's project management
- capabilities, syntax highlighting, integrated debugger, and
- "fill-in-the-blanks" compiler support. Instead, you are free to use any editor
- you want. Because OS/2 supports virtually any DOS, Windows, or native OS/2
- program, I'm sure that many programmers waive the sexy IDE in favor of their
- favorite editor. I should also note that Borland supports integration of their
- command-line compiler with IBM's generic WorkFrame/2 (discussed later in this
- chapter). If you are a fan of IDEs but are determined to use your own editor,
- the WorkFrame may be just the right compromise.
-
- One of the most successful DOS/Windows debuggers is Borland's Turbo Debugger.
- Although the Borland development team built the Turbo Debugger for OS/2 from
- scratch, it retains many strengths and features that have made its DOS-based
- siblings so endearing to programmers. However, this debugger is OS/2 all the
- way through-it supports the dynamic tracking of multithreaded programs and is
- particularly effective in debugging PM programs. Borland used mouse button 2 in
- a project before IBM made it an integral part of the Workplace Shell, and the
- button's continued use in the Turbo Debugger gives it the look and feel of a
- native Workplace Shell application. Because this debugger resembles IBM's C
- Set/2 debugger in many ways, the same advice about using a high-resolution
- display definitely applies to the Borland counterpart.
-
-
- ΓòÉΓòÉΓòÉ 7.4.8. Other Vendors ΓòÉΓòÉΓòÉ
-
- It is a credit to OS/2's growing popularity that I can't even come close to
- listing all the fine programming products and development aids available from
- independent software vendors. A recent copy of IBM's OS/2 Application Solutions
- catalog contained more than 1,400 OS/2 program titles (more than 250 of them
- are development-oriented applications). I will, however, point out some
- prominent names that are shipping or working on new OS/2 releases.
-
- Watcom, Symantec, and MicroWay have announced intentions to bring C or C++
- compilers to market. Digitalk is the Smalltalk powerhouse under OS/2 2.1 with
- their Smalltalk/V PM product. Micro Focus, a longtime supporter of OS/2, is
- working on an OS/2 2.1 COBOL product. Clarion is keeping busy as it readies C,
- C++, Modula-2, and Pascal compilers. Most of these vendors already have
- supporters from previous versions of products targeted for OS/2 or DOS, so
- support for these offerings should be very positive.
-
- CASE tool vendors are heating up the market in a big way. Caseworks Inc. has
- updated Case:PM to take advantage of the operating system's new capabilities.
- This new version is called Case:PM VIP and supports all the new OS/2 controls,
- as well as those constructs required to comply with IBM's ambitious CUA '91
- user-interface guideline specification. Gpf Systems has released a 32-bit
- version of their impressive and well-received Gpf applications development
- tool. Enfin Software Corp, Guild Products, and Intelligent Environments are
- making other CASE tools available. The Stirling Group is releasing several
- useful tools, including a comprehensive resource editor called ResourceShield
- that enables programmers to edit icons, bitmaps, dialog boxes, and other PM
- objects.
-
-
- ΓòÉΓòÉΓòÉ 7.4.9. Shareware and Freeware ΓòÉΓòÉΓòÉ
-
- Although many products are available from third-party commercial software
- vendors, people are often amazed to find affordable software as freeware and
- shareware. Freeware is just that: free. You can copy a program marked as
- freeware, give it away, and indiscriminately use it at will. Shareware
- typically involves a small fee, but these prices are often considerably cheaper
- than their commercial equivalents.
-
- Caution: Some freeware or shareware authors allow others to use their programs
- only under specific conditions. For example, an author may say that a
- program and its source code are absolutely free, but only if you do
- not alter them and pass them on to other individuals. Be sure you
- understand a program's restrictions before using it.
-
- The primary sources of freeware and shareware are electronic bulletin boards
- and large online services like BIX, Prodigy, and CompuServe. CompuServe's
- OS2DEV forum contains an assortment of programming-related files available for
- downloading. One gem that can be found online is INIMAINT, a program that
- helps you browse and modify your INI files. Your OS2.INI and OS2SYS.INI files
- contain most of the information about the Workplace Shell desktop, and with
- this program you can get at almost all of it. SHOWDLLS is a program that
- displays a list of the DLLs used by an EXE or DLL. This program is invaluable
- for tracking down the hordes of problems that can arise when multiple versions
- of the same DLL are accidentally or inappropriately installed on the same
- machine. You can find a large assortment of sample OS/2 source code online.
- One effective way to learn how to program OS/2 is to pick through the source
- code of a proven program.
-
- In a bit of irony, one of the first C++ compilers available for OS/2 is
- absolutely free. You can locate the GNU C/C++ compiler from the Free Software
- Foundation on Internet and electronic bulletin boards across the country.
- Although this package does not include many frills apart from the compiler, it
- hardly matters considering the price you'll pay (you even need to obtain the
- make program separately, although the Free Software Foundation's version is
- also free). The GNU compiler is a mature product, and renowned companies like
- NeXT and Quarterdeck have adopted it as their C compiler standard.
-
- If you have experience on UNIX systems, you will be happy to hear that many
- UNIX development tools have been ported to OS/2. Many of these programs are
- available for free or for a nominal price. Various programmers have ported the
- Free Software Foundation versions of Awk and Make. The GNU Make program is
- unique in that it supports different compilings on separate threads. Other
- UNIX utilities found on various bulletin boards and CompuServe include YACC
- and GREP. Aficionados of the remarkably complete EMACs editor will not be
- disappointed; the full-blown EMACs are available under OS/2, as well as a
- scaled-down version called MicroEMACs.
-
- IBM has begun a unique program that distributes useful and interesting
- programs and programming aids that employees have developed on their own time.
- Many of these programs are extremely useful, although not all of them are
- related to programming. My favorite, PMTREE, enables the programmer to
- manipulate PM windows and modify their internal attributes. You can send event
- messages and user-defined messages to almost any window. BOOT20 can be a
- lifesaver of a program if you need to boot from a floppy disk drive to perform
- maintenance work. With this, you can create an OS/2 boot disk with varying
- levels of Workplace Shell support. This program is especially useful if OS/2
- was already installed on your computer without accompanying installation
- disks. These programs-and others that IBM has approved for release through
- their Employee Written Software program (OS2EWS)-are available on IBM's OS/2
- bulletin board system and CompuServe.
-
- The programs mentioned here are only a few examples of the kind of quality
- software that you can find online. Spending a brief amount of time tracking
- down a useful utility can often save hours of frustrating work later.
-
-
- ΓòÉΓòÉΓòÉ 7.5. Installing the WorkSet/2 ΓòÉΓòÉΓòÉ
-
- As I noted earlier, IBM's WorkSet/2 product is a bundling of the C Set/2
- compiler, the Developer's Toolkit, and the WorkFrame/2 integrated development
- environment. Although IBM delivers these components together, they are each
- individual tools that you need to install separately.
-
- Note: If you plan to use the WorkFrame/2 with the C Set/2 compiler, you must
- install the WorkFrame first. The C Set/2 installation program copies
- certain configuration files and DLLs into WorkFrame directories. If you
- do not install the WorkFrame, these directories will not exist, and the
- compiler installation program will assume that you don't want to use the
- C Set/2 in accord with the WorkFrame.
-
-
- ΓòÉΓòÉΓòÉ 7.5.1. Installing the WorkFrame/2 ΓòÉΓòÉΓòÉ
-
- The WorkFrame installation process begins by placing the disk labeled IBM
- WorkFrame/2, Diskette 1 into the A: drive and running the INSTALL program. The
- initial install options for this component are straightforward; set the target
- drive and path appropriately. If you choose to not have your CONFIG.SYS file
- modified, you must manually add the WorkFrame DLL directory to your LIBPATH
- statement. The basic installation takes up a little more than 1.5 megabytes of
- hard disk space, so be sure you plan accordingly.
-
- You can easily install the WorkFrame from a LAN drive by using the XCOPY
- command to copy the installation disk to a directory on the shared disk. Users
- with access to this directory can then move into this directory and run the
- INSTALL program from there.
-
- Tip: If you are interested in speeding up the installation process, here's a
- little trick that works for the WorkFrame/2, C Set/2 compiler, or Borland
- C++ compiler installations (unfortunately, you cannot use this procedure
- to install the Developer's Toolkit): create a directory on you local hard
- disk called \INSTALL and XCOPY the contents of the installs disks into
- it. Then move into this directory and run the appropriate installation
- program. When asked for the location of files, or when the program
- prompts you to insert the next disk, simply modify the default entries
- and make sure that they reference your new \INSTALL directory. You should
- not try to install all three of the above mentioned products at once.
- Copy one product's disks onto the hard disk, install it, erase the
- contents of the directory, and then move on to the next product. Because
- your hard disk is substantially faster than your floppy disk drive, the
- decompression procedures that all three of these products employ will run
- much faster.
-
- You can also install the WorkFrame onto a network drive and share it with
- multiple users. To do this, install the WorkFrame into a directory on the
- shared LAN drive. Each user who wants access to the WorkFrame needs to run the
- Adduser utility (shown in Figure 14.3) to establish the necessary environment.
- Although the Adduser program does not copy the WorkFrame executable files and
- DLLs to the user's workstation, it creates an IBMWF.INI into which it places
- the users' profile. If told to do so, the utility also copies language
- profiles, projects, and bitmaps. The WorkFrame uses the language profiles
- whenever it performs any useful actions (for example, compile, link, and build
- Help files). Therefore, the user should copy these profiles despite the
- Adduser utility's insistence that this operation is optional. Select the other
- two options as you deem appropriate. Figure 14.3. The Adduser installation utility.
-
-
- ΓòÉΓòÉΓòÉ 7.5.2. Installing the C Set/2 Compiler ΓòÉΓòÉΓòÉ
-
- Begin the installation by placing the disk labeled IBM C Set/2, Diskette 1 into
- the A: drive and executing the INSTALL program. Remember that a complete
- installation consumes almost 10 megabytes of disk space. In the main
- installation dialog box, shown in Figure 14.4, you can specify which components
- you want to copy onto your hard disk. (The screen display depicted in Figure
- 14.4 shows a pre- release version of the IBM C Set/2, Version 2.0 installation
- program. Your screen may appear slightly different.) Most of the options are
- obvious-the check boxes for the compiler, debugger, profiler, C++ code browser,
- WorkFrame support, and sample programs select those items for installation.
- Except for the online portion that you can read with OS/2's VIEW utility, the
- documentation requires IBM's BookManager Read/2 product for viewing. IBM does
- not include the BookManager program with the compiler product, so unless you
- already have it on your machine, you can save more than 1.5 megabytes of disk
- space by opting not to install these electronic documents. Figure 14.4. C Set/2
- compiler installation options.
-
- Tip: If you have trouble finding an explanation of the C Set/2 installation
- process in the documentation, don't despair. The procedure is described
- on a small reference card that is simply marked C Set/2 Installation.
-
-
- ΓòÉΓòÉΓòÉ 7.5.3. Installing the IBM Developer's Toolkit for OS/2 2.1 ΓòÉΓòÉΓòÉ
-
- The Developer's Toolkit is the largest of the three components, spanning nine
- 3.5- inch disks. Although you can write OS/2 programs without the Developer's
- Toolkit, you won't be able to write programs that interact and take advantage
- of the PM. You also won't be able to build and run all the sample WorkFrame
- projects that are shipped with the C Set/2 product. For these reasons, I
- strongly recommend that you install this component. The Toolkit occupies about
- 24 megabytes of disk space when fully installed.
-
- Begin the installation by placing the disk labeled IBM OS/2 Developer's
- Toolkit, Diskette 1 into the A: drive and running the INSTALL program found on
- that disk. Unlike the previous two components, the Toolkit's installation
- program does not display an initial dialog box. As you can see in Figure 14.5,
- the program gives you the option of installing three separate items, all of
- which are useful and recommended, although only the third one (Development
- Tools) is absolutely required to develop PM programs. To begin the
- installation, choose the Install selection from the Options menu.
-
- Caution: If you want to install the Toolkit on a drive other than the C:
- drive, choose the Set drives selection from the Options menu and make
- the appropriate changes in the presented dialog box. If you don't do
- this, the installation program will assume that you want the selected
- items to be copied to the C: drive.
-
- Figure 14.5. IBM Developer's Toolkit for OS/2 2.1 installation options.
-
- At this point you should have all three of the WorkSet/2 components installed
- on your hard disk. You now need to reboot your computer for the changes made
- to your CONFIG.SYS to take effect. If you elected not to allow the
- installation programs to modify your CONFIG.SYS, be sure that you add the
- appropriate entries to your LIBPATH before using any of the components.
- Congratulations-you are finally ready to compile and run your first OS/2
- program!
-
-
- ΓòÉΓòÉΓòÉ 7.6. Starting and Testing the WorkFrame/2 ΓòÉΓòÉΓòÉ
-
- The installation process has conveniently created two command files so you can
- set various environmental variables that the compiler, WorkFrame, and Toolkit
- need. You can find the first file, CSETENV.CMD, in the C Set/2 BIN directory
- (if you installed using the defaults, this is C:\IBMC\BIN). This command file
- prepares the environment but does not execute any program. You can find the
- second command file, IBMWF.CMD, in the WorkFrame BIN directory (if you
- installed using the defaults, this is C:\IBMWF\BIN). Because this command file
- runs the WorkFrame, you need to run the CSETENV.CMD file before this one. Of
- course, by combining the two command files, you can set up and run the entire
- environment at once. You may find it easier to launch the WorkFrame directly
- from the Workplace Shell objects that the installation programs created. If you
- allowed the installation programs to directly modify your CONFIG.SYS, this
- method should work fine.
-
- If you are using the Developer's Toolkit and you did not allow the
- in-stallation programs to modify your CONFIG.SYS, you may want to add the
- following entries to your CSETENV.CMD file. Be sure that the C:\TOOLKT20\C\OS2H
- directory is appended to the INCLUDE environ-mental variable and that the LIB
- environmental variable includes the C:\TOOLKT20\OS2LIB directory. Of course, if
- you installed the Toolkit on a drive other than the C: drive, you need to make
- changes accordingly.
-
- Tip: If you need to program with multiple compilers, you might want to create
- a command file that sets up the appropriate environment for each product.
- You can then create a new Workplace Shell object for each command file.
- Place an asterisk in the path and filename field of the object's Program
- tab. This indicates to OS/2 that you want to start a new command prompt
- window. Now place the arguments /K X.CMD in the Parameters field, where X
- is your new command file's name. This tells OS/2 to execute the indicated
- command file immediately after creating the new prompt window. Now, every
- time you open this object, a new command-line appears that is
- specifically configured for one of your programming systems. Using this
- mechanism, I have four distinct development environments on my machine,
- each using a different compiler and set of tools.
-
- To test your newly installed products, I recommend building one of the sample
- projects included with the C Set/2 compiler. Start the WorkFrame using the
- previously described command files or launch it from its desktop icon. You
- should see the central work environment screen illustrated in Figure 14.6. The
- WorkFrame segregates programs into separate projects (which I will discuss in
- detail a little later), and the C Set/2 compiler ships with four sample
- projects. The PMLINES program demonstrates multithreading and PM graphical
- programming techniques. You can select this project by double-clicking the
- project entry in the Project Control window. The window that appears is called
- the Project window, and it contains a list of all the relevant files that
- belong to this project. You can create the PMLINES program by selecting the
- Make option from the Actions menu or by simply typing Ctrl-M. After the Make
- window has appeared and the executable file has been built, you can run the
- program by selecting the Run option from the Actions menu or by typing Ctrl-R.
- Figure 14.6. The IBM WorkFrame/2.
-
-
- ΓòÉΓòÉΓòÉ 7.7. Using the WorkFrame/2 ΓòÉΓòÉΓòÉ
-
- You can't deny that writing OS/2 applications can become a complex process, and
- WorkFrame does a good job of organizing the programming procedures that you
- will use. The WorkFrame accomplishes this is by giving you a great deal of
- flexibility in how you switch from one window to another and from one running
- program to another.
-
-
- ΓòÉΓòÉΓòÉ 7.7.1. The Window Lists ΓòÉΓòÉΓòÉ
-
- One mechanism that the WorkFrame uses to help organize the development process
- is to divide on- screen windows into two categories: sessions and dialogs. A
- session window belongs to a program that is not an integral part of the
- WorkFrame. Examples of session windows include editors, command windows, and
- tools that you have indicated should run in the foreground. Conversely, a
- dialog window belongs to the WorkFrame program or a tool configured to run in
- background mode. Examples of dialog windows include the main Project Control
- dialog window, the Action Log window, and the individual Project windows.
- Dialog windows generally remain on top of the main WorkFrame/2 window; session
- windows may be hidden from view by placing them beneath the WorkFrame.
-
- The key to switching rapidly between session windows and dialog windows is the
- Window menu that appears on the main WorkFrame menu bar. This menu contains two
- submenus that list the currently active session and dialog windows. You can
- move into any window listed on either of these menus by selecting the
- appropriate entry. Using the Window menu, you should quickly become accustomed
- to zipping from one view to the next.
-
-
- ΓòÉΓòÉΓòÉ 7.7.2. The Switch List and the Window Shade ΓòÉΓòÉΓòÉ
-
- Although the WorkFrame allows a high level of integration with external tools
- and utilities, occasions will arise when you need to interact directly with
- OS/2 or use a program that you cannot incorporate into the WorkFrame. In these
- cases, you can use the switch list to jump to processes that are already
- running. You can also use the window shade to gain easy access to Workplace
- Shell objects.
-
- The switch list, found under the Switch List menu, provides a limited display
- of those programs that are currently running. To switch to another program,
- simply select the desired program name from the switch list. However, because
- the switch list does not necessarily display all currently running programs,
- you may need to modify it. You can accomplish this by selecting the Switch List
- panel of the Configure menu. The WorkFrame presents you with a dialog box with
- a list of the currently running processes from which you can select programs.
-
- This feature can be very useful, but I urge you to limit the number of entries
- that you add to the list. Although it is technically possible to add many
- active programs to the Switch List, this feature follows the law of diminishing
- returns. Once you have added seven or eight items, you will probably find
- yourself spending a significant amount of time searching for the desired
- program within the menu list. As a rule, the Switch List should be long enough
- to fit those processes that you use most often, but not long enough to hinder
- your ability to quickly switch from one program to another.
-
- The window shade is just another way of looking at the central WorkFrame work
- window. A bit of experimentation reveals that you can resize this window just
- like any other Workplace Shell window. The user can raise or lower the window
- shade by "grabbing" the window's lower edge and dragging it up or down to its
- desired height. By furling and unfurling the window shade in this manner, you
- can reveal or hide the desktop and its associated views. Clicking desktop
- objects brings them to the top of the window stack and makes them easily
- accessible. The window shade provides a convenient way to conceal or expose
- parts of the desktop that are of interest to the developer. Although I don't
- find myself resizing the shade very often, I always keep it at a level that
- grants me at least partial access to the desktop.
-
-
- ΓòÉΓòÉΓòÉ 7.7.3. Adding Tools to the Working Environment ΓòÉΓòÉΓòÉ
-
- he WorkFrame also provides an easy way to launch tools and utilities. The Tools
- menu provides access to features like make file generation and library
- services, but the programmer can also customize it. Tools placed on this menu
- also have a convenient hot key automatically assigned to them so you can
- quickly start a tool with a single keystroke. To add a tool entry to this menu,
- or to remove a tool that is already on it, select the Tools option from the
- Configure menu. You'll see a list of the tools already installed. From this
- dialog box, you can easily delete or modify tools that are already installed or
- add new programs. Clicking the New button brings up a dialog box like the one
- depicted in Figure 14.7. Figure 14.7. Adding tools to the WorkFrame/2 environment.
-
- Filling in the New Tool dialog box is a straightforward process, although a
- couple of important things are probably worth mentioning. You can specify
- parameters to be passed through to the tool program by placing them in the
- Invocation string field. If you are starting a command file instead of an
- executable file, be sure to check the Command File box, or the spawning of the
- utility process will probably fail. The Background/Foreground radio button
- group dictates the specific screen behavior of the tool. Tools executing in the
- background are effectively invisible, and the user can't direct interactions
- with them; instead, the WorkFrame captures their output and presents it to the
- user in a Monitor window. On the other hand, tools executing in the foreground
- are created in their own window or full-screen session, and the programmer
- interacts with these programs in the appropriate manner. Remember that tools
- running in the foreground are added to the Sessions list in the Windows menu
- and that they can be optionally added to the Switch List.
-
-
- ΓòÉΓòÉΓòÉ 7.8. Building a Project ΓòÉΓòÉΓòÉ
-
- WorkFrame organizes your development work into a collection of projects. A
- project is a collection of files contained in the same directory and a set of
- WorkFrame specific settings that describe the prominent characteristics
- associated with these files. These settings, which you can easily set using
- various WorkFrame dialog boxes, include features such as language profiles,
- compiler options, and linker settings.
-
-
- ΓòÉΓòÉΓòÉ 7.8.1. Base and Composite Projects ΓòÉΓòÉΓòÉ
-
- The WorkFrame recognizes two different types of projects: base projects and
- composite projects. A base project has a single target that is either an
- executable file (.EXE) or a supporting dynamic link library (.DLL). To
- accommodate larger programming systems that may contain many executable files
- and DLLs, the WorkFrame supports composite projects. A composite project is a
- collection of base projects bound together into a single conceptual unit.
- Selecting the Make command from a base project builds that project's single
- target, whereas selecting Make from a composite project causes each of the
- included base projects to be built one at a time.
-
- The WorkFrame displays projects in the central Project Control dialog box. (If
- this dialog box is not visible, you can open it using the Project Control item
- in the File menu). This dialog box contains options for creating new projects
- and deleting or modifying preexisting projects. You open project entries by
- clicking the Open button or by double-clicking directly the project entry. Each
- open base project has its own Project window that displays a list of the files
- that reside within the project directory. Each open composite project has a
- Project window that lists the base projects that belong to it. You can
- double-click these base project names to open their respective base Project
- windows.
-
- Tip: You can limit the files displayed in the base Project windows by
- modifying the File Mask entry field. This field accepts one or more wild
- card expressions that determine which files get included in the main file
- list box. For example, if you only want to see your C source files and
- header files, you might enter a file mask entry of *.C *.H.
-
- The Actions menu is one of the most frequently used WorkFrame menus. All the
- commands that you need to build, run, and debug your application appear in
- this menu, with accelerator keys defined for faster access. For example, to
- compile the source files currently selected in the base Project window, type
- Ctrl-C; to run your application in the C Set/2 debugger, type Ctrl-D. With
- regular use these keystrokes will become second nature to you.
-
- Tip: The WorkFrame uses drag-and-drop extensively throughout its user
- interface. Source files can be dragged from project window to project
- window, providing an easy way to copy source code between projects.
- Files can also be dragged from project windows into the deletion window
- in much the same way that you can drag Workplace Shell objects into the
- shredder. Experiment! You might be surprised by some of the things that
- the WorkFrame lets you do.
-
-
- ΓòÉΓòÉΓòÉ 7.8.2. Setting C Set/2 Compiler Settings ΓòÉΓòÉΓòÉ
-
- Every compiler that supports the WorkFrame ships with a DLL that enables the
- user to seamlessly set command-line compiler switches through dialog boxes. The
- C Set/2 compiler is no exception. One of the first things you need to do when
- creating a new project is to ensure that the compiler settings are appropriate
- for the program you are trying to build.
-
- When you first create a project, the WorkFrame prompts you with a dialog box
- containing buttons that relate to each of the program build phases (for
- example, make, compile, link, debug, and run). You can also get this dialog box
- by clicking the Change button in the Project Control window. Each of the
- displayed buttons causes the C Set/2 DLLs to display dialog boxes that relate
- to each of these phases. For example, clicking the Compile options button
- brings up a transitional dialog box that enables you to control many different
- aspects of the compilation phase. Clicking the Object code control options
- button displays the dialog box, shown in Figure 14.8, that enables you to set
- most of the important options relating to target type (EXE or DLL),
- multithreading, the target processor, and so on. Although you can modify and
- set many dialog boxes, anyone with command-line compiler experience will admit
- that this approach is much easier to understand and use. If you don't have any
- command-line experience, consider yourself lucky. This is definitely one of the
- quickest and least painful ways to break into OS/2 programming.
-
- Tip: The compiler, linker, make, debug, and run settings are also individually
- accessible under the Options menu.
-
- When you are satisfied that you've correctly adjusted your project settings,
- you need to generate the make file and dependency file that the WorkFrame uses
- to build your application. Do this by selecting the Make File Creation option
- from the Tools menu. With the Make File Creation dialog box, shown in Figure
- 14.9, you can select the files you want to include in the build process. You
- also use this dialog box to indicate which actions you want to be incorporated
- into the build process. Therefore, you might select all the C files from the
- file list box on the right and the Compile and Link options from the Actions
- list box on the left. This ensures that the correct entries for compiling your
- source files into object modules are added to the make file and that the make
- file correctly links your object modules. If you are building a complex PM
- program, you might take advantage of the Resource compile, Message file, and
- IPF compile actions. Clicking the OK button creates the make file and enables
- the WorkFrame to build your target correctly. Figure 14.8. A C Set/2 compiler
- options dialog box.
-
- Tip: Buttons that enable you to modify your project's compile and link
- options are conveniently located in the center of this dialog box. If
- you realize that you've made a mistake when setting the compiler options
- or if you simply decide that you want to change a particular setting,
- you can access the appropriate setting by clicking one of these buttons.
-
- Figure 14.9. The Make File Creation dialog box.
-
-
- ΓòÉΓòÉΓòÉ 7.9. Editing Source Files ΓòÉΓòÉΓòÉ
-
- Like programming tools, the WorkFrame treats program editors as external
- entities that can be set up and integrated directly into the development
- environment. You can find your editor configuration in the Editor selection
- under the Configure menu. The configuration dialog box prompts you for the path
- and filename of your editor's executable file and for any parameters that you
- want to be passed to the program in the form of command-line arguments. If you
- do not choose to provide your own editor, the WorkFrame defaults to the EPM
- editor that is installed with the base operating system.
-
- Tip: If you normally start your editor through a command file, set the Current
- Editor field to CMD.EXE and place /K X.CMD in the Editor invocation
- string field (where X is the name of your command file).
-
- The simplest way to edit a file is to double-click its entry in the Project
- window. This action starts your editor and makes it the active window. If your
- editor can accept filenames on its command-line, you may want to specify the
- substitution variables %a %z on the invocation string field of the editor's
- configuration dialog box. This allows the editor to automatically load the
- files selected in the Project window. Some editors even support close
- integration with the Make monitor window. If your editor can receive messages
- from the WorkFrame (consult your editor's documentation or call the editor's
- technical support line) you can double-click C Set error messages that appear
- in the Make window, and your editor will move the cursor to the appropriate
- line number. Although not many editors currently support this level of
- integration, hopefully this will change as WorkFrame use becomes more
- prevalent.
-
- Tip: If your editor cannot accept multiple filenames on its command-line, use
- the substitution variable %f instead of %a %z. The %f variable specifies
- that only the first filename should be passed through to the editor,
- whereas the %a %z variables pass every selected filename. Passing too
- many filenames may cause your editor to generate errors or refuse to
- load.
-
-
- ΓòÉΓòÉΓòÉ 7.10. Using the Online Documentation ΓòÉΓòÉΓòÉ
-
- The Developer's Toolkit comes with a great deal of online documentation in .INF
- file format. These files are read using the VIEW program that accompanies OS/2.
- If you let the installation programs modify your CONFIG.SYS, your environment
- has been set up to allow easy access to online documents. You should be able to
- acquire general OS/2 programming information by typing VIEW PROGREF20 and PM
- programming information by typing VIEW PMREF.
-
- Note: If you did not directly modify your CONFIG.SYS at the time of
- installation, you may need to make a few modifications to your
- development environment in order to gain access to the online
- documentation. Be sure that the BOOKSHELF environmental variable is set
- (either from the command prompt, in your CONFIG.SYS, or in your
- CSETENV.CMD command file) so that the C:\TOOLKT20\BOOK directory is
- appended to it. If you installed the Developer's Toolkit somewhere other
- than the C: drive, be sure that you use the appropriate drive letter. To
- make access to the documentation even easier, I suggest you add the
- following entries to your CSETENV.CMD file:
-
- SET PROGREF20=GUIREF20.INF
- SET PMREF20=PMFUN.INF+PMGPI.INF+PMHOK.INF+PMMSG.INF+PMREL.INF+PMWIN.INF+PMWKP.INF
-
- When you first run VIEW to study the online documentation, it presents you
- with a Contents window that lists the major topics covered by the loaded INF
- files. The contents menu is hierarchical in nature, so you can expand the
- topics with subheadings by clicking the plus (+) sign that sits in the
- window's left margin (see Figure 14.10). Any heading or subheading can be
- double- clicked on; this displays the selected section in another window. You
- can efficiently browse the INF file using the buttons that run along the
- bottom of the main window, and you can search it using VIEW's built-in
- searching capabilities.
-
- The general OS/2 programming information files cover those aspects of the
- operating system that are called Control Program functions. These functions
- are not directly related or linked to the PM, but they instead provide basic
- operating system services. Examples of such OS/2 constructs include dynamic
- linking, the file system, memory management, message management (not to be
- confused with PM messages), semaphores, named pipes, and so on. Figure 14.10.
- The VIEW program with Control Program Reference loaded.
-
- The PM programming information files, on the other hand, relate to material
- exclusively related to PM, the Workplace Shell, and the System Object Model
- (SOM), which is the object-oriented programming foundation upon which the
- Workplace Shell sits. Because these systems can be quite complex, these INF
- files are considerably larger and a little more difficult to navigate.
-
- The Developer's Toolkit includes a useful documentation browser called
- KWIKINF. This utility allows you to press a hot key sequence that displays a
- list of online file topics installed on your system. This facility works from
- within PM and text-mode sessions and is the most convenient way to get at .INF
- files quickly. Use it as a form of instant online help-if you've ever gotten
- tired of typing VIEW PROGREF20, or even just help, this program will quickly
- become a favorite.
-
- KWIKINF uses special index files to help it find and search the online .INF
- files. These index files have an .NDX extension. In order for the utility to
- operate correctly, it is important that you define an environmental variable
- called HELPNDX that includes the name of your central KWIKINF index file. The
- program uses the BOOKSHELF environment variable when looking for this .NDX
- file, so be sure your index file can be found in one of the BOOKSHELF
- directories.
-
- Tip: The KWIKINF program suffers from the annoying limitation of only being
- able to use a single index file. If you have two (or more) index files
- that you want to include in your topics list, you need to combine them
- into a single master index file. Do this using the COPY command. For
- example, assume that you want to combine the DDE4.NDX file (which you
- can find in the \IBMC\HELP directory) with the EPMKWHLP.NDX file (which
- you can find in the \TOOLKT20\BOOK directory). The following command
- concatenates the two files and places them into a single index file
- called MASTER.NDX.
-
- COPY EPMKWHLP.NDX + DDE4.NDX MASTER.NDX
-
- Be sure that your HELPNDX environment variable is set to this master index
- file and that the index file is located in one of the bookshelf directories.
-
-
- ΓòÉΓòÉΓòÉ 7.11. Good Luck! ΓòÉΓòÉΓòÉ
-
- Although learning to program OS/2 can be intimidating at first, don't worry.
- Probably the most problematic aspect of the process relates to the fact that
- there is so much to learn. OS/2 is a large system with many exciting and
- interesting nooks and crannies. Don't feel like you need to explore them all at
- once. Keep at it. I guarantee you success.
-
-
- ΓòÉΓòÉΓòÉ 7.12. Author Bio ΓòÉΓòÉΓòÉ
-
- Chris Corry is a lead OS/2 2.1 developer for a programming team at American
- Management Systems in Arlington, Virginia. The team is responsible for
- developing a distributed IBM Client/Server imaging system that operates on LANs
- and host mainframes. His professional interests range from object-oriented
- programming to user-interface design. Corry holds a bachelor's degree form the
- University of Pennsylvania.
-
-
- ΓòÉΓòÉΓòÉ 8. Multimedia ΓòÉΓòÉΓòÉ
-
- In This Chapter
-
- What Is Multimedia?
- OS/2 as a Multimedia Platform
- IBM Ultimedia
- OS/2 Support for Multimedia Devices
- Multimedia Sampler
- MMPM/2 in Detail
- Using Unsupported CD-ROM Drives
- Multimedia Development Environment
- Future Multimedia
- Conclusion
-
- Because the OS/2 operating system is able to coordinate many things
- simultaneously, it may just be the best platform for PC multimedia. However,
- OS/2 seems to have entered the multimedia game late; few products are
- available that actually utilize the vast capability of OS/2. That could change
- rather quickly, however, as IBM releases development tools, along with the
- release of OS/2 2.1 that includes the Windows 3.1 multimedia capability.
-
-
- ΓòÉΓòÉΓòÉ 8.1. What Is Multimedia? ΓòÉΓòÉΓòÉ
-
- Multimedia is a term that often confuses both experienced and novice computer
- users. Some consider anything available on CD-ROM as multimedia, and others
- define not the storage medium, but the presentation technology. Especially with
- OS/2, what is sold to the consumer as "multimedia" is typically raw hardware.
- In other cases, games with sound and graphics are considered to be multimedia.
-
-
- ΓòÉΓòÉΓòÉ 8.1.1. CD-ROM ΓòÉΓòÉΓòÉ
-
- CD-ROM is merely a software distribution media, and this in itself does not
- guarantee multimedia. However, it is an important enabling technology for
- multimedia. To be more specific, it is important to understand that digitized
- audio and video consume a tremendous amount of computer storage. A 70-minute
- musical compact disc (CD) holds the equivalent of more than 600M of
- uncompressed computer data. Video data is even worse-600M holds a few minutes
- worth of uncompressed television-quality video. Now you know why those video
- laser discs are so much larger than CDs.
-
- CD-ROM is quickly gaining importance in the computer industry. CD-ROM is
- becoming a popular medium for large software products, including OS/2 2.1
- development tools. CD-ROM, in the form of the Kodak Photo-CD, is also gaining a
- lot of consumer interest. Kodak's Photo-CD format allows more than one hundred
- high-quality photograph scans to be placed on a single disc. These discs can be
- attached to special players and viewed on a color television. CD-ROM XA-
- compatible drives, however, can import these pictures into computer
- applications.
-
-
- ΓòÉΓòÉΓòÉ 8.1.2. Audio and Sound Effects ΓòÉΓòÉΓòÉ
-
- Some consider programs that present visual and sound information at the same
- time as multimedia. Using this definition, almost any game would be classified
- as multimedia. Technically this is true, as more than one form of media
- (presentation) is being used. However, defining what makes a game "multimedia"
- is truly a gray area; usually, games that use speech and extensive high-quality
- animation are considered multimedia.
- Figure 18.1. King's Quest V.
-
- Figure 18.1 shows Sierra's King's Quest V CD-ROM game. The CD-ROM version of
- this game includes digitized speech. The characters actually move their mouths
- in sync with the speech. This disc contains more than 115 megabytes of game and
- sound data.
-
- With business applications, voice annotation tends to make a program
- multimedia. Many Windows programs (and hopefully soon, OS/2 programs) now
- support "voice notes" that you can attach to a document. Lotus actually ships a
- version of 1-2-3 for Windows on CD-ROM with support for this type of activity.
- Wavefrom audio (WAVE) files have also become a common way to make everyday
- computer work a bit more entertaining. Even screen savers such as After Dark
- for Windows support audio!
-
-
- ΓòÉΓòÉΓòÉ 8.1.3. Animation and Graphics ΓòÉΓòÉΓòÉ
-
- Graphic animation is another area that relates to multimedia. Video capture and
- playback, graphic animation, and presentation programs are all examples of
- computer-controlled visual presentation aspects. Video animation typically
- comes in two forms: software-based and hardware-base animation. Later in this
- chapter, the IBM ActionMedia II hardware board is outlined. As it stands now,
- it is not possible to import and export video data as easily as text or
- graphics. Although there are currently no well- established standards for
- software-only video presentations, IBM is working on such a solution.
-
-
- ΓòÉΓòÉΓòÉ 8.1.4. Overall ΓòÉΓòÉΓòÉ
-
- Multimedia can be defined to mean programs that use nontraditional ways of
- communication. In some cases, this may mean using sounds. In the past, most
- sounds on a personal computer were used for entertainment. Now sounds can be
- used to add voice notes to spreadsheets and word-processing documents. Even
- with business applications, much of the multimedia sounds are intended for
- entertainment purposes.
-
- In other instances, these nontraditional ways of communicating employ graphics.
- Consider that graphics are already used to express ideas in OS/2-you may or may
- not consider this multimedia. What if the graphics are animated or fluid-motion
- like television? The hardware technology is heading in this direction, as is
- OS/2.
-
- As this fledgling technology matures, multimedia will come to mean all of these
- things combined. Programs that employ sound and animation (such as video) and
- control will be truly interactive multimedia. Some of this, however, is
- available today, and OS/2 can tap these products.
-
-
- ΓòÉΓòÉΓòÉ 8.2. OS/2 as a Multimedia Platform ΓòÉΓòÉΓòÉ
-
- OS/2 has several strengths relative to multimedia development and usage:
-
- o Preemptive multitasking allows multiple methods of output, such as sound
- and video at the same time (it also simplifies design issues for
- developers wanting to create such applications).
-
- o OS/2 can prioritize multitasking for time-critical activities such as
- video and audio capture.
-
- o Large memory resources can handle the huge data sets commonly associated
- with digital sound and video.
-
- o Graphical interface can facilitate user-friendly interfaces using
- sliders, knobs, and pushbuttons.
-
- o Well-developed programming interfaces standardize development of all
- aspects of multimedia software.
-
- o Support for existing DOS and Windows multimedia products.
-
- These are part of the reason that IBM has selected OS/2 as its premier
- Multimedia platform. IBM refers to its Multimedia products as Ultimedia.
-
-
- ΓòÉΓòÉΓòÉ 8.3. IBM Ultimedia ΓòÉΓòÉΓòÉ
-
- At this time, IBM's Ultimedia products are the best-supported hardware devices
- under OS/2. Hopefully this will change as OS/2 gains more popularity. IBM's
- Ultimedia product line is quite extensive, including several PS/2 machines that
- carry the Ultimedia name. The PS/2 Ultimedia workstations include XGA graphics
- capability, an internal CD-ROM drive, an M-Audio Capture and Playback adapter,
- and a high-speed SCSI controller (used for CD-ROM and fixed disks). These PS/2
- Ultimedia systems represent the best of IBM's "ready-to-run" multimedia
- workstations.
-
- As well integrated as the Ultimedia workstations are, they may not be for
- everyone. In respect to multimedia, IBM does not intend to leave previous
- computer owners in the past. It is important to understand that IBM has gone to
- considerable lengths to ensure that much of this technology is available in
- stand-alone cards and modules. In fact, IBM has done quite well in support of
- ISA systems. Obviously IBM would rather have you use their own PS/2 systems,
- but they will support you as an equal using competitors' systems. The OS/2
- operating system is another good example of this type of previously
- unprecedented IBM support.
-
- The following list contains a summary of OS/2-supported IBM Ultimedia hardware
- devices:
-
- PS/2 TV: an external device that enables you to receive and display
- television channels on your VGA or XGA monitor. PS/2 TV allows
- "picture-in-a-picture" viewing of video source on VGA and full-screen
- viewing on VGA and XGA. This unit has a built-in 181-channel cable- ready
- TV tuner, and it also supports base-band signals (VCR, video camera,
- laser disk, game machine, and so on). Although it is external, and can
- function with any system using VGA or XGA, it does interface with and
- requires a PS/2-style keyboard. The hardware operates independently of
- the computer, requiring no CPU attention. The device does not support any
- type of computer video capturing.
-
- ActionMedia II Display Adapter: an ISA or Microchannel board for complete
- digital video and sound. This device includes a SCSI interface for a
- CD-ROM drive. Intel/IBM developed Digital Video Interactive (DVI)
- standard playback (hardware-assisted compression and playback). It can
- playback pictures and digital audio simultaneously (30 frames per second,
- television quality). It includes a direct interface for base-band and
- S-VHS.
-
- ActionMedia II capture option: this can be added to the base board for
- capture purposes, and it supports real-time motion capture and
- super-quality, 24-bit, single-frame snapshots.
-
- M-Audio Capture and Playback adapter: an ISA or Microchannel board for
- capture and playback of digital audio with 8- or 16-bit sampling.
-
- 8516 Touch Display: IBM's XGA-class monitor designed for touch-based
- control. IBM has drivers available for both OS/2 and Windows
- environments. This can be used in place of a mouse. As mentioned, some of
- the PS/2 Ultimedia models ship with these options or they can be
- installed in other ISA or PS/2 machines. OS/2 currently supports all of
- these multimedia devices, along with some third-party boards such as the
- Creative Labs Sound Blaster and Sound Blaster Pro.
-
-
- ΓòÉΓòÉΓòÉ 8.4. OS/2 Support for Multimedia Devices ΓòÉΓòÉΓòÉ
-
- There are two ways of approaching the question of what devices are supported
- under OS/2: the base operating system includes support for SCSI-based CD-ROM
- drives; and individual device drivers are available for specific devices. Some
- of these devices are intended to interface with the MultiMedia Presentation
- Manager/2 (MMPM/2) package that IBM offers.
-
-
- ΓòÉΓòÉΓòÉ 8.4.1. Base OS/2 CD-ROM Support ΓòÉΓòÉΓòÉ
-
- If you have a SCSI CD-ROM drive that is usable under OS/2 2.1, you can run
- existing DOS and Windows Multimedia products such as Compton's MultiMedia
- Encyclopedia for Windows. Using third-party programs or MMPM/2 you can play
- CD-Audio (music discs) on CD-ROM drives. With the release of OS/2 2.1, almost
- all SCSI CD-ROM drives will enjoy native support, including CD-Audio.
-
- Even with the improved support of OS/2 2.1, few non-SCSI CD-ROM drives will
- have native support. For nonsupported CD-ROM drives, it is possible to use DOS
- drivers under OS/2 to create a single session capable of running DOS or Windows
- multimedia programs. This is outlined later in this chapter.
-
-
- ΓòÉΓòÉΓòÉ 8.4.2. Windows 3.1 Multimedia ΓòÉΓòÉΓòÉ
-
- OS/2 2.1 includes support for Windows 3.1 applications. This subsystem,
- WIN-OS/2, includes the WAV and musical instrument digital interface (MIDI)
- support that is now included with Windows 3.1. Several programs are already
- available to take advantage of this capability, including ones you might not
- normally expect. Lotus offers 1-2-3 for Windows Version 1.1 on CD-ROM that
- includes a multimedia tutorial called SmartHelp.
-
- Any WAVE and MIDI files designed for Windows 3.1 should work fine under OS/2
- MMPM/2. However, Windows 3.1 multimedia applications do not require the MMPM/2
- because the Windows 3.1 subsystem includes a self-contained multimedia
- capability.
-
-
- ΓòÉΓòÉΓòÉ 8.4.3. Multimedia Sampler ΓòÉΓòÉΓòÉ
-
- To date, most of the multimedia attention has been placed on CD-ROM titles. As
- mentioned earlier, a CD-ROM does not necessarily ensure that a product is truly
- multimedia. The following sections review just a few of the many CD-ROMs that
- are truly multimedia.
-
-
- ΓòÉΓòÉΓòÉ 8.4.4. Compton's MultiMedia Encyclopedia ΓòÉΓòÉΓòÉ
-
- Compton's MultiMedia Encyclopedia for Windows is perhaps one of the best
- examples of CD-ROM-based multimedia. Not only does it contain text for an
- entire encyclopedia, it also contains several still pictures, animation, and
- sound. The mass-storage strengths of CD-ROM shine in this data-intensive
- application, which includes the following features:
-
- o sound samples of famous speeches such as Martin Luther King's "I Have a
- Dream" speech
-
- o graphics snapshots of items described in the text (sample X-rays in the
- medical section, for example)
-
- o charts and graphs representing statistical data
-
- o maps
-
- Figure 18.2. Compton's MultiMedia Encyclopedia.
-
- Obviously the uses of multimedia for an encyclopedia are almost endless.
- Compton's is quite impressive but is just a sample of what will be available
- in the future. CD-ROM enables inexpensive duplication of the hundreds of
- megabytes required to store the large data sets for sound and graphics, let
- alone an entire encyclopedia!
-
- The graphical nature of Compton's MultiMedia Encyclopedia also helps in the
- location of information. Instead of traditional text-based searches, Compton's
- supports a graphics history line, among other organizations. See Figure 18.3
- for an example of this search method.
- Figure 18.3. Compton's time line search.
-
- Text from within the encyclopedia can be cut and pasted into other OS/2 or
- Windows programs. Figure 18.4 shows a portion of the text on "Radio,"
- including icons used to display pictures. You should also note the "see
- Television 'Technology'" and its associated icon (to jump to that location in
- the encyclopedia).
- Figure 18.4. Compton's text sample.
-
-
- ΓòÉΓòÉΓòÉ 8.4.5. National Geographic Multimedia Mammals ΓòÉΓòÉΓòÉ
-
- This disc is sort of a specialty encyclopedia. It serves as a good multimedia
- sampler (it makes extensive use of software-based video motion and CD-Audio
- playback). The software-based animation, which requires no special playback
- hardware, is quite impressive. Figure 18.5 shows the opening screen for the
- Mammals program.
- Figure 18.5. National Geographic's Mammals.
-
- The disc also features captured photographs of mammals, typically five or more
- for each mammal. The photographs are full-screen at 320x200x8 (x8 equals 256
- colors) resolution. A simple identification game is also included in this
- package.
-
- Tip: Compton's MultiMedia Encyclopedia for Windows does not include a print
- option. To print from this program, copy the current text or screen image
- to the clipboard and then copy it to another program to print. This
- method can also be used to transfer encyclopedia contents to your Windows
- or OS/2 word processor.
-
-
- ΓòÉΓòÉΓòÉ 8.5. MMPM/2 in Detail ΓòÉΓòÉΓòÉ
-
- Multimedia Presentation Manager/2 (MMPM/2) is an add-on to the base OS/2
- operating system that provides facilities for sound and video support. MMPM/2
- has a fully graphical installation program, and it enables you to cus- tomize
- the installation to your specific needs. Figure 18.6 shows the installation
- program (you can select or unselect each individual module from the list).
- Figure 18.6. The MMPM/2 - Installation screen.
-
-
- ΓòÉΓòÉΓòÉ 8.5.1. Sound Support ΓòÉΓòÉΓòÉ
-
- The base MMPM/2 product includes support for two types of sound:
-
- o WAV: digital audio files (in the same format as Microsoft Windows)
-
- o MIDI: synthesized audio files
-
- MMPM/2 includes a recorder and playback module for WAV and MIDI files. See
- Figure 18.7 for a view of the record and playback module. IBM has made the
- multimedia relatively device-independent; the same media player is used to
- control WAV, MIDI, and ActionMedia II video. With respect to sound, MMPM/2
- currently has drivers for the IBM M-Audio adapter, Creative Labs Sound
- Blaster, Creative Labs Sound Blaster Pro, and the MediaVision Pro
- AudioSpectrum. Figure 18.7. The Media Player for MIDI.
-
- Using Creative Labs Sound Blaster Pro, I recorded 60 seconds of music using
- the MMPM/2 Digital Audio Recorder. It was quite impressive to use two modems
- (both active at 14,400bps) and sample sound through a microphone at the same
- time. Using Pulse, OS/2 showed less than 30 percent CPU utilization on a
- 80486DX-33 ISA system. Uncompressed digital audio takes a con-siderable amount
- of storage-the 60-second sample took 1.3M of disk space.
-
-
- ΓòÉΓòÉΓòÉ 8.5.2. CD-Audio Support ΓòÉΓòÉΓòÉ
-
- OS/2 Multimedia Presentation Manager/2 includes a program to play CD music
- (CD-Audio in computer terms) discs. IBM also offers an employee-written
- multimedia explorer program that achieves the same results. This explorer
- program is distributed under the EWS (employee-written software) program; it is
- available on the OS/2 Professional Developers Kit CD-ROM, along with several
- OS/2 BBS systems and CompuServe.
-
-
- ΓòÉΓòÉΓòÉ 8.5.3. Video Playback/Capture ΓòÉΓòÉΓòÉ
-
- IBM's all-digital ActionMedia II adapter is nothing less than state-of-the-art,
- hardware-based video playback. The quality of the captured images is
- superb-it's equal to live television. Given the powerful digital video
- interactive (DVI) hardware compression, a normal fixed disk (or even a slower
- optical disk) can keep up with a 30-frame-per-second (fps) video signal. Even
- with extensive hardware compression, a 60-second video session took 9.3M of
- disks space.
-
- Note: IBM has OS/2 drivers for this SCSI port, and it achieves the same thing
- as any OS/2-supported SCSI adapter. When using this port and the
- appropriate drivers, your SCSI CD-ROM functions as a native OS/2
- device-accessible to all program sessions.
-
- The ActionMedia II base board has only playback capability; you must add a
- capture board for authoring. This board is capable of capturing and playing
- both digital video and audio at the same time.
-
- Note: Creative Labs, perhaps the leader in low-cost multimedia products, has
- released a still-frame ISA video capture and windowing board: the Video
- Blaster. Although it does not allow motion video capture or sport the
- quality of the ActionMedia II, it is less than one third of the price.
- Be careful when considering this board, however, as it does not
- currently function under OS/2 (including WIN-OS/2). The current ISA
- version of the board is also designed to work with systems with less
- than 15M of RAM; OS/2 users often have 16M or more. If you had 16M or
- more of system RAM, you would actually have to remove some to utilize
- the board. As an OS/2 user, it may be best to look at other boards or
- contact Creative Labs for information on future boards with better OS/2
- support. In any case, always research your needs carefully before
- assuming that a board is supported by the software you intend to use.
-
-
- ΓòÉΓòÉΓòÉ 8.5.4. Computer-Controlled Laser Disc ΓòÉΓòÉΓòÉ
-
- OS/2's Multimedia Presentation Manager/2 includes drivers necessary to control
- the video display of a Pioneer video disk player. One of your system's serial
- ports is used to synchronize actual video presentations with user commands and
- computer information. The video disk player is controlled through a serial
- port.
-
-
- ΓòÉΓòÉΓòÉ 8.5.5. Installation of MMPM/2 ΓòÉΓòÉΓòÉ
-
- IBM's MMPM/2 product is quite easy to install (see Chapter 1, "Installation,"
- for specific installation details). First, you want to be sure you have a
- supported device that is properly configured. The following sections summarize
- the requirements for some of the devices.
-
-
- ΓòÉΓòÉΓòÉ 8.5.5.1. IBM M-Audio ΓòÉΓòÉΓòÉ
-
- This is a sound board accessible through the MMPM/2 WAV and MIDI players.
- Drivers for this device ship with MMPM/2, and hardware configuration is
- accomplished with the reference disk included with the hardware.
-
-
- ΓòÉΓòÉΓòÉ 8.5.5.2. Pioneer Video Disk ΓòÉΓòÉΓòÉ
-
- MMPM/2 has the ability to control the operations of a video disk player; in
- most cases, this is used to play video in sequence with computer events (such
- as a menu selection). The video itself is processed within the video disk
- player; the computer is merely instructing the player which tracks to access
- and when to play and stop. This control is accomplished through a serial port,
- which is required for the player to be used with MMPM/2.
-
-
- ΓòÉΓòÉΓòÉ 8.5.5.3. CD-Audio ΓòÉΓòÉΓòÉ
-
- MMPM/2's CD-Audio player utilizes the SCSI command sequences to control the
- CD-Audio. OS/2 2.1 includes drivers capable of controlling these functions. The
- CD-Audio player works by instructing the CD-ROM drive to play an audio disk at
- the specified track. Fundamentally, all of the sound processing is performed by
- the CD-ROM, which is almost identical to a traditional non-computer CD music
- player. With external CD-ROM drives, there are typical RCA-type phono jacks for
- connection to an amplifier. Both internal and external drives have an 1/8-inch
- audio adapter (identical to those found on hand-held portable radios) for a set
- of headphones or tabletop speakers. Unless your sound board has specific
- provisions, it may be important to note that CD-Audio is not played through
- your sound board; two sets of speakers or additional routing cables may be
- required. With the correct routing cables, some of the sound boards will play
- both types of sound through one set of speakers.
-
-
- ΓòÉΓòÉΓòÉ 8.5.5.4. Sound Blaster/Sound Blaster Pro ΓòÉΓòÉΓòÉ
-
- Configuration of these boards is somewhat more complicated because you must
- know the IRQ and base address of your hardware adapter. Assuming you know
- these, the selection within MMPM/2 is quite simple because a list box is
- provided for each parameter. Typically, the Creative Labs sound boards come
- configured for IRQ 7 and base address 220. Once installed, these boards allow
- MMPM/2 to play MIDI and WAV files. Current releases of the drivers do not
- support external MIDI devices or MIDI recording. Checking with Creative Labs is
- advised to get the latest status on these features.
-
-
- ΓòÉΓòÉΓòÉ 8.5.5.5. MediaVision Pro AudioSpectrum ΓòÉΓòÉΓòÉ
-
- Drivers for this device are included with OS/2 2.1 MMPM/2 to support its audio
- features. MediaVision has also made drivers available to control the
- Trantor-based SCSI function on the SCSI Pro AudioSpectrum boards. You install
- these as any other OS/2 SCSI driver, and they also support fixed disk and other
- supported SCSI devices. Some of the Pro Audiospectrum boards are based on a
- SonyBus CD-ROM interface, for which CD-ROM drivers do not yet exist.
-
- Note: When working with the Creative Labs Sound Blaster or MediaVision Pro
- Audiospectrum, especially the ISA versions, it is important to consider
- proper IRQ placement. For example, the Sound Blaster comes
- pre-configured for IRQ7, which is required under OS/2 to access the LPT1
- printer port. IRQ5 is also supported, which is the LPT2 printer port;
- more likely, IRQ5 will be free on your system. The MediaVision Pro
- AudioSpectrum 16 requires two IRQs, one for the Sound Blaster
- compatibility (IRQ5 is the default), and a software-assignable IRQ for
- the advanced capability. One of the higher, typically unused, IRQs such
- as 10, 11, or 12 are recommended for this second IRQ. Parameters on the
- Pro AudioSpectrum device driver are used to assign this second IRQ.
-
-
- ΓòÉΓòÉΓòÉ 8.6. Using Unsupported CD-ROM Drives ΓòÉΓòÉΓòÉ
-
- It might be possible to use an unsupported CD-ROM drive if the manufacturer
- supplies an OS/2 device driver. If that support is not available, you may still
- be able to use your CD-ROM drive in a VDM with the DOS device driver. Finally,
- you can create a DOS boot image that includes your CD-ROM device driver. See
- Chapter 8 for complete details. For a list of supported CD-ROM drives see
- Chapter 1.
-
-
- ΓòÉΓòÉΓòÉ 8.6.1. Other SCSI CD-ROM Drives ΓòÉΓòÉΓòÉ
-
- It might be possible to use your non-supported SCSI CD-ROM under OS/2 if you
- are willing to experiment a little. You must have a SCSI host adapter that has
- OS/2 devices drivers. Any SCSI controller that is forced to use the INT13
- driver will not support a CD-ROM device under OS/2 2.1. See Chapter 1 for a
- list of supported SCSI controllers.
-
- Drivers for Adaptec, DPT, Future Domain, and IBM are included with the OS/2 2.1
- package (view the README file for installation instructions). Trantor drivers
- must be acquired from CompuServe or Trantor. Ultra store, Bustek, and other
- vendors have also started to distribute OS/2 SCSI drivers.
-
- Note: Is it possible to add a SCSI adapter to a system that already has an
- MFM, RLL, or IDE disk controller? Yes, it is possible. SCSI adapters are
- designed to coexist with your existing controller, and most also operate
- without one (assuming you have ALL-SCSI fixed disks).
-
- Assuming that you have a supported disk controller, you must properly install
- and configure the device driver. This usually involves locating the
- appropriate driver file and adding a BASEDEV line to your CONFIG.SYS. If you
- are already using it to control a fixed disk, this step should have been
- completed for you.
-
- Note: If you are using your SCSI adapter to control your fixed disk, be sure
- that you are using the actual adapter device driver and not the INT13
- device driver.
-
- If you have just installed the SCSI adapter device driver, it is recommended
- that you reboot to ensure that it is properly configured. If it is installed
- correctly, your system should boot with no errors. However, if you encounter
- an error loading that particular device driver, your board is probably not
- properly configured.
-
- With the board properly installed, you need to ensure that the base OS/2 2.1
- SCSI drivers and CDROM.IFS file system are on your system. These files should
- be in your \OS2 system directory. If they are not, you can use the selective
- install to ensure that they are properly installed. See Chapter 1 for
- information on installing CD-ROM support.
-
- When you are sure you have CDROM.SYS and CDROM.IFS on your system, you need to
- verify that they are properly activated in your CONFIG.SYS file. The following
- lines need to appear in CONFIG.SYS:
-
- IFS=D:\OS2\CDFS.IFS
- BASEDEV=FD16-700.ADD
- BASEDEV=OS2SCSI.DMD
- DEVICE=D:\OS2\CDROM.SYS /N:4
- DEVICE=D:\OS2\MDOS\VCDROM.SYS /I
-
- 1. IFS= installs the file system driver for CD-ROM devices. When your
- CONFIG.SYS is loaded, several information lines appear when this file is
- activated. You can place a /Q parameter after the line to eliminate this
- display.
-
- 2. BASEDEV=FD16-700.ADD is for a Future Domain 1670 SCSI host adapter. This
- may be different for your system, depending on the brand and model of
- SCSI adapter.
-
- 3. BASEDEV=OS2SCSI.DMD is activated to load the base SCSI support for OS/2.
-
- 4. The fourth line (with CDROM.SYS) actually initiates contact with the
- CD-ROM device. Using unsupported drives, this one presents the most
- problems.
-
- 5. The last line is used to load DOS virtual device support for the CD-ROM
- drive.
-
- Note: It is not likely that these lines will all appear in this same order
- (or in the same place). If your OS/2 is installed with a partition
- other than D:, you need to place the appropriate letter for the file
- references.
-
- When using a non-supported CD-ROM device, the CDROM.SYS file usually reports
- that an "unsupported manufacture" is being used when booting the system. There
- are a couple of ways around this. There is an /I parameter that you can add to
- the CDROM.SYS device line instructing it to bypass some of the compatibility
- checks. However, most users have found that this still generates the same
- error.
-
- Assuming that does not work, you should attempt to locate a (newer) version of
- the CDROM.SYS file that does not have the brand consistency check. If that is
- not possible, or if it fails to work, one last resort is to make a copy of the
- CDROM.SYS file and manually alter the contents with a binary file editor.
-
- Caution: Unless you have tried this type of binary file editing before, it is
- not recommend that you attempt this. The instruction given here is
- merely a conceptual overview, and it is assumed that you are
- experienced with binary file editors.
-
- To edit this binary file, you need to have experience with a sector editor,
- such as those included with Norton Utilities or PC Tools. It is also required
- that you run these programs on native DOS, not OS/2. Assuming that all other
- attempts have failed and you are working with a backup copy of the file,
- search the file for the string TOSHIBA. This can be replaced with the string
- that your CD- ROM manufacturer uses, such as NEC. It is important to pad any
- leftover characters with spaces so that previous letters do not remain. In the
- case of this example, the TOSHIBA should be changed to NECHIBA (you need to
- place spaces over HIBA).
-
- If you get a patched version of the CDROM.SYS, you should be able to utilize
- your CD- ROM. If you are still unable to get access, check with your computer
- dealer, a local users group, or CompuServe users.
-
- Note: Even with successful access to unsupported SCSI CD-ROM drivers, it is
- possible that OS/2 CD-Audio support will not function. For OS/2's
- MMPM/2, there is no known workaround. For DOS programs, you may want to
- review the next section concerning MS-DOS drivers.
-
-
- ΓòÉΓòÉΓòÉ 8.6.2. Using DOS CD-ROM Drivers ΓòÉΓòÉΓòÉ
-
- There are certain CD-ROM drives that do not adhere to the SCSI hardware
- interface, and they require a special interface board. In most cases, the
- vendors do not yet support OS/2. However, it might be possible that you can
- access a non-supported CD-ROM using OS/2's capability to run DOS
- programs-assuming that you have a CD-ROM drive configured and properly
- functioning under native DOS. If this is the case, it may be possible to access
- your CD- ROM under a single OS/2 DOS session, which enables you to run DOS and
- WIN-OS/2 programs.
-
- The easiest way to experiment with this capability is to set up a DOS disk for
- your A: drive. To keep space available, it is recommend that you put the
- minimal complement of DOS files on this disk (hidden system files, and
- COMMAND.COM). It is also recommended that you start with a simple CONFIG.SYS as
- follows:
-
- Note: The following example uses the DOS driver for the Future Domain
- controller and MSCDEX drivers. Both are supported by OS/2 2.1; however,
- if you have a non-supported CD-ROM drive or an older version of MSCDEX,
- this example provides a model that may be helpful.
-
- FILES=50
- BUFFERS=16
- LASTDRIVE=Z
- DEVICE=A:\FDCD.SYS /D:MSCD000
- DEVICE=A:\FSFILTER.SYS
- DEVICE=A:\HIMEM.SYS
-
- It is important to understand that many of OS/2's DOS settings are not
- available when you boot a special DOS kernel. Examples include the DEVICE,
- BUFFERS, and FILES lines-these need to be put in the actual CONFIG.SYS on
- drive A. However, other parameters such as the amount of DPMI and XMS memory
- are important.
-
- FILES=50: this line configures the DOS session for the appropriate number
- of files. As with a standard DOS 5.0 system, be sure you have enough to
- run Windows. BUFFERS=16: internal file buffers for the DOS session
- (identical function as to the value under DOS 5.0).
-
- LASTDRIVE=Z: this line is used to ensure that all letters are available
- to the CD-ROM. The MSCDEX.EXE program (in the following AUTOEXEC.BAT) is
- used to specify to which drive letter the CD-ROM is assigned.
-
- DEVICE=FDCD.SYS: this line is the Future Domain SCSI CD-ROM driver. You
- need to install the appropriate DOS CD-ROM driver for your controller.
-
- DEVICE=FSFILTER.SYS: the file FSFILTER.SYS is provided with OS/2 2.1,
- resides in the \OS2\MDOS subdirectory, and should be copied to your A:
- disk. This file allows the DOS 5.0 session to fully access OS/2
- partitions when running under OS/2.
-
- DEVICE=HIMEM.SYS: this is the HIMEM.SYS file taken from OS/2 2.1, and it
- resides in the \OS2\MDOS subdirectory. This gives the DOS 5.0 session
- access to OS/2-provided XMS memory.
-
- Tip: The FSFILTER.SYS and HIMEM.SYS files must be from the \OS2\MDOS
- directory, otherwise the bootable DOS image might not work.
-
- You now need to configure an appropriate AUTOEXEC.BAT for this DOS session:
-
- SET PROMPT=$p$g
- SET PATH=A:\;
- A:\MOUSE.COM
- A:\DOSKEY.COM
- A:\MSCDEX.EXE /D:MSCD000 /M:10 /L:G
-
- As you can see, the AUTOEXEC.BAT has nothing different than what regular DOS
- 5.0 requires. MOUSE.COM should be the one taken from the \OS2\MDOS directory;
- using a DOS version of the mouse driver may render your mouse unusable under
- your.i.mouse; OS/2 sessions.
-
- Note: You may notice that DOS 5.0 SETVER.EXE was not included in the
- CONFIG.SYS. This was not required for the test machine, as the latest
- version of MSCDEX.EXE, v2.21, does not require that SETVER command for
- compatibility with DOS 5.0. Older versions of MSCDEX may require you to
- use DOS 5.0 SETVER. The newest MSCDEX should be available from your
- dealer, Microsoft, or CompuServe.
-
- Now that you have your floppy disk properly configured, you can select the
- "DOS from Drive A:" option on the Command Prompts folder. This initiates the
- loading of this DOS 5.0 session from your newly configured floppy disk. During
- troubleshooting, you may want to make a copy of this program reference (the
- "DOS from Drive A:"), and change it to run in a window.
-
- Note: A booted DOS session can not be exited in the normal manner. You must
- switch to the Window List and close it. IBM produces a tiny program
- that you can run to self-terminate the session (such as EXIT would in a
- normal OS/2 DOS session).
-
- Tip: If you find that you frequently use a DOS 5.0 boot session, you may want
- to configure your C: partition for FAT and DOS 5.0. This assumes that
- you use the Boot Manager. If you configure it this way, you can tell
- OS/2 to boot this DOS session from the C: partition instead of from an
- image file or a floppy disk. This is the quickest method of booting, and
- it allows the most flexibility.
-
- Note: Even if you have a SCSI CD-ROM that is mounted as a native OS/2 device
- (available to all sessions), you may find that certain DOS programs
- require the actual MSCDEX to be loaded. Even when OS/2 is talking to
- the SCSI controller, the DOS boot session may still work! In fact, at
- least with some controllers, OS/2 allows both the OS/2 and DOS device
- drivers to control the SCSI card. (This has been tested on a Future
- Domain controller.) Obviously, care should be taken. It is advised that
- this not be attempted on a SCSI controller that is also controlling
- writable storage devices-data corruption may occur. This method can
- also be used to gain CD-Audio capability for DOS and WIN-OS/2 programs.
-
- Figure 18.8 shows a DOS 5.0 windowed session, with CD-ROM drivers loaded,
- booted from the C: partition. Note that CONFIG.SYS and AUTOEXEC.BAT contain
- additional entries not necessarily shown in the preceding listing. It is
- possible to start WIN-OS/2 by issuing the command WINOS2. This requires that
- the DOS 5.0 session path be properly configured to point to the WIN-OS/2
- directory. Starting WIN-OS/2 allows you to run Windows-based multimedia
- programs. To run WIN-OS/2 on top of this session, it is recommended that you
- switch it to a full-screen mode.
- Figure 18.8. A DOS 5.0 session with CD-ROM.
-
-
- ΓòÉΓòÉΓòÉ 8.6.3. Managing DOS Configuration ΓòÉΓòÉΓòÉ
-
- You may find that you have a number of DOS programs that require drivers for a
- sound board or CD-ROM. Although DOS sessions can use the same AUTOEXEC.BAT
- file, the CONFIG.SYS portion is unique for each program reference. Particularly
- when you want to set up multiple programs, or for multiple systems, you may
- wish to use REXX calls to create program references (menu icons). For example,
- the following REXX program creates a program reference for DOS game Wing
- Commander:
-
- /*Wing Commander Test*/
- /*Create program reference on OS/2 Workplace Shell*/
-
- Call RxFuncAdd 'SysLoadFuncs','REXXUTIL','SysLoadFuncs';
- Call SysLoadFuncs;
- reply='UpdateIfExists'
- rc=SysCreateObject('WPProgram','Wing Commander','<WP_DOSGROUP>',,
- 'EXENAME=C:\WING\WC.BAT;'||,
- 'PROGTYPE=VDM;'||,
- 'STARTUPDIR=E:\WING;'||,
- 'SET DOS-FILES=40;'||,
- 'SET DOS-BREAK=1;'||,
- 'SET DOS-HIGH=1;'||,
- 'SET DOS-DEVICE=c:\proaudio\mvsound.sys d:7 q:15 j:0;'||,
- 'SET INT-DURING-IO=1;'||,
- 'SET DOS-BACKGROUND-EXECUTION=0;'||,
- 'SET HW-TIMER=1;'||,
- 'SET IDLE-SENSITIVITY=100;'||,
- 'SET KBD-BUFFER-EXTEND=0;'||,
- 'SET KBD-ALTHOME-BYPASS=1;'||,
- '', reply);
-
- If rc<>1 Then
- Say 'Program: Wing Commander could not be created/updated !'
-
- In the preceding example, it is assumed that Wing Commander is called by a DOS
- batch file named WC.BAT that resides in a subdirectory called C:\WING. You will
- also see that a line is included to activate a device driver
- C:\PROAUDIO\MVSOUND.SYS. This example would be used for a MediaVision Pro
- AudioSpectrum board, with the drivers in the C:\PROADUIO subdirectory. In this
- example, the program is added to WP_DOSGROUP (the Dos Programs folder on the
- desktop). Other sound boards, such as Creative Labs, do not require a DOS
- device driver to be used with DOS programs.
-
- Tip: When creating a REXX program command file, the file must begin with a
- REXX comment, such as /* Test */. This must be on the first line of the
- command file for OS/2 to recognize this as a REXX program. See Chapter
- 15, "REXX Programming," for more information on REXX programs.
-
- Note: The example use of the MVSOUND.SYS file deserves some clarification.
- The driver is for a MediaVision Pro AudioSpectrum sound board and was
- designed to be used in a "pure DOS" environment. DOS programs,
- typically games, may require this driver to access the Pro
- AudioSpectrum for sound effects and speech. However, it is important to
- understand that this DOS driver will directly access the hardware of
- the sound board, and does not virtualize the resource. Multiple
- programs should not be run at the same time that would utilize this
- driver. It is also significant that this driver runs entirely
- independent of MMPM/2; in fact, MMPM/2 is not required to use your
- sound board in this fashion (for DOS programs). Also watch out for
- conflicts between a true MMPM/2 driver and a DOS driver. The January
- 1993 beta of MediaVision Pro AudioSpectrum MMPM/2 driver recommends
- that you not use the MVSOUND.SYS file for DOS programs.
-
- Tip: The line that begins with rc=SysCreateObject may have to change if you
- upgrded to OS/2 2.1 from OS/2 2.0. Change <WP_DOSGROUP> to <DOS
- Programs> if the file doesn't work. The name of the object changed
- between OS/2 2.0 and 2.1. Look for the resulting object in the DOS
- Programs folder.
-
-
- ΓòÉΓòÉΓòÉ 8.6.4. WIN-OS/2 Multimedia ΓòÉΓòÉΓòÉ
-
- OS/2 2.1 includes the capabilities of Windows 3.1 in the form of WIN-OS/2.
- Because OS/2 2.0 did not have the multimedia capabilities, the OS/2 2.1 upgrade
- has been greatly anticipated. Under true Windows 3.1 (without OS/2), Windows
- depends on DOS for the CD-ROM drivers, so there is a clear distinction between
- sound boards and CD-ROM. WAV and MIDI files depend on the sound board, whereas
- CD-Audio and program loading use the CD-ROM device driver. For this reason,
- sound board drivers for WIN-OS/2 are configured and function the same way as
- under true Windows 3.1, although the installation and access of the CD-ROM
- under WIN-OS/2 can be entirely different.
-
- WIN-OS/2 MultiMedia includes a Media Player and Sound Recorder application.
- WIN-OS/2 also supports sound effects that are tied to specific events, such as
- when WIN-OS/2 is opened and closed. To activate and configure these events, use
- the WIN-OS/2 control panel.
-
- When working with a sound driver for WIN-OS/2, it is important to understand
- that the performance of these drivers is sometimes limited by the virtual 86
- mode of the Intel Processors (which OS/2 uses to run DOS and Windows programs).
- In particular, interrupts are sometimes delayed, and this results in distorted
- sound. Some of the drivers supplied with WIN-OS/2 are more optimized for the
- OS/2 environment. When possible, use the drivers supplied with WIN- OS/2. Check
- with your hardware vendor for the latest release.
-
-
- ΓòÉΓòÉΓòÉ 8.7. Multimedia Development Environment ΓòÉΓòÉΓòÉ
-
- The OS/2 operating system has always been well received by developers because
- it facilitates many of the multitasking aspects of programming. Although OS/2
- 2.1 is somewhat behind in multimedia development tools, IBM is working hard
- with others to catch up.
-
- IBM includes the MMPM/2 and MMPM/2 Toolkit with the OS/2 Professional
- Developers Kit CD-ROM. Even non-multimedia developers have been attracted to
- this package because it contains many types of controls (such as turning knobs)
- that are not in the base operating system.
-
-
- ΓòÉΓòÉΓòÉ 8.8. Future Multimedia ΓòÉΓòÉΓòÉ
-
- Much of multimedia's capability lies in the future. At this point, no hardware
- platform dominates software-vendor attention; several systems have a variety of
- "raw capability" but few affordable applications. IBM obviously considers
- multimedia an important part of its future, and it backs their products with
- solid OS/2 2.1 support. However, the "consumer grade" products are just
- beginning to garner interest, and only the most common devices are currently
- included in packages.
-
- CD-ROM is already a proven media for distribution of sound and computer data.
- As standards take hold for video playback, it will also serve as a tool for
- video playback. Writable CD-ROM devices are still quite expensive, but they
- have generated a lot of user interest. Other forms of optical storage are also
- promising, but CD-ROM is destined to stay.
-
- IBM seems to have already covered the high-end of the PC hardware, and it has
- done an excellent job of supporting both ISA and Microchannel users under OS/2
- 2.1. As time progresses, these boards will become more powerful and affordable.
- However, at least for the time being, they seem destined for business users who
- can afford the high price of good-quality video capture and playback. Because
- Intel was a key player in the development of DVI, it is rumored that a
- specialized version of the 80486 will be offered with some type of DVI playback
- capability. For now, however, systems with built-in video playback are nothing
- but a rumor. Of course, it is pretty safe to assume that this capability will
- someday be standard on a desktop PC, although it is anyone's guess as to how
- long it will take for this to happen.
-
-
- ΓòÉΓòÉΓòÉ 8.9. Conclusion ΓòÉΓòÉΓòÉ
-
- Although OS/2 2.1 has yet to offer substantial multimedia titles, it does not
- preclude the use of existing DOS and Windows multimedia software. OS/2 2.1 is
- also a very appealing environment for developers because it is a well- defined
- modern environment. There is also another factor to consider: the OS/2
- operating system has attracted the majority of the "power users" that are
- interested in CD-ROM and multimedia applications. As they say, it can only get
- better.
-
-
- ΓòÉΓòÉΓòÉ 8.10. Author Bio ΓòÉΓòÉΓòÉ
-
- Stephen A. Gutknecht is a systems engineer with experience in both corporate
- support and retail. He is employed at Slator Steel of Fort Wayne, Indiana. Most
- recently, he was the general manager for a computer reseller, also located in
- Fort Wayne. Previous corporate positions include information systems
- coordinator for a company in the insurance industry. Having been in the
- computer industry for seven years, Gutknecht values his ability to combine
- hardware and software knowledge into practical business solutions.