# Download and Run the ApplixWare CD

This procedure downloads the Walnut Creek ApplixWare for FreeBSD November
1999 CD image, extracts it on the FreeBSD host, exposes the files inside the
running `applix151` jail, and performs the first diagnostic run.

## 1. Download the CD image

Run these commands on the FreeBSD host from `/root/projects/applix`:

```sh
cd /root/projects/applix

ISO_URL=https://archive.org/download/Applixware_Office_for_FreeBSD_Walnut_Creek_November_1999/Applixware_Office_for_FreeBSD_Walnut_Creek_November_1999.iso
ISO=Applixware_Office_for_FreeBSD_Walnut_Creek_November_1999.iso

if [ ! -s "$ISO" ]; then
  if [ -s "$ISO.part" ]; then
    fetch -r -o "$ISO.part" "$ISO_URL"
  else
    fetch -o "$ISO.part" "$ISO_URL"
  fi
  mv "$ISO.part" "$ISO"
fi
```

The `.part` file makes an interrupted download resumable. The completed image
is renamed to its final filename only after `fetch` succeeds.

## 2. Extract the CD image

FreeBSD's `tar` can read the ISO filesystem directly:

```sh
mkdir -p tmp/applix-iso-extract unzip/applixware1999cdrom
tar -xf "$ISO" -C tmp/applix-iso-extract

(cd tmp/applix-iso-extract && tar -cf - .) |
  (cd unzip/applixware1999cdrom && tar -xpf -)

test -x unzip/applixware1999cdrom/applix
```

The second `tar` pipeline copies the extracted CD tree while preserving its
permissions. The final `test` verifies that the Applix launcher exists and is
executable.

## 3. Put the CD tree inside the jail

The checkout used in this investigation has this jail root:

```sh
JAIL_ROOT=/mnt/tank/finch/usr/local/bastille/jails/applix151/root
```

Adjust `JAIL_ROOT` if the jail is stored elsewhere. Copy the extracted CD tree
to the path that will appear as `/applixware1999cdrom` inside the jail:

```sh
mkdir -p "$JAIL_ROOT/applixware1999cdrom"

(cd /root/projects/applix/unzip/applixware1999cdrom && tar -cf - .) |
  (cd "$JAIL_ROOT/applixware1999cdrom" && tar -xpf -)

jexec applix151 test -x /applixware1999cdrom/applix
```

This is an extracted copy of the CD contents, not the final writable
ApplixWare installation.

## 4. Run the original launcher

```sh
jexec applix151 /applixware1999cdrom/applix
```

Initial result:

```text
ELF interpreter /usr/libexec/ld-elf.so.1 not found, error 8
Abort trap
```

The named interpreter path may exist, so first identify the executable itself:

```sh
jexec applix151 file /applixware1999cdrom/applix
```

```text
/applixware1999cdrom/applix: ELF 32-bit LSB executable, Intel i386, version 1 (SYSV), dynamically linked, interpreter /usr/libexec/ld-elf.so.1, not stripped
```

The decisive detail is `ELF 32-bit` and `Intel i386`: ApplixWare needs the
FreeBSD 32-bit runtime, but the amd64 jail does not have it yet. Confirm that
boundary by asking `ldd` to inspect the executable:

```sh
jexec applix151 ldd /applixware1999cdrom/applix
ldd: /usr/bin/ldd32: No such file or directory
```
