Please consider a donation to the Higher Intellect project. See https://preterhuman.net/donate.php or the Donate to Higher Intellect page for more info.

A/UX Development

From Higher Intellect Vintage Wiki
Jump to navigation Jump to search

Introduction

Welcome to A/UX and the A/UX Toolbox. This document explains the available application-development environments, describes development opportunities, and provides answers to commonly asked questions about A/UX. We hope the material will enable you to take advantage of the opportunities A/UX has created.

A/UX increases the market opportunities for both UNIX and Macintosh developers. It provides Macintosh developers with additional markets for their current Macintosh products, because Macintosh applications that conform to the Inside Macintosh guidelines can run in A/UX without change. In other words, the same product that a developer offers for the Macintosh operating system platform can also be offered for the A/UX platform. For UNIX developers, A/UX provides a standard UNIX environment for porting applications to A/UX. A/UX also provides developers with an excellent platform for additional software development for university, federal government, and commercial customers who are committed to a standard UNIX environment.

If you're a Macintosh developer, try testing your existing Macintosh applica­tions for compatibility with A/UX. You may already be able to offer your products to A/UX customers. If your code does not conform to Inside Macintosh guidelines, you are encouraged to start converting now; future release of the Macintosh operating system will also require strict compatibility to Inside Macintosh.

If you're a UNIX developer, you have two choices: port your existing applications to the A/UX platform, or develop new or enhanced A/UX-specific applications using the A/UX Toolbox.

Whether you are Macintosh or UNIX oriented, Apple and A/UX provide you with the tools and expertise to help you develop and market your applications for, the emerging UNIX desktop market. Ultimately, it's your skills and imagination that users are depending on for new and innovative A/UX applications.

A/UX Development Tools and Documentation

To help you develop A/UX applications on the Macintosh II, IIx, or IIcx, the A/UX system includes a C compiler and other development-tools. You will also need the following documentation and development tools:

Apple Equipment

  • Macintosh II, IIx, or IIcx computer with a minimum of 4 megabytes of RAM (and a 68851 PMMU chip for Macintosh II systems)
  • Macintosh-compatible monochrome or color monitor
  • A/UX on an 80-megabyte disk drive, disks, or tape (includes A/UX Accessory Kit)
  • Apple Tape Backup 40SC (optional)
  • Apple EtherTalk Interface Card (optional, but recommended)
  • Third-party communications card for LocalTalk printing from A/UX Toolbox applications (optional)

A/UX supports the Apple ImageWriter II and LaserWriter printers, and the Apple Hard Disk Drives 20SC, 40SC, 80SC, and 160SC.

Documentation

  • A/UX manuals (15-binder set), sold separately from A/UX software; available to Apple partners through the Developer Price List; and to Apple associates from an authorized Apple dealer
  • Inside Macintosh, Volumes I-V (included in the Developer Starter Kit); also available from APDA
  • Macintosh Technical Note #117: Compatibility: Why and How, available from APDA
  • A/UX Toolbox: Macintosh ROM Interface manual (included in the A/UX manual set)
  • Macintosh Technical Note #212: The joy of Being 32-Bit Clean, available from APDA

Introduction to A/UX

A/UX is an implementation of AT&T's UNIX System V, Release 2, Version 2 operat­ing system for the Macintosh II personal computer family. It conforms to the pub­lished System V Interface Definition (SVID) standard, POSIX 1003.1 Draft 12, and Federal Information Processing Standard (FIPS) #151. A/UX includes key features from Berkeley's BSD 4.3, as well as support for TCP/IP, X Window System, and Sun Microsystems' Network File System (NFS).

A/UX serves as an alternative to the Macintosh operating system. It com­bines the strengths of an industry-standard, multitasking operating system with the enhancements of the Macintosh technology and human interface. A/UX also gives the Macintosh the capability to share software and data in a multivendor or net­worked environment.

Standard UNIX Features

AT&T System V is becoming widely used in business and government markets, while BSD is becoming widely used in higher education and engineering markets. A/UX, which combines the features of both, provides developers with a standard platform for these four major workstation markets.

