TweetFollow Us on Twitter

UNIX On Your Desktop

Volume Number: 15 (1999)
Issue Number: 4
Column Tag: Development Environments

UNIX on Your Desktop

by Vicki Brown

A Look at MachTen and CodeBuilder

UNIX on Your Macintosh

Have you been thinking about running UNIX® on your Macintosh? Perhaps you'd like to get a head start on Mac OS X Server. Or you've been reading a lot about Linux in the news lately, and wonder what the fuss is about. Perhaps your company just added a Sun Solaris system or a Silicon Graphics Irix machine and you need to learn about UNIX. Or, you want to run a web server or an FTP server. Or, perhaps you're just curious. But you don't want to give up your Mac OS! What can you do?

Power MachTen from Tenon Intersystems <http://www.tenon.com> may be just what you need. Power MachTen is a complete implementation of a Berkeley UNIX Operating System for the Power Macintosh, using a Carnegie-Mellon Mach kernel. The entire MachTen UNIX environment runs as an application under Mac OS, just like any other application (with a few important differences). The Mac OS and MachTen share the processor, the hard drive, the network, and any peripherals you may have installed.

Power MachTen is a complete UNIX system, with many features such as network file sharing, multi-user login capability (via telnet), Web server, Domain Name services, and more. If you don't need the networking and file sharing features, you may instead want to take a look at CodeBuilder. CodeBuilder uses the same kernel and has many of the same UNIX features, but lacks the networking and file sharing capabilities of MachTen. If you're only interested in software development under a UNIX system, CodeBuilder may be the right choice.


Figure 1. CodeBuilder Console.

Source Code Development

The CodeBuilder environment includes a wide range of features to aid in source code development. CodeBuilder provides support for many popular languages, including Ada, C, C++, FORTRAN, Java, Objective-C, Perl, and Tcl/Tk. The development tools can be used to create Macintosh applications, Unix applications, or hybrid (Macintosh/Unix) applications.

In addition, CodeBuilder includes a choice of the most popular Unix shells: C-shell (csh), T-C Shell (tcsh), the "Bourne" shell (sh) and the Bourne Again Shell (bash). The shells are interactive command interpreters, required for issuing commands in the MachTen or CodeBuilder terminal windows. Each shell also has its own language which can be used for writing useful small programs called shell scripts. The default shell is Csh. However, if you are unsure about which shell to use, try bash. Of the four, this one has the most (and best) features available for both interactive use and script creation.

When you first launch CodeBuilder, it's easy to see that this is no ordinary Mac OS application! Indeed, CodeBuilder is a complete UNIX environment, sans networking features. When you log in you'll be presented with a new terminal window, and a shell prompt.

Tenon provides several accounts for the first-time user. These are: root, the system administration account, cbuser, the standard CodeBuilder account, and cbnext. The latter has the same privileges as cbuser but uses the CodeBuilder AfterStep desktop environment instead of simple terminal windows.

Be sure to log in as root the very first time and run the chnglicense command. Until you run this command and enter your registration number, CodeBuilder is operating on a temporary, expiring license. Although the command is run from the CodeBuilder command line, the chnglicense dialog has a distinctively Macintosh look to it. The initial dialog should appear with the current (temporary) number filled in. If it doesn't, make sure you have logged in as root to run the command.


Figure 2. chnglicense.

After you've registered, log in as cbuser and take a look around to get the feel of CodeBuilder. Pay particular attention to the sample_code directory which contains sample code in several languages.

