[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CompactMem from a CDA
In article <1tb9sf$jrj@altitude.HIP.CAM.ORG> Phillip Vandry,
vandry@CAM.ORG writes:
> Why does _CompactMem do nothing in CDAs. How could it do any harm?
It sounds like you entered the CDA menu while the Event Manager was not
active and the BUSY flag was zero.
Command-Ctrl-Esc generated an interrupt, which the system handled by
looking at the BUSY flag to see if it has to schedule the CDA menu for
later. The flag was zero, so it went into the CDA menu right away
(internally saving a lot of state information and re-enabling interrupts).
The interrupt manager incremented a flag at $E100CB to indicate that the
system is in an interrupted state. CompactMem checks that flag and does
nothing if it's nonzero, because the system is not allowed to move memory
blocks at interrupt time (that is, software is allowed to assume that
unlocked blocks of memory move only during system calls).
If the BUSY flag had been nonzero when you hit Command-Ctrl-Esc, the only
thing that would have happened at interrupt time was a SchAddTask call to
make the CDA menu appear when the BUSY flag gets down to zero (which
happens during a call to DECBUSY).
If the Event Manager had been active when you hit Command-Ctrl-Esc, the
interrupt handler would have called PostEvent to put a Desk Accessory
event into the event queue. The CDA menu would then appear on the next
GetNextEvent or EventAvail call with an event mask allowing Desk
Accessory events to be processed.
In the last two cases, CompactMem -would- work as usual, since the system
is not inside an interrupt.
David A. Lyons, Apple Computer, Inc. | DAL Systems
Apple II System Software Engineer | P.O. Box 875
Internet:dlyons@apple.com | Cupertino, CA 95015-0875
My opinions are my own, not Apple's.