Difference between pages "Condition handler" and "A/UX"

From Computer History Wiki
(Difference between pages)
Jump to: navigation, search
m (+cat)
 
m (Significant Versions: Link FFS)
 
Line 1: Line 1:
A '''condition handler''' (sometimes '''exception handler''') refers to a mechanism in some [[programming language]]s which allows the programmer to provide code to handle the occurrence of a [[exception]] or condition (terminology varies, but the substance does not).
+
{{Infobox OS
 +
| image = softpc-on-aux.png
 +
| caption = A/UX 3.0.0 desktop
 +
| name = A/UX
 +
| creator = Apple/UniSoft
 +
| current version = 3.11
 +
| year introduced = 1988
 +
| type = Multitasking, multiuser
 +
| architecture = [[Macintosh]]
 +
}}
  
When such an event happens (be it caused by some sort of hardware-detected issue, e.g. 'divide by zero', or purely software, e.g. 'unexpected end-of-file'), program execution is diverted to an condition handler for that specific condition, which is expected to deal with it.
+
After [[Steve Jobs]] left [[Apple]], they scrambled to put together a system that could compete with [[NeXT]]. Hearing that NeXT was going to enter the [[UNIX|Unix]] [[workstation]] market, Apple commissioned [[UniSoft]] to help port [[SYSVr2]] to its [[Macintosh II]] lineup.
  
In some modern languages(e.g. [[Ada]] and [[Java]]), conditions are intended to be used as [[control flow]] mechanisms in normal operation. In others (e.g. [[C++]] and [[Common LISP]]), they are intended for use in dealing with unusual error situations.
+
== Significant Versions ==
 +
=== 0.7 ===
 +