cbuser@CodeBuilder% ls
sample_code
cbuser@CodeBuilder% ls sample_code
Ada             C++             Java            ReadMe
C               FORTRAN         Objective-C
cbuser@CodeBuilder% ls sample_code/*
sample_code/ReadMe

sample_code/Ada:
act-distrib     lovelace        mac-team

sample_code/C:
Makefile        hello.c         sillyballs.c

sample_code/C++:
Makefile        hello.C         square.cc

sample_code/FORTRAN:
Makefile        hello.F         wiggle.f

sample_code/Java:
Makefile        hello.java

sample_code/Objective-C:
gstep-base-0.2.10       hello
cbuser@CodeBuilder%

We're Not in Kansas Anymore...

If you have never used a UNIX system before, you should be aware that CodeBuilder is a very different environment from the Mac OS. If you've used MPW, you will at least be familiar with the ideas of a shell and a command-line interface. But even if you have MPW experience, UNIX will most likely seem very foreign.

The documentation for CodeBuilder should get you started, but you'll probably want to pick up a few books on using a UNIX system, and programming in a UNIX environment. There are quite a few of these available. If you are lucky enough to live or work near a good technical bookstore, I recommend you look through a number of books before choosing one. If you can't look at the books in person, be sure to ask for recommendations; there are a lot of bad books as well as good ones. Unfortunately, there aren't any books available about MachTen specifically; however, you should be able to find books that address the Berkeley versions of UNIX.

Note that there are books available that address the Mach kernel. However, these are unlikely to be of interest to most users of CodeBuilder! Unless you are planning to develop or modify UNIX kernels yourself, you'll probably want books that address the user interface and programming environment of a UNIX system.

While you're waiting for the books to arrive, you should explore the CodeBuilder environment. Read the manual (unlike most Macintosh applications, this is a manual you really should read). There is also extensive on-line documentation. The top-level Documentation folder on the CodeBuilder CD provides both printable and browsable (HTML) documentation. The printable documentation includes "info" documents for many GNU tools, the PostScript versions of the UNIX man pages, and many supplementary papers. Of course, the UNIX man pages (/usr/share/man) and the GNU info files (/usr/share/gnu) are available as well.

What if You Want Networking Too?

CodeBuilder is a nearly complete UNIX system, with a full development environment and (almost) every tool you might want. However, if you also need networking support, you'll want to look instead at Power MachTen . Power MachTen provides all the development support you get from CodeBuilder, as well as Network Filesystem, the Apache Web server, full telnet support (imagine logging into your Macintosh :-), Sun's NIS (Network Information Services), electronic mail support (sendmail and bind), Name Server capability, and more.

There are few noticeable differences. You'll see a few more daemons starting up when MachTen launches, as well as several additional files and directories. The MachTen Control Panel includes Network settings. If you have Mac OS 8.5 installed, you'll have to copy your networking data from the TCP/IP control panel; otherwise, MachTen is able to import the data for you. Because MachTen is networked, the initial accounts (here, mtuser and mtnext ) have passwords. Be sure to change the passwords for these accounts, and for root, after you register with chnglicense.


Figure 3. MachTen Console.

Networking at Mach Ten

Once you have MachTen installed, where do you go from there? For starters, MachTen enables you to develop applications in a UNIX-based environment, just as CodeBuilder does. But with MachTen , you can set up one Macintosh to be a server, and other users can log in remotely to compile their applications. Or, run X Window System applications from remote workstations (including other Macintoshes), with MachTen providing the server.

In a networked environment, you can use MachTen to run a high speed Internet server, complete with WWW, FTP, NFS, DNS and print services. Turn inexpensive Macintosh systems into reliable, network-based remote file servers for Xerox DocuTech Production Publishers (note: this capability is only available if the DocuTech's FTP feature is enabled). You can even run your company email through a MachTen server.

In combination with WebTen, Tenon's point and click Apache Web server, MachTen provides a powerful web development tool. Using the WebTen SDK, which runs under MachTen, you can develop plug-in Apache modules for the Macintosh. With minimal porting effort, you can migrate your plug-ins to WebTen or any other Apache web server environment.

Recently, the vendor of a Web programming application released a UNIX version of their product. In only a few days, working via remote login to a Powerbook running MachTen, this vendor was able to recompile the application to run in the cgi-bin folder under WebTen, all with a minimum amount of porting effort - and all over the Internet!

4.1.1 Pros and Cons - First Impressions

I've been using MachTen since 1991. It's come a long way in that time; Tenon has obviously been working diligently to improve the interface with the Mac OS while adding features that greatly improve usability and performance. Power MachTen 4.1.1 runs with System 8.5 and is supported on the latest G3 Power Books and even on the iMac.

Unlike its early predecessors, Power MachTen is a very well-behaved application. Long gone is the need to restart Mac OS upon quitting the MachTen application (a drawback of the earliest versions). Gone also is any confusion about who "owns" the networking functionality. When MachTen exits, your networked applications continue to function. Although Tenon's advanced TCP stack is an option, Open Transport is used by default.

Also improved over the years is the price. Power MachTen is available for US$249. If you don't need networking support, CodeBuilder is priced at just US$149. Compared to many large packages for the Mac OS (including software development environments), and considering what you get, this is a steal!

Support for both CodeBuilder and Power MachTen is excellent. Tenon's support staff is knowledgeable, and they answer email. There are certainly cheaper UNIX implementations on the market, but they don't come with nearly the same level of support as you'll find with MachTen.

Features and Functionality

Beginning with release 4.1, MachTen included a native fast file system, implemented within one (200 MB) Mac OS file. Although this approach removes the option of accessing MachTen files from the Finder, it has several advantages. For one, the fast file system, truly is faster, providing a two- to ten-fold performance improvement for the MachTen application. For another, those thousands of (mostly small) UNIX files aren't cluttering up your Mac OS folders, risking accidental deletion, renaming, or unintended modification!

Tenon has also been hard at work upgrading the development tool set. Release 4.1.1 includes C, C++, Objective-C, Ada95 (gnat 4.0.1), FORTRAN 77 (g77 0.5.23) and Java (kaffe0.92), as well as the EGCS (1.1b) compiler suite as an alternative development environment. Many of the included applications have also been updated. The Power MachTen CD includes a number of optional installable utilities, including bind 8.1.2, emacs 20.2, Perl 5.005_01, pine 3.96, and sendmail 8.8.8, and secure shell (ssh-1.2.25).

If you prefer to work within the X Window environment, that has been updated as well. X11R6 is included, along with over a hundred rebuilt and updated X client applications. The OpenGL libraries have also been updated (customers with OpenGL will need a new license). The Motif window manager has been replaced with the (compatible) lestif 0.85.3.

Not all roses...

Not all first impressions were positive. While Tenon has been spending its efforts on true interoperability and Mac OS system interaction, they have lagged a bit on the user interface side. Control panel dialogs are modal. Due to a bug in Mac OS 8.5, MachTen was unable to import my TCP/IP settings directly, and I had to type them in. I was unhappy to note that, with the MachTen Controls open, I could not switch over and open the TCP/IP Control Panel. I was, however, able to open the TCP/IP controls first, move the window to a convenient location, then open the MachTen Controls and start copying data.

I was also somewhat unhappy with the terminal windows. I've grown accustomed to the features of several available Telnet applications for the Mac - colored backgrounds, choice in cursors, WYSIWYG feedback when sizing windows. Much of this is missing from the MachTen and CodeBuilder terminal environments. On the other hand, once you have your windows sized and arranged as you like, MachTen will save your window environment. And there is one feature I especially like - the ability to choose between windows with the touch of a command key.

I was also unhappy about the chnglicense application which must be used to enter the CodeBuilder (or MachTen) serial number. The application, unfortunately, cannot be run from a menu, but must be entered at the command line. Be very sure to enter this the first time you run the application (don't get tempted to play first and forget). Also, note that you must run the chnglicense command as root (the manual doesn't say this). If you forget to enter your license number (or don't enter it as root) and your temporary license expires, you will need to re-install the application!

My major quibble is primarily for Apple, however, not for Tenon. When I installed MachTen on my Powerbook 2400, I was surprised to note that my delete key didn't work properly. Instead of erasing text, it sent the control sequence, ^H. Similarly, my arrow keys (which I rely upon) weren't working as I expected. Apparently, the Powerbook keymappings are, er, nonstandard. To address this, (if you have a Powerbook), you have two choices. Either add the line

	stty erase '^H'

to your .login file, or (if you're brave) edit resource 128 of the MachTen kchr resource using ResEdit.

Alternatives

If you're interested in UNIX on the Macintosh, there are a number of alternatives to Power MachTen. If you're still using a 68K-based Macintosh, Tenon still offers Professional MachTen 2.3. Professional MachTen is an implementation of Berkeley 4.3 UNIX for 68K-based Macintoshes (including the Classic and the Powerbook Duo). You'll need memory management support to take advantage of MachTen paging and memory protection.

Linux and the other BSDs

If you're willing to devote a few hard disk partitions (and reboot between using UNIX and using Mac OS), you can install any of several different UNIX variants as separate (non-integrated) operating systems. OpenBSD and NetBSD both offer versions of BSD (Berkeley) UNIX (similar to what is available with MachTen). OpenBSD (http://www.openbsd.org/) is a 4.4 BSD system which runs on 68K and (some) PowerPC Macintosh platforms. NetBSD runs on the 68K platform, but not yet on PowerPC architecture. Both OpenBSD and NetBSD come complete with source code and are available for a nominal cost.

If you prefer Linux (yet another version of UNIX), you may want to consider either MkLinux (http://www.mklinux.apple.com) or LinuxPPC (http://www.linuxppc.org). Both are based on RedHat Linux; MkLinux uses a Mach microkernel similar to that used by MachTen (hence the mk in the name). LinuxPPC does not. Both MkLinux and LinuxPPC are available only for the PowerPC Macintosh line. (Not all Power Macintoshes are supported, however). Both MkLinux and LinuxPPC come complete with source code and are available for a nominal cost.

The upside of the freely redistributable UNIX projects is that source code is available and everyone is invited to join in the development effort. The downside is that support is often ad hoc, consisting of mailing lists and Usenet news groups. Your choice should be made based on what you're looking for - a commercially supported environment, or a chance to get personally involved in your own UNIX system. You'll also need to decide whether the need to reboot the machine bothers you. Although MkLinux, for example, can access your HFS files, it cannot run concurrently with Mac OS.

Mac OS X Server

Coming soon from Apple Computer, Mac OS X Server (formerly Rhapsody) is also based on BSD 4.4. UNIX. Mac OS X Server was not available for review when this article was written, but the Mac OS X team has released some information.

It's still unclear whether Mac OS X server will ship with source code. However, 4.4 BSD source code is available elsewhere. Mac OS X server is not expected to include the X Window environment anytime soon. It will, however, be fully integrated with the Mac OS. The look and feel is slightly different (resembling the former NeXT environment) but it will be a mostly familiar GUI. If you're planning to develop code for the next generation of Macintosh computers, Mac OS X server may be what you want.

If you're comparing UNIX versions by price, Mac OS X server is currently described as having a suggested retail price of US$1000. At four times the cost of MachTen and considerably more than the cost of a MkLinux CD-ROM, you'll have to decide if the features it provides are worth the price.

UNIX lookalikes - Mac 06

Finally, if you're interested in learning about UNIX, but don't really feel the need to install a complete UNIX system, there are several UNIX "shell" lookalikes available as shareware. One promising candidate is currently in active development. Mac06 (pronounced "Mac oh six") is a POSIX compatible UNIX-like application that runs on top of Mac OS. It supports both 68K and PowerPC Macintoshes and has full Finder integration.

The software is currently free (when version 1.0 is finalized, it will become shareware). During the development period, feedback (as well as donations) are cordially invited. It's a interesting project. Take a look at <http://www.dsitri.de/projects/mac06/index.html> for complete information and download.

Bibliography and References

  • UNIX® has been a trademark of many organizations in the years since its inception at Bell Labs in 1969. Currently, UNIX is a registered trademark of The Open Group <http://www.opengroup.org/trademarks.html>.
  • CodeBuilder and MachTen are products of Tenon Intersystems. Complete information is available at <http://www.tenon.com>. Details regarding the WebTen SDK are available at <http://www.tenon.com/products/webten/SDK>.
  • Apache is the industry standard Open Source Web Server. See <http://www.apache.org> for additional information and details.
  • Kernighan, Brian and Pike, Rob. The UNIX Programming Environment. First published fifteen years ago, this book remains a classic, describing both the programming environment and the philosophy behind a UNIX system.

Vicki Brown has been programming computers for about 20 years now. She discovered Unix in 1983 and the Macintosh in 1986. Unix is her favorite OS, but the Mac OS is her favorite user interface. She changed her desktop machine to a Macintosh five years ago. Vicki is currently employed as a Perl programmer for a Silicon Valley Biotech firm. She is the co-author of MacPerl: Power and Ease. When she's not programming or writing, Vicki enjoys relaxing with her spouse and their two Maine Coon cats.

 
AAPL
$519.01
Apple Inc.
+1.05
MSFT
$40.40
Microsoft Corpora
+0.65
GOOG
$556.54
Google Inc.
+20.10

MacTech Search:
Community Search:

Software Updates via MacUpdate

PDFpenPro 6.2 - Advanced PDF toolkit for...
PDFpenPro allows users to edit PDF's easily. Add text, images and signatures. Fill out PDF forms. Merge or split PDF documents. Reorder and delete pages. Even correct text and edit graphics! Create... Read more
PDFpen 6.2 - Edit and annotate PDFs with...
PDFpen allows users to easily edit PDF's. Add text, images and signatures. Fill out PDF forms. Merge or split PDF documents. Reorder and delete pages. Even correct text and edit graphics! Features... Read more
Monolingual 1.5.9 - Remove unwanted OS X...
Monolingual is a program for removing unnecesary language resources from OS X, in order to reclaim several hundred megabytes of disk space. It requires a 64-bit capable Intel-based Mac and at least... Read more
Maya 2015 - Professional 3D modeling and...
Maya is an award-winning software and powerful, integrated 3D modeling, animation, visual effects, and rendering solution. Because Maya is based on an open architecture, all your work can be scripted... Read more
Starcraft II: Wings of Liberty 1.1.1.180...
Download the patch by launching the Starcraft II game and downloading it through the Battle.net connection within the app. Starcraft II: Wings of Liberty is a strategy game played in real-time. You... Read more
Sibelius 7.5.0 - Music notation solution...
Sibelius is the world's best-selling music notation software for Mac. It is as intuitive to use as a pen, yet so powerful that it does most things in less than the blink of an eye. The demo includes... Read more
Typinator 5.9 - Speedy and reliable text...
Typinator turbo-charges your typing productivity. Type a little. Typinator does the rest. We've all faced projects that require repetitive typing tasks. With Typinator, you can store commonly used... Read more
MYStuff Pro 2.0.16 - Create inventories...
MYStuff Pro is the most flexible way to create detail-rich inventories for your home or small business. Add items to MYStuff by dragging and dropping existing information, uploading new images, or... Read more
TurboTax 2013.r17.002 - Manage your 2013...
TurboTax guides you through your tax return step by step, does all the calculations, and checks your return for errors and overlooked deductions. It lets you file your return electronically to get... Read more
TrailRunner 3.8.769 - Route planning for...
Note: While the software is classified as freeware, it is actually donationware. Please consider making a donation to help support development. TrailRunner is the perfect companion for runners,... Read more

Latest Forum Discussions

See All

Unpossible (Games)
Unpossible 1.0 Device: iOS Universal Category: Games Price: $1.99, Version: 1.0 (iTunes) Description: **Important** Requires at least iPad 2, iPhone 4S, iPod Touch (5th gen), or newer. | Read more »
Hitman GO (Games)
Hitman GO 1.2 Device: iOS Universal Category: Games Price: $4.99, Version: 1.2 (iTunes) Description: Get your daily fix of Agent 47 with this elegant, strategy-based Hitman game! | Read more »
The Seventh Sign: Hodappy Bird Released...
The Seventh Sign: Hodappy Bird Released on the App Store Posted by Jeff Scott on April 16th, 2014 [ permalink ] Universal App - Designed for iPhone and iPad | Read more »
Rogue Heroes (Games)
Rogue Heroes 1.0 Device: iOS Universal Category: Games Price: $1.99, Version: 1.0 (iTunes) Description: Rogue Heroes is awesome fast-paced 2D action-platforming roguelike game with RPG elements. - explore the depth of procedurally... | Read more »
Fourcast Review
Fourcast Review By Jennifer Allen on April 16th, 2014 Our Rating: :: VIDEO POTENTIALiPhone App - Designed for the iPhone, compatible with the iPad Fourcast is a great idea for combining video clips, but it does lack a number of... | Read more »
Hearthstone: Heroes of Warcraft is Avail...
Hearthstone: Heroes of Warcraft is Available on the U.S. App Store Right Now – Gogogogo! Posted by Rob Rich on April 16th, 2014 [ permalink ] | Read more »
Grammar Pop HD Review
Grammar Pop HD Review By Jennifer Allen on April 16th, 2014 Our Rating: :: FUN LEARNINGiPad Only App - Designed for the iPad Learning the different parts of speech isn’t always fun, but Grammar Pop HD makes it much more... | Read more »
Groundskeeper2 Review
Groundskeeper2 Review By Nadia Oxford on April 16th, 2014 Our Rating: :: SLICE THOSE ALIEN SLIMEUniversal App - Designed for iPhone and iPad Putting aside some minor control issues, Groundskeeper2 is a fun and furious action/... | Read more »
Pinnacle Studio for iPhone (Photography...
Pinnacle Studio for iPhone 5.0 Device: iOS iPhone Category: Photography Price: $9.99, Version: 5.0 (iTunes) Description: | Read more »
Season 3 of Zombies, Run! Starts Right N...
Season 3 of Zombies, Run! | Read more »

Price Scanner via MacPrices.net

Microsoft Blinks – Drops Microsoft Office 365...
Microsoft has dropped the annual subscription fee for Microsoft Office 365 Personal – which is needed in order to create and edit documents in Microsoft Office for iPad. However, Apple’s iOS and OS X... Read more
New AVG Vault Apps for iOS and Android Help K...
AVG Technologies N.V. an online security company for 177 million active users, has announced the launch of its latest mobile application, AVG Vault. The free app introduces an innovative user... Read more
Free Local Carrot iPhone App Helps Find Fresh...
I love fresh vegetables. I’m not a vegan, although I was for several years in the 1980s, but fresh vegetables and other whole foods are still my dietary mainstays as a matter of taste rather than... Read more
Apple refurbished iPad Airs available startin...
Apple is now offering Certified Refurbished iPad Airs for up to $140 off MSRP. Apple’s one-year warranty is included with each model, and shipping is free. The following Airs are available today: -... Read more
21-inch 2.7GHz iMac on sale for $1179, save $...
B&H Photo has the 21″ 2.7GHz iMac on sale for $1179 including free shipping plus NY sales tax only. Their price is $120 off MSRP. Add an iMac to your shopping cart, and B&H will offer an... Read more
Download our app, iTracx, for iOS and Android
MacPrices is proud to offer readers a free iOS app (iPhones, iPads, & iPod touch) and Android app (Google Play and Amazon App Store) called iTracx, which allows you to glance at today’s lowest... Read more
Education discounts shave up to $300 off the...
Purchase a new Mac at The Apple Store for Education and take up to $300 off MSRP. All teachers, students, and staff of any educational institution qualify for the discount. Shipping is free, and all... Read more
Save $50 on Mac mini Server
B&H Photo has the 2012 Mac mini Server on sale for $949 including free shipping plus NY sales tax only. Their price is $50 off MSRP. Read more
PhatWare’s “Ultimate Writing App For iOS” Ren...
PhatWare Corp. has announced it has renamed its new WritePro word processing app for iPhone and iPad: WritePad Pro. The decision to change the app’s name to leverages the strong brand awareness and... Read more
Full Resolution Photo Editor Tint Mint 1.0 Re...
California based independent developer, Jeffrey Sun, creator of the iOS app Modern Editor, has released Tint Mint, a new photography app for editing enthusiasts. The app costs a dollar, and it packs... Read more

Jobs Board

*Apple* Retail - Manager - Holyoke - Apple I...
Job Summary Keeping an Apple Store thriving requires a diverse set of leadership skills, and as a Manager, you’re a master of them all. In the store’s fast-paced, Read more
*Apple* Retail - Manager - Apple (United Sta...
Job SummaryKeeping an Apple Store thriving requires a diverse set of leadership skills, and as a Manager, you're a master of them all. In the store's fast-paced, dynamic Read more
*Apple* Solutions Consultant (ASC) - Apple (...
**Job Summary** The ASC is an Apple employee who serves as an Apple brand ambassador and influencer in a Reseller's store. The ASC's role is to grow Apple Read more
*Apple* Retail - Market Leader - Cincinnati...
…challenges of developing individuals, building teams, and affecting growth across Apple Stores. You demonstrate successful leadership ability - focusing on excellence Read more
*Apple* Retail - Manager - SoHo - Apple (Uni...
Job SummaryKeeping an Apple Store thriving requires a diverse set of leadership skills, and as a Manager, you're a master of them all. In the store's fast-paced, dynamic Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.