As a standard platform, A/UX offers the following:

  • Application source-code compatibility with other UNIX System V systems
  • Smooth porting for BSD 4.3 applications
  • Many connectivity options based on Ethernet or serial networks with industry­-standard facilities such as Berkeley Networking Services, NFS, and X Window System

Features Added by Apple

In addition to key features of the UNIX environment, A/UX includes special features that allow A/UX applications to:

  • Incorporate the Macintosh user interface
  • Increase system reliability
  • Reduce system administration requirements

Macintosh Toolbox Support

With A/UX, developers can access the Macintosh Toolbox to control user-interface options such as pull-down menus, multiple fonts, dialog boxes, and scroll bars; programs written for A/UX can utilize the standard Macintosh interface.

Macintosh Binary Support

Existing Macintosh applications can be launched directly into the A/UX environment. Consequently, Macintosh developers have an additional marketplace for their existing products, and customers have access to an expanded library of software.

Simple Startup

Unlike other UNIX systems, typing in a string of commands is unnecessary-you can start up A/UX by simply clicking on the A/UX icon.

Automatic Configuration

On startup, A/UX automatically reconfigures itself to access device drivers for cards installed in the Macintosh II system's NuBus slots. The ports and slots of the Macintosh II are polled for hardware changes. If a board has been removed, appro­priate drivers are automatically removed from the kernel, requiring no operator inter­vention.

Automatic Self Repair

A/UX keeps redundant copies of crucial system files. In the event of a damaging crash, it can automatically return the system to its operational state and repair lost or damaged critical system files.

TranScript from Adobe Systems, Inc.

A/UX includes the TranScript utility from Adobe Systems. Output from the UNIX Documenter's Workbench document-processing system can be formatted for the Apple LaserWriter printer, as well as for other printers that use Adobe's PostScript page-description language.

Toolbox-Related Components of A/UX

Toolbox routines fall into two categories: user-interface Toolbox routines and Macintosh operating-system routines. When an A/UX application places a call to one of the Macintosh user-interface Toolbox routines, the A/UX Toolbox intercepts the call and, if necessary, translates the parameters into a form usable by the ROMs. After the A/UX Toolbox translates the call, it invokes the same ROM code that would be used in the native Macintosh environment.

When an A/UX Toolbox application issues a call to one of the Macintosh operating system routines, the A/UX Toolbox diverts the call to a substitute routine in its own library. The A/UX Toolbox operating system routines make calls to the standard A/UX libraries to perform A/UX equivalents of the Macintosh operating system functions.

In both cases, the A/UX Toolbox incorporates a toolboxdaemon that runs in the background and services A/UX Toolbox requests.

Contents of the Toolbox

  • Source code for three sample programs (term, sample, and qdsamp) and the associated makefiles that demonstrate how to compile and link a program; executable code can be found in /usr/toolboxbin, while source code and makefiles are in /user/lib/mac/examples
  • Utilities for use when developing and running A/UX Toolbox applications; executable code can be found in /usr/toolboxbin
  • A library of routines that handle communications between an A/UX C program and the Macintosh ROM, in a file in /usr/lib/libmac.a
  • C interface files that define the constants, types, and functions used by the A/UX Toolbox libraries, in /usr/lnclude/mac
  • Resource-declaration files that declare the Macintosh resource types, in /usr/lib/mac/rincludes
  • The Macintosh file system, which contains resources required for operation of the A/UX Toolbox, in /usr/lib/mac/system
  • A special initialization file that must be linked into all A/UX Toolbox applications developed in A/UX, labeled /usr/lib/maccrt.0.o

New Features of A/UX

Release 1.1 of the A/UX Toolbox supports the following new features for developers (see the A/UX 1.1 data sheet for additional features added in release 1.1):

Standard Printing

Applications can print to the AppleTalk Protocol Stack using the standard Macintosh printing calls. (Note: 1he A/UX AppleTalk implementation does not use the built-in AppleTalk port. To use AppleTalk, you must install one of several third-party cards.)

