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.

Newbie Guide To A/UX (Apple UNIX)

From Higher Intellect Vintage Wiki

This will be a compilation of information designed to help first time A/UX users, or anyone not fully familiar with the workings of UNIX, to get A/UX (Apple UNIX) installed and configured.

Installation[edit]

Getting Started[edit]

A/UX requires a 68K based Macintosh with an FPU and PMMU. It will not run on any PowerBook or LC models. I recommend using a Motorola 68040 based system for the best performance. The A/UX 3.0.1 installer will work without modification on systems such as the Macintosh Quadra 700 but some of the newer Quadra models may require an 040 enabler.

The installers and patches can be found on a number of sites including Mac Garden, Macintosh Repository, Winworld, etc. We also keep an A/UX archive on preterhuman.net which has been online since 2001 and is accessible via Hotline/KDX protocol using URL hl.preterhuman.net. The following process will get you up to the latest A/UX 3.1.1 release, though be warned you should only run this version on 32-bit clean Macs or you'll have stability issues.

  1. Burn the A/UX 3.0.1 CD image (don't try to mount it first - may corrupt the non-Mac side of the image) to a blank CD
  2. Write the A/UX 3.0.1 installer boot disk to a floppy disk
  3. Boot from the disk with the install CD already in the drive. Perform the install.
  4. Burn the A/UX 3.1 CD image to a blank CD, or you may also find a StuffIt archive of the contents of this update on preterhuman.net's server. May be referred to as AWS 95 Software Upgrade. Run this while logged in as root.
  5. Write the AWS 95 Tune-Up 2.0 disk to a floppy, or extract the image and run it as root. Note that you probably can't run the installer from the same volume as you're installing to.

Notes[edit]

  • If you're using a disk larger than 4GB, you may want to install the LaCie SilverLining driver as some Mac hardware may not work properly if the bootable MacPartition exists too far away from the start of the disk. Keep the first 16K assigned to the Apple disk driver and the SilverLining utility will add 64K after it for its driver. Version 5.8.3 seems to work just fine with an 8GB disk in a Macintosh Quadra 700 and can be found in the preterhuman.net Hotline/KDX server.
  • The A/UX easy install can do all the disk partitioning for you but if you choose to make your own layout, you'll want to make your HFS partitions on the disk prior to launching the A/UX installer as the custom partition options for some reason are missing HFS.
  • If you pre-partition the A/UX slices outside of the A/UX installer, they also must be formatted as the installer will try to mount them. It is probably easier just to make your A/UX slices using the HD SC utility inside the A/UX installer. This formats them as you create them.

Configuration[edit]

Assign IP address[edit]

Once you've done your initial A/UX install, run "newconfig" in a root shell and you will be prompted to configure the Ethernet address details. Your onboard Macintosh Ethernet adapter will likely show up as something like ae0 or ao0. Do NOT try messing with the MacTCP control panel on the Mac side.

Enable networking in /etc/inittab[edit]

Edit the /etc/inittab file and make the following line modifications for the networking related options you wish to enable:

nfs0:2:wait:/etc/portmap	#Set to "wait" for networking
net9:2:respawn:/etc/inetd	#Set to "respawn" for networking
net6:2:wait:/etc/syslogd	#Set to "wait" to run a syslog daemon

Assign default network route[edit]

After you've assigned an IP address to your network adapter, you'll probably want to assign a default route so you can reach outside networks. Replace "192.168.0.1" in the below line with your actual router gateway.

echo /usr/etc/route add default 192.168.0.1 1 >> /etc/rc

This ensures the route is persistent after a reboot.

Adding nameserver[edit]

Like a Linux system, A/UX will use /etc/resolv.conf to store nameservers for domain resolution. This file does not exist by default so you can use the following to add a public DNS resolver:

echo nameserver 8.8.8.8 > /etc/resolv.conf

Adding modules to the kernel[edit]

As noted in the section about configuring your network adapter, "newconfig" is used to configure the UNIX kernel for your hardware. You can also use the command to add modules to your kernel. See the examples below:

! adds both the nfs and debugger modules to your kernel
/etc/newconfig -v nfs debugger

! removes debugger module from your kernel
/etc/newconfig -v nodebugger

Running NCSA HTTPd[edit]

While compiling a copy of Apache HTTPd might be a more logical option, you can install a pre-compiled version of NCSA HTTPd 1.4.1 found on the old jagubox server (now available at ftp://ftp.atlas.altexxa.net/software/mac/unix/httpd-1.4.1-aux.bin.tar.gz) and serve HTTP with A/UX.

[netfreak@apollo]:/usr/local/etc/httpd$ httpd -v
NCSA httpd version NCSA/1.4.1.
  1. Extract the contents of the tar.gz archive into /usr/local/etc/httpd, or you can store it elsewhere and drop a symlink pointing to your custom location (all the configs expect it at /usr/local/etc/httpd though so might as well put it there)
  2. Change permissions on the contents of the directory so non-root users can read/execute.
  3. Create a logs directory in httpd, and it will probably need to be non-root writable unless you change ownership to the user account you'll assign to HTTPd.
  4. Create an htdocs directory in httpd as this is where the DocumentRoot will be, or create the directory elsewhere and note the location for the conf file edits.
  5. Go into the conf directory and create access.conf, httpd.conf and srm.conf as copies of the existing files with "-dist" at the end of the filename.
  6. Set access.conf to use your correct DocumentRoot path if you've chosen something other than /usr/local/etc/httpd/htdocs
  7. Set httpd.conf lines "User nobody" and "Group sys" or choose another group if you'd like (User nobody should already be set but the existing group line didn't work for me out of the box). You'll also need to update the directory configs if you picked something non-standard. Might also want to define your server name here too.
  8. Set srm.conf for the correct DocumentRoot and other directory paths if you chose something non-standard.
  9. Try starting the service by executing "/usr/local/etc/httpd/httpd" as root, and it should spawn the processes under user "nobody"
  10. To have it start automatically on startup, include the above line in your /etc/rc file or browse further down this page for instructions on using inittab and an rc.local file to start custom services.

Customization[edit]

Using bash shell[edit]

You can obtain a compiled binary of the bash shell (also includes info for compiling yourself) from a jagubox mirror (http://polysoft.fr/jagubox/AA.new_files/bash-aux.bin.tar.gz). Place the binary in /bin, perform a "chmod 755", perform a "chown bin", edit the /etc/shells file to include the path /bin/bash as a known shell. Edit the /etc/passwd file and change your desired user account line to use /bin/bash as the shell (instead of /bin/csh for example). Establish a new shell connection and you should be dropped into the bash shell.

User shell profile tweaks[edit]

The two changes I wanted to make to my shell profile include adding /usr/local/Gnu (used by the gcc package from jagubox) plus /lib to the path config and also tweaking my shell prompt to be a little more Linux-like. In my case I simply used the Mac side text editor to open the ".profile" file in my A/UX user directory and add to the PATH line. Below is what I've used for my shell prompt.

# OLD
# PS1="`hostname`.$LOGNAME $prmp"
# NEW
PS1="[$LOGNAME@`hostname`]:\w$prmp"

(the above config produces the below prompt with the bash shell)
[netfreak@apollo]:/usr/bin$

Compatible additions to Mac system folder[edit]

The "Mac" side of A/UX only went as high as system version 7.0.1. You cannot upgrade this, but you can add elements from other system versions or third party extensions to make the Mac side of things more convenient. Here's a few things you may find convenient to add to your A/UX user's system folder:

  • WindowShade - this control panel from System 7.5 allows you to collapse Mac windows via title bar and appears to work fine
  • DOS Mounter 95 - supports the use of DOS formatted disks as this was not included with the Mac system software until around System 7.5
  • Apple Menu Options - this control panel from System 7.5 allows you to expand a directory tree via the Apple menu for convenient menu browsing
  • Moire v3.0 - popular Macintosh screensaver which seems to work without any issue

Disable graphical login screen[edit]

If you want to revert to a full screen text window for your A/UX login instead of the default graphical system, simply changing the attributes of /etc/macgetty so it is not executable will accomplish this as it will fall back to the text version. To launch the traditional Macintosh environment from the full text mode, run "mac32"

Disable autologin[edit]

The console will automatically login as the root user by default. You can disable this by removing the file located at "/mac/sys/Login System Folder/Preferences/Autologin" and you'll be prompted with the login screen from now on.

Enable AppleDouble on filesystem[edit]

What is AppleDouble? Essentially this is how Apple handles dual fork files on a non-HFS filesystem. Depending on the type of file, a Mac file may have both a resource fork and data fork. This doesn't automatically translate on the A/UX filesystem and it may cause a problem for you depending on your requirements. The following can be placed in /etc/profile for setting globally or placed in an individual user's .profile:

TBFILEFORMAT=1
export TBFILEFORMAT

Mounting extra filesystems during boot[edit]

The "fsentry" command is used to update /etc/fstab with any non-default file systems you want to add to your workstation. See the below example:

! fsentry -p 2 -t (type) (block-device) (mount-point)
! type being 4.2 for UFS, 5.2 for SVFS, nfs for NFS
! example below mounts UFS slice 3 of device c405d0 to /usr
fsentry -p 2 -t 4.2 /dev/dsk/c405d0s3 /usr

Increasing Finder memory allocation[edit]

A portion of your total system memory will be allocated to the Macintosh Finder for console users logged in to the system. Running in 32-bit mac32 mode, this seems to cap itself at 16MB by default (A/UX 3.0.1 and later) assuming your system has more than that installed (in my case total RAM was 20MB, later upgraded to 68MB). You want to leave A/UX with a large enough chunk of ram to reduce excessive swap use, but if your system has more than 64MB RAM you might want to give the Finder more than 16MB. This is easily done with either of these methods:

  • Login to the Mac console as root and change the option in the Memory control panel from 16M to your desired amount
  • Use the 'TBMEMORY' environment variable. You can set it's "value" equal to the amount of memory you wish to use. For example, TBMEMORY=24m; export TBMEMORY (in .profile for ksh or sh or /etc/profile) or setenv TBMEMORY 24m (in .login for csh) configures Finder for 24M.

Create rc.local to start custom services[edit]

While you could just add your services to /etc/rc, we're going to have inittab execute a new rc.local script which will start service such as HTTPd.

  1. Edit /etc/inittab and add this line to the file:
lcl0:2:wait:/etc/rc.local 1>/dev/syscon 2>&1                    # Local stuff
  1. Create new file /etc/rc.local and use the below example which is configured to start NCSA HTTPd in its default location:
#!/bin/sh
:
: rc.local
:

# Push line discipline/set the device so it will print
/etc/line_sane 1
echo " "
echo "Entering rc.local..."
set `/bin/who -r`
if [ "$7" = 2 ]
then
        echo "\tRunning NCSA HTTPd"
        /usr/local/etc/httpd/httpd -d /usr/local/etc/httpd
        sleep 3
fi

echo "Leaving rc.local..."

Helpful Commands[edit]

Uncompress a .Z archive[edit]

The stock A/UX install doesn't include gzip/gunzip and tar will not extract Z files. A number of the A/UX files online such as via jagubox mirror will be in .gz format, so here is how you would extract the gzip archive (http://polysoft.fr/jagubox/Utilities/gzip-124.bin.tar.Z) using zcat and tar:

# zcat gzip-124.bin.tar.Z | tar -xvf -
x gunzip, 52780 bytes, 104 tape blocks
x gunzip.1.Z, 8187 bytes, 16 tape blocks
x gzexe, 3858 bytes, 8 tape blocks
x gzexe.1.Z, 1050 bytes, 3 tape blocks
gzip linked to gunzip
gzip.1.Z linked to gunzip.1.Z
zcat linked to gunzip
zcat.1.Z linked to gunzip.1.Z
x zcmp, 2006 bytes, 4 tape blocks
x zcmp.1.Z, 679 bytes, 2 tape blocks
zdiff linked to zcmp
zdiff.1.Z linked to zcmp.1.Z
x zforce, 1010 bytes, 2 tape blocks
x zforce.1.Z, 565 bytes, 2 tape blocks
x zgrep, 1339 bytes, 3 tape blocks
x zgrep.1.Z, 805 bytes, 2 tape blocks
x zmore, 1074 bytes, 3 tape blocks
x zmore.1.Z, 2708 bytes, 6 tape blocks
x znew, 3508 bytes, 7 tape blocks
x znew.1.Z, 833 bytes, 2 tape blocks

Uncompress a .gz archive[edit]

First do the above process for extracting the gzip binary downloaded from a jagubox mirror. Copy the binaries such as gzip/gunzip to a convenient path such as /usr/bin. Any user should now be able to uncompress .gz archives:

# gunzip telnet-aux.tar.gz

The following should also do both the tar/gz at once:

gzip -dc <filename.tar.gz> | tar xvfmo -

Reread /etc/inittab with init[edit]

This might be helpful if you make a change to your /etc/inittab settings and want to have the system recognize it.

init Q

Terminate all Mac applications including Finder[edit]

This isn't an A/UX command but a keystroke that may help if your Mac environment has crashed. Press "COMMAND-CONTROL-E" and A/UX will attempt to quit all applications and logout of the Mac environment.

Using netstat[edit]

View the routing table[edit]

This is done using "netstat -r" in this example:

[netfreak@apollo]:~$ netstat -r
Routing tables
Destination      Gateway            Flags     Refs     Use  Interface
localhost        localhost          UH          3       36  lo0
default          10.16.1.1          UG          0        0  ao0
10.16.1          apollo             U           3      104  ao0

View all open sockets[edit]

Similar to other *nix systems, this is done using "netstat -a" in this example:

[netfreak@apollo]:~$ netstat -a
Active Internet connections (including servers)
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)
tcp        0      0  localhost.1033         localhost.sunrpc       TIME_WAIT
tcp        0      0  apollo.telnet          10.16.1.59.64060       ESTABLISHED
tcp        0      0  *.time                 *.*                    LISTEN
tcp        0      0  *.daytime              *.*                    LISTEN
tcp        0      0  *.chargen              *.*                    LISTEN
tcp        0      0  *.discard              *.*                    LISTEN
tcp        0      0  *.echo                 *.*                    LISTEN
tcp        0      0  *.finger               *.*                    LISTEN
tcp        0      0  *.uucp                 *.*                    LISTEN
tcp        0      0  *.exec                 *.*                    LISTEN
tcp        0      0  *.login                *.*                    LISTEN
tcp        0      0  *.shell                *.*                    LISTEN
tcp        0      0  *.telnet               *.*                    LISTEN
tcp        0      0  *.ftp                  *.*                    LISTEN
tcp        0      0  *.sunrpc               *.*                    LISTEN
(snip)

View all processes[edit]

Similar to other *nix systems, "ps -ef" will show all processes in the below example. You can also utilize grep to find specifics in the output.

[netfreak@apollo]:~$ ps -ef
     UID   PID  PPID  C    STIME TTY      TIME COMMAND
    root     0     0  0 16:00:41 ?        0:00 swapper
    root     1     0  0 16:00:41 ?        0:01 /etc/init
    root     2     0  0 16:00:41 ?        0:00 vhand
    root     3     0  0 16:00:41 ?        0:00 kmemd
    root     4     0  0 16:00:41 ?        0:00 asiod
    root     5     0  0 16:00:41 ?        0:00 asiod
    root     6     0  0 16:00:41 ?        0:00 asiod
    root     7     0  0 16:00:41 ?        0:00 asiod
    root     8     0  0 16:00:41 ?        0:00 syncd
    root   142     1  0 16:01:09 ?        0:00 /etc/inetd
    root    11     1  0 16:00:42 ?        0:00 /etc/fidd
    root   147     1  0 16:01:12 console  0:01 /etc/macgetty
    root   132     1  0 16:01:08 ?        0:00 /usr/lib/errdemon
    root   150   147  0 16:01:13 console  0:00 sh -c /mac/bin/startmac -o minimal -m8
    root   137     1  0 16:01:08 ?        0:00 /etc/portmap
    root   140     1  0 16:01:09 ?        0:00 /etc/cron
    root   151   150  0 16:01:13 console  0:09 /mac/bin/startmac -o minimal -m8m -s /
    root   152   151  1 16:01:23 console  0:28 /mac/sys/Login System Folder/Login
    root   153   142  1 16:01:58 p0       0:00 in.telnetd a10013b.64060
netfreak   154   153  0 16:01:58 p0       0:01 -bash
netfreak   174   154 13 16:16:30 p0       0:00 ps -ef

Compiling A/UX Software[edit]

Installing GCC[edit]

Since this is a newbie guide, this will only discuss GCC 2.7.2 from the old jagubox server as it is packaged specifically for A/UX. Download the archive ftp://ftp.atlas.altexxa.net/software/mac/unix/gcc-2.7.2.bin.tar.gz to your workstation and extract it. As root, execute the "install-gcc-aux" script. On my Quadra 700 the install script took more than 30 minutes or so. As mentioned earlier on this page, you'll probably need to update your user profile PATH attributes for /usr/local/Gnu.

Compiler Options[edit]

(from http://www.nleymann.de/appleAUX/) Make sure that the "-g" option is switched off. The debugging options produces objects files which are 10-100 times bigger than the optimized versions. This will usually result in an "out of memory" message from the linker. "-g" is the standard option used by the gnu configure scripts! Use something like 'CFLAGS="-O" ./configure <other options>'

/bin/sh vs. /bin/ksh[edit]

(from http://www.nleymann.de/appleAUX/) The standard /bin/sh which comes with A/UX is broken and causes the confiure scripts to terminate. As a simple workaround replace /bin/sh with /bin/ksh in the configure scripts.