Signals and changing stacks

James Pinakis jamesp at wacsvax.OZ
Sat Mar 18 19:11:41 AEST 1989


I'm trying to write a time-shared scheduler on a Vax 11/750
using the 4.3bsd interval timer to signal context switches.
I have a number of small processes (not Unix processes),
each with their own stack.  The general idea is to trap
the SIGVTALRM signal and then switch processes (and stacks).
The problem is that after the SIGVTALRM signal is received
once and a new process is resumed, the SIGVTALRM signal remains
blocked, since (I think) the stuff to unblock the signal
is still on the previous stack.  

A solution I thought of involves using a signal stack and
changing the saved values of the fp, sp, ap and pc to
jump into the new process and change stacks.  That way
I can (hopefully) let the kernal restore the signal.
The problem is that I don't know the order in which these
things are pushed onto the stack.  I'm pretty certain that
the pc goes first, followed by the ap, but the order of the
next two is a mystery since all my test programs have had
fp=sp before receipt of the signal.  Does anyone know the
order for certain?

Also, are these initially saved values the only things that
need to be changed?  In looking at the signal stack I noticed that
the ap and fp seem to be stored again a bit later on.
Will these occurences also need to be changed?  Will
the idea even work?

Any info on what this stuff on the signal stack actually
means would be most appreciated.

-------------
James Pinakis

Department of Computer Science,   ACSnet:   jamesp at wacsvax.oz
University of Western Australia,  ARPA:     jamesp%wacsvax.oz at uunet.uu.net
Mounts Bay Road,                  UUCP:     ..!uunet!munnari!wacsvax!jamesp
Crawley, Western Australia, 6009. 
PHONE:  (09) 380 2305             OVERSEAS: +61 9 380 2305



More information about the Comp.unix.wizards mailing list