[[Image:AUX 0.7 desktop.png|thumb|right|150px|A/UX 0.7's UI]]
 +
This version is more infamous because it included the source code to the kernel, which can be built with a little bit of work.  There is no real Toolbox in this version, but rather a bare minimal SYSV port.  This version uses a SYSV filesystem, while later versions of A/UX used 4.2BSD's [[BSD Fast File System|FFS]].
 +
=== 1.1.1 ===
 +
[[Image:AUX 1.1.1 desktop.png|thumb|right|150px|A/UX 1.1.1's GUI]]
 +
This is a super barebones version, the toolbox is barely able to run the terminal application and some simple desktop widgets.
 +
=== 2.0 ===
 +
[[Image:AUX 2.0 desktop.png|thumb|right|150px|A/UX 2.0's GUI]]
 +
Version 2.0 is more polished, and able to run a finder that is more parallel to [[System 6]].
 +
=== 3.0 ===
 +
[[Image:AUX 3.0 desktop.png|thumb|right|150px|A/UX 3.0's GUI]]
 +
This is the best version to get ahold of.  3.0 emulates a [[System 7|System 7.0.1]] environment.
 +
=== 3.1.1 ===
 +
This version was the final released version, in 1995
 +
=== 4.0 ===
 +
This version was announced, and abandoned in 1996
  
In procedural languages (such as [[ALGOL]] and [[C programming language|C]] - although neither one normally supports condition handlers), each [[subroutine|procedure]] can set up one or more condition handlers on entry to an instance of the procedure. From then on, until that instance exits, any time that condition is '''signalled''' (in either that procedure, or any procedure it calls, and so on), execution jumps to that condition handler. Should an inferior procedure set up a condition handler for that same condition, the inferior procedure's handler will be '''invoked''' preferentially.
+
== How do I get this to run?! ==
  
Condition handlers are usually provided with a number of ways to terminate their execution:
+
=== Physical Hardware ===
 +
You will need an actual [[Macintosh]] that is supported.  The best machines are the Quadra series.  Note, not all Quadras will run A/UX.
  
* they may (after repairing the condition that led to the signalling of the condition) '''resume''' operation at the place where the condition was signalled (although not all condition systems provide this option, since experience has shown it may not be useful);
+
The supported Macintosh Machines:
* they may '''re-signal''' the condition to a higher-level handler for that same condition;
+
* A/UX 1.0 ~ A/UX 2.0
* they may signal a different condition;
+
[ 68020 w/PMMU, 68030 ]
* they may '''terminate''' the program (if the problem cannot be repaired).
+
* Macintosh II, Rev B, with a 68851 PMMU
 +
* Macintosh SE/30
 +
* Macintosh IIx, IIcx, IIsi, IIci, IIfx
  
Some languages use the term 'throw' for raising an exception, and 'catch' for the handler.
+
A/UX 3.0 ~ A/UX 3.1.1
 +
[ 68040 ]
 +
* Centris 610, Centris 650
 +
* Quadra 605, 610, 650, 700, 800, 900, 950.
 +
* AWG 60, 80, 95
  
==Implementation approaches==
+
The Macintosh environment from 3.0.1 did not run on Shoebill at one point; now it does.
  
There are a number of approaches to implementing condition handlers.
+
However the unix side of 3.0.0 and 3.0.1 (below) does work. You can create a hybrid setup by replacing the /mac directory on 3.0.1 media with the /mac directory of 3.0.0 install media.
  
One is to keep information about active condition handlers for any invocation in its [[stack frame]] in the [[call stack]], so that handlers are automatically discarded when a procedure instance that set them up exits. When looking for a handler for a signalled condition, the condition system starts at the bottom of the call stack, and works its way upwards, looking for an active handler for rhat condition.
+
=== Emulation ===
 +
There is now 2 emulators capable of running A/UX, [[Shoebill]] and [[Qemu]].
  
This approach has the drawback that it is hard to provide resume semantics, but it has the advantage that if a handler in inside a procedure, the handler can easily have accesss to that procedure's [[automatic variable]]s. (It is hard to do both of these at the same time without a lot of work.)
+
==== Shoebill ====
 +
Shoebill emulator can run A/UX 1.1.1, 2.0 & 3.0.0 (*NOTE that version 3.0.0 seems to work the best).  The latest version includes SDL support which can run on *NIX'es and Windows.
  
Another possibility is to have a special stack on which condition handlers are listed, along with pointers to routines given the task of handling that condition.
+
==== Qemu ====
 +
The latest qemu-system-m68k includes a Quadra 800 machine profile which can run 3.0.1 and above.
  
These must be un-stacked when the procedure invocation which set them up exits, which is extra overhead, but with this approach it is easier to provide 'resume' semantics.
+
You can build it from the current dev branch, full instructions are [https://www.emaculation.com/forum/viewtopic.php?f=37&p=71794#p71794 here].
  
==Special operations==
+
<pre>
 +
git clone -b q800.upstream https://www.gitlab.com/mcayland/qemu q800-upstream
 +
cd q800-upstream
 +
./configure --target-list=m68k-softmmu --enable-gtk --enable-sdl
 +
make
 +
</pre>
  
In addition to the above, there are a variety of special operations associated with condition systems.
+
With Qemu in hand, you'll need to configure it for install with the [https://surfdrive.surf.nl/files/index.php/s/ZcJMgrSBqFAqfQA/download BootFloppy], [https://vpsland.superglobalmegacorp.com/install/MacOS/OS/Apple-AUX-3.0.1.7z ISO] and a pre-partitioned disk image.
 +
General instructions are from [https://www.emaculation.com/doku.php/m68k-qemu-on-windows here].
  
If no condition handler for a particular signalled condition is found in the call stack, the condition system may respond by signalling an 'unhandled condition' condition. Usually a handler for this condition is provided in the top-level procedure, to catch otherwise un-handled conditions.
+
(as of now the SCSI disk won't respond with Apple codes so the disk tool won't work).
 +
<pre>
 +
qemu-img.exe create -f raw AUX301.img 2G
 +
qemu-img.exe create -f raw pram.img 256
 +
</pre>
  
An '''unwind protect''' is a special condition handler (called '''finally''' in some languages) which, if set up in any procedure instance on the call stack, if the call stack has to be [[unwind|unwound]] ''through'' that instance to get to a handler for a particular signalled condition, for any procedure invocation which is unwound which has a handler for 'unwind protect', that handler is called 'on the way through'. This allows that instance to do any cleanup it needs to, before it is terminated by the condition system.
+
The command line to install is like this:
 +
<pre>
 +
qemu-system-m68k.exe ^
 +
-L pc-bios ^
 +
-m 32 ^
 +
-M q800 ^
 +
-display sdl ^
 +
-serial stdio ^
 +
-bios Quadra800.rom ^
 +
-g 800x600x8 ^
 +
-net nic,model=dp83932 -net user ^
 +
-drive file=pram-i1.img,format=raw,if=mtd ^
 +
-device scsi-hd,scsi-id=0,drive=fd0,vendor="SEAGATE",product="ST225N",ver="1.0" ^
 +
-drive file=AUXBootfloppy.img,media=disk,format=raw,if=none,id=fd0 ^
 +
-device scsi-hd,scsi-id=1,drive=hd0,vendor="SEAGATE",product="ST225N",ver="1.0" ^
 +
-drive file=AUX301.img,media=disk,format=raw,if=none,id=hd0 ^
 +
-device scsi-cd,scsi-id=3,drive=cd0,vendor="MATSHITA",product="CD-ROM CR-8005",ver="1.0k" ^
 +
-drive file=AUX301.iso,format=raw,media=cdrom,if=none,id=cd0
 +
</pre>
  
==Utility==
+
==What Runs?==  
  
Condition handlers are usually more use in very large programs; in small programs it is easy to simply return special values, which indicate an error, through a small number of level of procedure call. In large systems, where it may be desired to handle a condition at a much higher level than where it happens, this would require a lot of special-case handling in many intervening procedures. Signalling a condition, on the other hand, can tranfer control directly to the handler, without needing extra code in all the intervening procedures.
+
Some early GNU stuff will compile, however keep in mind that during the lifespan of A/UX GNU started up the Apple protest over the 'look and feel' lawsuit.
  
An example is a [[compiler]] using a [[recursive descent]] [[parser]], which in turn calls a [[lexical analyzer]]. If the latter discovers an un-expected 'end of file', there can be an extremely large number of procedure invocations in between where that is discovered, and where it is desirable to handle it.
+
==External links==
  
[[Category: Software Concepts]]
+
* [http://www.aux-penelope.com/ A/UX Server Penelope] - General information
 +
** [http://www.aux-penelope.com/hardware.htm Hardware Requirements]
 +
* [https://www.macintoshrepository.org/1696-a-ux-apple-unix-for-68k-version-3-0-1-3-1-update A/UX (Apple UNIX for 68k) version 3.0.1 + 3.1 update] - More sources for the emulator and OS
 +
* [https://virtuallyfun.com/wordpress/category/aux/ A/UX archives] - Posts on various topics
 +
 
 +
===Documentation===
 +
 
 +
* [http://christtrekker.users.sourceforge.net/doc/aux/faq.html Semi-official FAQ list for A/UX]
 +
* [http://n-1.nl/apple_aux/aux-faq/part1/ Apple A/UX FAQ List (1/4)] - A/UX Faq: THE place to start
 +
* [http://n-1.nl/apple_aux/aux-faq/part2/ Apple A/UX FAQ List (2/4)]
 +
* [http://n-1.nl/apple_aux/aux-faq/part3/ Apple A/UX FAQ List (3/4)]
 +
* [http://n-1.nl/apple_aux/aux-faq/part4/ Apple A/UX FAQ List (4/4)]
 +
<!-- * [https://archive.org/details/AppleAUXDocumentation xx] -->
 +
 
 +
===UNIX Timeline===
 +
 
 +
* [http://www.unix.org/Posters/download/unix_posterA3.pdf The Single UNIX Specification History & Timeline]
 +
 
 +
{{Nav Unix}}
 +
 
 +
[[Category: Apple Operating Systems]]
 +
[[Category: Unix-based OS's]]

Revision as of 13:40, 8 September 2021


A/UX
Softpc-on-aux.png
A/UX 3.0.0 desktop
Type: Multitasking, multiuser
Creator: Apple/UniSoft
Architecture: Macintosh
This Version: 3.11
Date Released: 1988


After Steve Jobs left Apple, they scrambled to put together a system that could compete with NeXT. Hearing that NeXT was going to enter the Unix workstation market, Apple commissioned UniSoft to help port SYSVr2 to its Macintosh II lineup.

Significant Versions

0.7

A/UX 0.7's UI

This version is more infamous because it included the source code to the kernel, which can be built with a little bit of work. There is no real Toolbox in this version, but rather a bare minimal SYSV port. This version uses a SYSV filesystem, while later versions of A/UX used 4.2BSD's FFS.

1.1.1

A/UX 1.1.1's GUI

This is a super barebones version, the toolbox is barely able to run the terminal application and some simple desktop widgets.

2.0

A/UX 2.0's GUI

Version 2.0 is more polished, and able to run a finder that is more parallel to System 6.

3.0

A/UX 3.0's GUI

This is the best version to get ahold of. 3.0 emulates a System 7.0.1 environment.

3.1.1

This version was the final released version, in 1995

4.0

This version was announced, and abandoned in 1996

How do I get this to run?!

Physical Hardware

You will need an actual Macintosh that is supported. The best machines are the Quadra series. Note, not all Quadras will run A/UX.

The supported Macintosh Machines:

  • A/UX 1.0 ~ A/UX 2.0

[ 68020 w/PMMU, 68030 ]

  • Macintosh II, Rev B, with a 68851 PMMU
  • Macintosh SE/30
  • Macintosh IIx, IIcx, IIsi, IIci, IIfx

A/UX 3.0 ~ A/UX 3.1.1 [ 68040 ]

  • Centris 610, Centris 650
  • Quadra 605, 610, 650, 700, 800, 900, 950.
  • AWG 60, 80, 95

The Macintosh environment from 3.0.1 did not run on Shoebill at one point; now it does.

However the unix side of 3.0.0 and 3.0.1 (below) does work. You can create a hybrid setup by replacing the /mac directory on 3.0.1 media with the /mac directory of 3.0.0 install media.

Emulation

There is now 2 emulators capable of running A/UX, Shoebill and Qemu.

Shoebill

Shoebill emulator can run A/UX 1.1.1, 2.0 & 3.0.0 (*NOTE that version 3.0.0 seems to work the best). The latest version includes SDL support which can run on *NIX'es and Windows.

Qemu

The latest qemu-system-m68k includes a Quadra 800 machine profile which can run 3.0.1 and above.

You can build it from the current dev branch, full instructions are here.

git clone -b q800.upstream https://www.gitlab.com/mcayland/qemu q800-upstream
cd q800-upstream
./configure --target-list=m68k-softmmu --enable-gtk --enable-sdl
make

With Qemu in hand, you'll need to configure it for install with the BootFloppy, ISO and a pre-partitioned disk image. General instructions are from here.

(as of now the SCSI disk won't respond with Apple codes so the disk tool won't work).

qemu-img.exe create -f raw AUX301.img 2G
qemu-img.exe create -f raw pram.img 256

The command line to install is like this:

qemu-system-m68k.exe ^
-L pc-bios ^
-m 32 ^
-M q800 ^
-display sdl ^
-serial stdio ^
-bios Quadra800.rom ^
-g 800x600x8 ^
-net nic,model=dp83932 -net user ^
-drive file=pram-i1.img,format=raw,if=mtd ^
-device scsi-hd,scsi-id=0,drive=fd0,vendor="SEAGATE",product="ST225N",ver="1.0" ^
-drive file=AUXBootfloppy.img,media=disk,format=raw,if=none,id=fd0 ^
-device scsi-hd,scsi-id=1,drive=hd0,vendor="SEAGATE",product="ST225N",ver="1.0" ^
-drive file=AUX301.img,media=disk,format=raw,if=none,id=hd0 ^
-device scsi-cd,scsi-id=3,drive=cd0,vendor="MATSHITA",product="CD-ROM CR-8005",ver="1.0k" ^
-drive file=AUX301.iso,format=raw,media=cdrom,if=none,id=cd0

What Runs?

Some early GNU stuff will compile, however keep in mind that during the lifespan of A/UX GNU started up the Apple protest over the 'look and feel' lawsuit.

External links

Documentation

UNIX Timeline