Custom Video Drivers

The A/UX Toolbox supports custom video drivers, including color video drivers.

Desk Accessories

The A/UX Toolbox supports desk accessories and other custom device drivers that do not manipulate hardware. The standard software distribution contains the basic Macintosh desk accessories, including the Chooser and the Control Panel.

String Formats and Point Passing

The ROM interface libraries include two versions of all routines that take or return strings and points. One version uses Pascal string formats and point-passing conventions. The second uses C string formats and point-passing conventions, parallel to the change in MPW C, Version 3.0.

File Conversion Utility

A new utility, fcnvt, converts files in A/UX among the AppleSingle, AppleDouble, and simple A/UX formats, replacing rcnvt.

Left-to-Right Compiler Evaluation

The A/UX C compiler evaluates multicharacter constants from left to right, as does the MPW C Compiler.

Applications Development Environments

You can develop applications in either the Macintosh operating system or A/UX. Through the A/UX Toolbox, you can run applications and tools in one environment that were developed in the Macintosh operating system.

Both Macintosh binary files transferred to A/UX and A/UX Toolbox programs developed in A/UX must meet the A/UX Toolbox compatibility guidelines.

Porting a Macintosh Application to A/UX

When you port a Macintosh application to A/UX, follow these three steps: (See the attachment "Transferring Macintosh Applications to A/UX" for additional information on porting a Macintosh application to A/UX).

  • Check the source code for compatibility - compare the program against the recommendations in Inside Macintosh, Volumes 1-V. If necessary, modify, rebuild, and test the application in the Macintosh operating system before trans­ferring the file to A/UX. Also, refer to Macintosh Technical Note #212: The joy of Being 32-Bit Clean.
  • Transfer the binary file to A/UX - use the hfx utility to transfer the file from the Macintosh operating system to A/UX; both utilities read Macintosh floppy disks from within A/UX.

The hfx utility is an A/UX Toolbox application with a Macintosh-like interface. It can read both Macintosh hierarchical file system (HFS) and Macin­tosh flat file system (MFS) floppy disks. hfx always transfers a Macintosh file into a pair of AppleDouble files.

If you intend to use a transferred file only from Macintosh applications, we recommend that the file be transferred to A/UX in AppleSingle format. With AppleSingle format, both data and resource information is stored in a single file. If you intend to use a transferred file from both Macintosh and UNIX applica­tions and/or utilities, we recommend transferring to AppleDouble format. AppleDouble format separates Macintosh information into two files, one for resource information and one for data.

  • Run the application in A/UX - during the initial porting, the safest way to run an application is through the hfx utility. hfx allows you to set a timer before launching an application. If the application hangs, you can regain control of the system without rebooting when the timer runs out. Then, to fully test the application in A/UX, you can run it with the launch utility.

If the ported application does not run in A/UX, use one of the A/UX debuggers (adb or sdb) to identify the problem. Be aware that the Symbol Table information is not recognized by these debuggers. If your application is written in C, you might be able to use the debuggers more effectively if you transfer the source code to A/UX and compile it there. An A/UX version of MacsBug will be available from APDA in the near future.

When an A/UX Toolbox application is running, keyboard input is diverted to the Macintosh event queue. Input is not returned to the normal character queue until the program exits. Therefore, if you are using one of the A/UX debuggers on an A/UX Toolbox application from the Macintosh keyboard, you are unable to communicate with the machine after the debugger reports an error within the program. Because of this, you should always run the debugger from a terminal attached to a serial port or communicating over the network.

Shared Libraries

Because shared libraries are not implemented in Release 1.1 of A/UX, an A/UX Toolbox application (that is, a UNIX application with Toolbox calls) that you build now will contain the actual code for the current interface routine. The code is likely to be unusable in future releases. You can support future compatibility by shipping with your product the application's relocatable object code and makefile that link, or, "...and the makefile that links.." it to the appropriate libraries. Your customers can then rebuild the application using the new libraries after installing future releases of A/UX.

See Also