OS/2 for the PowerPC: The Development Environment

by Jay A. Tunkel

This issue of The Developer Connection for OS/2 contains Beta code for the SDK for OS/2 for the PowerPC. I think you'll be generally pleased with what you see, and I'd like to take this opportunity to tell you about it and about the development environment. While we have not included the full OS/2 for the PowerPC system in this issue (that will be coming along "real soon now"), it is useful to talk about the new and interesting features of development for this system - most notably the cross-development environment.

I think you'll find that the development environment has much in it that is familiar and comfortable. Much more important you'll find that developing applications for OS/2 for the PowerPC is just like developing applications for the Intel version of OS/2 Warp. Your 32-bit OS/2 applications will recompile and run with a minimum of effort. For the details of a first-hand experience, look at the front-page article in this issue of The Developer Connection News by Dr. Randell Flint of Sundial Corporation.

Of course, although the tools we're providing here will allow you to recompile and build your application for OS/2 for the PowerPC, that's as far as you'll be able to go because you don't have the complete system yet. But, for the purposes of this discussion, we'll just assume that you've already got one and are ready to begin. Running your code through the tools provided will give you an early start on the development process. Remember: much of the testing you've already done on your application with OS/2 Warp or OS/2 Version 2.1 is applicable to OS/2 for the PowerPC!

The Hardware
The development environment provided with the OS/2 for the PowerPC Beta is initially a cross-development environment. Two systems are needed - one to host the compiler, debugger, and the other development tools and the other, the target system, to run the execution and test environment. Tied together via a LAN, these two systems work in tandem to provide an efficient development environment. As we lead up to product shipment of OS/2 for the PowerPC, we will introduce native tools, tools that are hosted on the PowerPC system, to allow single machine development as well. However, as we'll see, the two machine method is likely to be more productive in the earlier weeks and months of development on a new system and it allows you to use existing hardware.

The first system, the development tool host system, should be a standard Intel 386 or 486 system (486 preferred), running OS/2 Version 2.1 or OS/2 Warp Version 3.0. Not much is required of this system beyond what you would normally have on board: a respectable amount of memory and hard disk space (as with all development systems) and a LAN card (Token Ring or Ethernet). The LAN is the connection to the PowerPC system.

The second system, the development target system, is a PowerPC Reference Platform (PReP) conforming device - built around the PowerPC chip and having enough RAM to support the Beta level of OS/2 for the PowerPC. This early level of the system will use a serial-port connected terminal emulator as a system console. Any terminal emulator will do - it is, perhaps, most convenient to use the one provided with OS/2, so there will be a null-modem cable connecting the two systems' serial-ports and the LAN connection.

The system console serves as a useful place to watch for debug messages from the microkernel or from the OS/2 personality. These are most often benign, but occasionally will inform you of difficulties via traps and register dumps. However, the most useful debugging information will come to you via Remote IPMD (an enhanced version of the C Set++ debugger).

The Software
The following provides you with a high-level view of the software provided on this Beta version of the OS/2 for the PowerPC SDK.

Delivery
The SDK for OS/2 for the PowerPC will be delivered on your Developer Connection for OS/2 CD-ROM. It contains the necessary compiler(s), debugger, libraries, and documentation needed for a complete development environment. As such, you will be provided with a comfortable and familiar interface for reviewing and installing the SDK components - the Developer Connection Catalog.

Installation
Installation of the SDK is the same as installing any set of tools provided by The Developer Connection - just use the Catalog in the normal way.

Development Tools
Many tools are provided on the Beta SDK; the following provides you with a relatively quick overview.

Compiler
The compiler supplied in this version of the SDK is provided by MetaWare Incorporated and is derived from their High C/C++ compiler family. It's a cross compiler that runs on OS/2 2.1, 2.11, or OS/2 Warp Version 3. The compiler generates code that can be linked to run on OS/2 for the PowerPC. Another way of saying this is that the compiler generates code that is compatible with the OS/2 ABI for PowerPC - the set of rules and regulations that determine what an OS/2 for the PowerPC program looks like and how that program interacts with the system. See the article by Robert Warren from MetaWare on page 12 of this issue.

When OS/2 for the PowerPC is shipped sometime in mid-1995 there will be at least two compilers that support the OS/2 ABI for PowerPC - this one and a new variant of C Set++ optimized for the PowerPC hardware. And there is every reason to expect that even more will appear shortly after that.

Linker
The linker included in this version of the SDK is a companion to the MetaWare compiler.

By the way, when the final product is delivered, the linker will accept command lines that are much closer to the syntax that you've been using with Link386, but the linker itself is entirely new and will accept a POSIX-like syntax as well.

Debugger
The debugger included with the SDK for OS/2 for the PowerPC is particularly interesting. It is derived directly from the IPMD debugger in C Set++ and has several new features.

First of course, it supports debugging of PowerPC applications. This includes display and modification of the PowerPC register set (32 general purpose registers, 32 floating point registers, and a family of control and special purpose registers).

Perhaps more interesting, though, is its ability to debug a PowerPC application while running on your Intel-based OS/2 system. It does this by splitting its functions between the Intel system and the PowerPC system: the user interface (or front-end) is an Intel-based OS/2 application while the debugger engine (or Instrumentation Server) runs as a microkernel task on the PowerPC. Both communicate across TCP/IP through interface modules. The result is a debugging system, which is extremely robust and flexible.

Porting Your Application
If you are starting from a base of 32-bit code, you should find that porting your applications is fairly painless. OS/2 for the PowerPC is OS/2. All the 32-bit APIs are there so your task is one of recompiling, linking, and debugging. If you have 16-bit code in your application, then you still have a bit of work to do, but we've tried to make the job as simple as possible. All the 16-bit APIs you may have been using now have 32-bit counterparts. If you feel you need further help, consider using the SMART (Source Migration Analysis and Reporting Toolset) migration tool included with The Developer Connection.

You may find some small changes to be addressed due to the change from the C Set++ (or other compiler) to the supplied MetaWare compiler. The list of known possibilities is gratifyingly small, but mark them well (or use #ifdef) because you might want to undo the changes when C Set++ for PowerPC (or whatever it will be called) becomes available.

Summary
So, here it is, the first set of programming tools for OS/2 for the PowerPC - with more to come very soon. Watch upcoming issues of The Developer Connection News.

About the Author - Jay Tunkel
Jay Tunkel is a Senior Programmer and Technical Assistant to the Developer Connection Product Manager. He has worked on OS/2 since its inception in 1986, is the originator of the Developer Connection concept, and is a Technical Advisor to The Developer Connection News.