GNU: OS/2's Hidden Treasure - Part 2- by Murray Todd Williams

For those of you just tuning in...

This article is the second part of a series on GNU software for OS/2. The original article describes GNU: a vast collection of free software written for a variety of platforms (operating systems and microprocessors) by some incredible programmers. In essence, the GNU system turns your OS/2 system into an OS/2-Unix hybrid, giving you the best of both worlds.

In this article I will discuss the basic installation of two primary elements of the GNU system: the EMX runtime libraries and the GCC compiler. Once these are installed, you will be ready to explore the GNU world.

But Wait, There's More!!

I just can't go on without a bit of a product plug. I suggest anyone who hasn't already read last issue's article on X-Windows for OS/2 do so now. A few weeks ago I got involved in the XFree86 project, alpha-testing the software. Getting X-windows up and running isn't for the weak of heart, but this thing is incredible!

Here is a humble screen shot (GIF 27.5k) from my own computer. And here are some other nice screen shots by Holger Veit, Lars Olofsson, and Kim Steen Henriksen. Be warned that some of these screen shots are pretty huge. One spectacular thing you will probably notice here is that each screen shot looks vastly different--almost like the difference between a Macintosh and OS/2. This is due to the fact that an X-windows session is extremely customizable.

I must confess, unless you know a) what X-windows is, b) how to make it work and c) why you would want it, chances are you should wait before diving into this one. If you work with Unix (on a network) as well as OS/2 then you'll know what I mean. In short, X-windows is to Unix what the Presentation Manager is to OS/2; it's a widely used GUI standard. What's unique to X-windows is that the X-windows program often runs on a different machine (the client) than the machine which displays the output (the server). With OS/2 (or Windows or Mac OS) the client and the server are always the same machine. Using X-windows however, we can run a Unix program on a Unix computer, but have its output routed to a computer running OS/2. Another way of describing it is a super-elaborate TELNET session, but graphical instead of text-based.

Presently, if your workplace has some Unix machines on the network, you can turn OS/2 into an X-windows "dumb terminal". If you want to run X-windows software directly on your OS/2 machine, wait a little longer until the best of the GNU X-windows software is ported. If you have no experience with X-windows, Unix, or TCPIP, I suggest you wait at least until the software is "beta level" code and the instructions are a bit more pedantic.

Be assured you will hear more about XFree86 for OS/2 in the near future...

Getting Back to EMX and GCC

Before you can enjoy the GNU universe, you need to install some programs and dynamic link libraries (DLLs) so that OS/2 can provide "Unix-ish" emulation. The most basic component of this is called EMX which consists of a couple DLLs (EMX.DLL in particular). Once you have installed EMX, you can run almost any GNU software that has been ported to OS/2.

The second component, GCC, is a GNU compatible compiler that produces executables for OS/2. Most of the GNU software you find will include its original source code (something rarely seen with most programs). In fact, where you find EMX and GCC, you will also find their original source code. This means the GCC compiler (and EMX system) can compile itself! GCC compiles programs written in C, C++ and Objective C. (C++ and Objective C are two independent approaches to object-oriented programming with C. Although C++ is now the de facto standard, Objective C is not without its advantages. Objective C was the variant used with the NeXT Step operating system.)

System Requirements

EMX/GCC is surprisingly flexible with system requirements (hard disk space). For a minimum installation (EMX components only) you only need a few Meg at most. For a normal installation of EMX and GCC you need about 50 Meg. If you also want to install all the original source code, you need significantly more space. Although HPFS is not required, it is highly recommended. Quite often included source code expects long filenames, and some of the standard C++ header files require names that don't fit the 8.3 standard.

Let me reiterate: you can use FAT (8.3 filenames) but you will have to use some nonstandard C++ header names and you will have difficulty with other people's source code. Also if you want to run things like Emacs or XFree86, I would suggest you bite the bullet and use HPFS.

The first step you should take is to figure out where you will put the main EMX directory. I suggest you place it directly off the root directory of one of your drives. This is not mandatory, but let's face it: EMX is like a miniature operating system in itself.

Finding the GNU Distribution

There are a few places to find GNU. One of the more popular archives is Hobbes. Before you go the Hobbes link though, I suggest you use one of the Hobbes Virtual Mirrors. They reduce the traffic to the Hobbes FTP site and provide nice file descriptions. Once you've found the archive, go to the /os2/unix/emx09b directory. This is a repository for all of the GNU-OS/2 software from which you'll find the basic EMX and GCC distribution.

There are many files here but the most important ones are INSTALL.DOC and emxrt.zip. Go ahead and grab these files. While you're at it, go to the parent directory (/os2/unix) and get the gnused.zip file if you are going to use EMX with an HPFS partition. Now save yourself a huge headache and print out INSTALL.DOC. It will take you step by step through the EMX installation.

