Subject: Re: What is difference between SIGSEGV and SIGBUS
To: None <current-users@NetBSD.ORG>
From: Ty Sarna <firstname.lastname@example.org>
Date: 08/05/1995 03:32:07
In article <199508042319.QAA06952@MindBender.HeadCandy.com>,
Michael L. VanLoon -- HeadCandy.com <michaelv@HeadCandy.com> wrote:
> >or a memory-bus timeout due to accessing a location with no storage
> >behind it.
> There is no such thing. Memory accesses require exactly the same
> amount of time whether there is RAM there or not. If there is nothing
> there, they simply return some random digital representation of the
> electrical signals floating around the bus when the memory access is
> attempted. Thus, this couldn't cause a bus error.
Oh yes there is! On the m68k, for example, the bus is asynchronous. Bus
cycles are not completed until something asserts /DTACK (Data Transfer
ACKnowledge). Usually the memory interface (or io device, or whatever)
implements whatever timing it needs and takes care of asserting /DTACK
at the right time for that chunk of address space. If the memory access
is to address space which doesn't contain anything, nothing is ever
going to assert /DTACK, so a bus watchdog watches for memory accesses
that take longer than any reasonable cycle ever should and forcibly
terminates them with /BERR (Bus ERRor). On a unixoid OS usually results
in the process that initiated the access receiving a SIGBUS.
See the M68000 user's manual for more information.