Xref: utzoo comp.sys.mac:20847 comp.sys.mac.programmer:2550
Path: utzoo!attcan!uunet!mcvax!cernvax!ethz!macman
From: macman@ethz.UUCP (Danny Schwendener)
Newsgroups: comp.sys.mac,comp.sys.mac.programmer
Subject: Bus and Address Error insights (was Re: Listing of error...)
Keywords: bus error address error macII interrupts
Message-ID: <630@ethz.UUCP>
Date: 27 Sep 88 00:47:50 GMT
References: <975@psu-cs.UUCP>
Reply-To: macman@ethz.UUCP (Danny Schwendener)
Organization: ETH Zuerich, Switzerland
Lines: 44


> Okay, now that I've got a Mac II, my most common error
> is "Bus Error" instead of "Address Error". But exactly what is a
> Bus Error?

Jim,
Exceptions can be generated by either internal or external means. 
The internal exceptions come from special instructions (Axxx and Fxxx 
Traps), an Address Error or the internal tracing mode (advanced users only), 
while the external Exceptions come from interrupts, a reset or a bus 
error from an external device.

Bus Errors are  generated by external devices like a parity checker,
a Watchdog timer or, in the case of the Macintosh,  the Memory 
Management Unit (MMU) and the NuBus.

The MMU will generate a Bus Error request if you access an invalid 
memory address. When you have an Address Error caused by a dangling 
handle, it might happen that you access an invalid memory adress. The
MMU then generates a Bus Error.

And since the priority of a Bus Error is always higher than the one of
an Address Error, you'll get the Bus Error message.

While we're on the topic, here's another reason for the Bus Error
waves: The 68020 allows you to read data on an odd address. The
68000 doesn't: a Mac plus will crash with an Address Error if you
try to access an odd address (by a dangling pointer, or some
chaotic program code). The Mac II will probably crash too, sooner
or later, when the program goes completely nuts and tries to access/
run/write/execute code on an address that doesn't physically exist.
Or when it tries to WRITE on an odd address boundary. (reading
is allowed, writing not. Another mysterious feature of the 68020).

Hope this helps.

-- Gil

+-----------------------------------------------------------------------+
| Mail   :   Gil Widmer, ETH Macintosh Support Center                   |
|            Swiss Federal Institute of Technology, CH-8092 Zuerich     |
| Bitnet :   macman@czheth5a      UUCP   :   {cernvax,mcvax}ethz!macman |
| Ean    :   macman@ifi.ethz.ch   Voice  :   +3dB at least              |
+-----------------------------------------------------------------------+