Once you've figured out where you are going to put EMX, go to that directory and unzip the file emxrt.zip. Add the following lines to your CONFIG.SYS and then reboot:

PATH= ... ;D:\EMX\BIN
LIBPATH= ... ;D:\EMX\DLL
This example assumes you are placing EMX off the root directory of the D: drive.

WARNING! You should be careful about something or you are likely to encounter some unpredictable results: you need to have only one copy of the EMX.DLL file on your computer (in the LIBPATH) and it should be the one you just unpacked from the emxrt.zip file. If you have installed GNU software in the past, it will likely have included a copy of EMX.DLL which could be out of date. In fact, all of the DLL files you unpacked from emxrt.zip should be unique within your LIBPATH. One thing you can do is move the \EMX\DLL path to the front of the LIBPATH= statement in your CONFIG.SYS, thus assuring that the system will find the newer files first. Or you can check your drives for old versions of EMX.DLL (i.e.: DIR C:\EMX.DLL /S), delete them and then move on.

Now unzip the gnused.zip file into a temporary directory. Move sed.exe into the \EMX\BIN directory (which was created when you unzipped emxrt.zip) and start following the instructions in INSTALL.DOC. You will now have to decide which files you want to install. The bare minimum installation is the emxrt.zip file which you already installed. (To make it work right, you will need to make some modifications to CONFIG.SYS as described in INSTALL.DOC.)

To install the GCC system, you will want to install (unzip) these files:

  emxdev.zip       Files required for developing programs with emx
  gnudev1.zip   The GNU C compiler, the GNU debugger, and other tools
  gnudev2.zip
  gppdev.zip    Additional files for GCC required for compiling C++ programs
  gobjcdev.zip  Additional files for GCC required for compiling
                programs written in the Objective C language (Optional)
I suggest you also install the following files which contain a lot of documentation and some other useful components:
  emxview.zip   emx documentation in OS/2 .inf format
  emxample.zip  Sample programs
  emxtest.zip   Test programs (used for testing emx and the libraries)
  gnuview.zip   emxgnu.inf (emxgnu.doc in OS/2 .inf format)
  gnudoc.zip    Documentation for GNU programs (texinfo sources etc.)
  gnuinfo.zip   GNU texinfo (includes info file browser)
  bsddev.zip    BSD programs (gprof) and libraries (curses etc.)
  bsddoc.zip    Documentation for BSD libraries
If you want to throw in the kitchen sink (and don't care about disk space) go ahead and install all the original source code for EMX/GCC. Note: You will probably not need these files!
  emxsrcd.zip      Source for emx development tools
  emxsrcr.zip   Source for the emx runtime package
  gnupat.zip    patches for GNU sources
  gnusrc.zip    Patched GNU sources (info, termcap, GPPDEMID)
  gbinusrc.zip  Patched GNU sources (ld, ar, nm, size, strip, objdump, gprof)
  gccsrc1.zip   Patched GNU sources (GCC 2.7.2, part 1)
  gccsrc2.zip   Patched GNU sources (GCC 2.7.2, part 2)
  gccsrc3.zip   Patched GNU sources (GCC 2.7.2, part 3)
  gdbsrc1.zip   Patched GNU sources (GDB 4.15, part 1)
  gdbsrc2.zip   Patched GNU sources (GDB 4.15, part 2)
  gppsrc.zip    Patched sources of libg++ 2.7.1
  bsdsrc.zip    Source for BSD libraries
Finally, you will want any fixes that are available. Read EMXFIX01.DOC and unzip the emxfix01.zip file. If you don't unzip the fix last, some of the updated files will get overwritten with the old (buggy) files. With that done (and assuming you go slowly through all the instructions in INSTALL.DOC) you should be ready to roll. Those instructions will lead you to compile and run a sample C program, install icons for the EMX/GCC manuals, and a couple other things that should start you on the journey. Welcome!

Stay tuned for next month's article: "Emacs is the kitchen sink!" This is guaranteed to be a fun article to write. Emacs is (almost) a text-editor-turned-operating-system. Yes, it can edit files. It can also read Internet newsgroups, go through your mail, demonstrate the "Towers of Hanoi" logic puzzle, and be your therapist too.

You don't believe me? Stay tuned for next month!


Murray Todd Williams is a student at Colorado State University, working on a M.S. in Statistics. He is also a member of Team OS/2.

Send a letter to the editor.

Our Sponsors: [Post Road Mailer] [ScheduPerformance] [Shenandoah] [SPG]


Back to Contents |  Previous Article | Next Article


This page is maintained by Falcon Networking. We welcome your suggestions.

Copyright © 1996 - Falcon Networking