To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 265
264  |  266
Subject: 
Re: signals / legOS internals
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Wed, 23 Jun 1999 14:56:29 GMT
Viewed: 
1088 times
  
On Wed, 23 Jun 1999, Lou Sortman wrote:

I've been banging my head against this a bit and thought I'd see if any
of you can shove me in the right direction.  I am trying to implement
signals in legOS.  The problem is that a signal can happen at any time.
I know how to make that happen, but what is causing me trouble is that I
need to be able to put stuff on the stack.

I was rolling along, planning this out, then it occurred to me that
local (to the function) variables are on the stack above the stack
pointer.  That means that pushing anything on the stack asynchronously
is going to toast those variables.  It  makes me wonder why that doesn't
happen whenever OC1A happens.

Actually, gcc moves the stack pointer before using any variables, so it
is always safe to use stack below the current stack pointer.  If you are
using a different C compiler or doing assembly tricks, then you are on
your own.

Currently, my thinking is to allocate a second stack for each process,
just for signal handling.  To keep the waste down, I'd allocate it only
if a signal is sent to a given task.  If there is a better way to cope
with this, I'm all ears.

Traditional Unices use a structure in the u-block for the process to store
pending signals.  After a process is woken up inside the kernel, it checks
for a pending signal to be delivered.  The signal handler runs in the same
context with the same stack.

John A. Tamplin Traveller Information Services
jat@LiveOnTheNet.COM 2104 West Ferry Way
256/705-7007 - FAX 256/705-7100 Huntsville, AL 35801



Message is in Reply To:
  signals / legOS internals
 
Peek-a-boo! I've been banging my head against this a bit and thought I'd see if any of you can shove me in the right direction. I am trying to implement signals in legOS. The problem is that a signal can happen at any time. I know how to make that (...) (25 years ago, 23-Jun-99, to lugnet.robotics.rcx.legos)

32 Messages in This Thread:









Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR