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 / 2936
2935  |  2937
Subject: 
Re: Interruptions in BrickOS
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Mon, 4 Nov 2002 15:55:20 GMT
Viewed: 
2665 times
  
Good questions!  See responses below...

"Martin De Wulf" <madewulf@ulb.ac.be> wrote in message
news:H51ItF.Ax1@lugnet.com...
<snip>
We chose Legos for our tests.

You may want to check out the latest (now called BrickOS) at
http://brickos.sourceforge.net.

For us, real-time properties of the platform is really important :
so, I have 3 questions :
- it seems that the only possible interruption is the one from the 1ms • timer.
Is it right?

Actually, the H8 microprocessor has a few interrupts available:
2 x 8bit counters that can trigger interrupts
            (used for sound generation and serial communications)
1 x 16bit counter
            (used for 1ms scheduler is legOS, modified to trigger two
interrupts in brickOS)
1 x 8bit watch-dog timer
            (used in brickOS to trigger a NMI that increments the system
time)
            (could be used to reset the machine if it locks up)
1 x A/D interrupt
            (used to signal the end of an analog to digital conversion,
which brickOS uses to record the result and trigger a new A/D conversion ...
on the next sensor)

- In the scheduler code, there is a remark saying it can't be interrupted.
Why? Is it because you assume it will always has finished his job in less
than 1ms, thus before the next interruption? Or is it because the
interruptions are suspended by some mean I did not see?

The scheduler is non-reentrant, therefore a semaphore was used in legOS to
keep the internal structures from being corrupted.  In the current brickOS a
simple critical section mechanism is used to protect both the memory manager
and the scheduler.  Essentially, you can view the task-manager and
memory-manager to be at ring zero, thus the OS protects itself by not
allowing tasks to be swapped while running code at this level.

- Last question : when the scheduler is called, if its task structure is
blocked by another task, it'll let this task finish. So, if that task is
active for a whole new timeslice, he'll take control again only afther • this
whole timeslice. So it's possible the scheduler is not really used for two
(or more) timeslices in place of one. Is it right?

In brickOS, the scheduler maintains the state of the current time-slice even
though a task is blocking.  So, if the task would have been swapped while it
was blocking, it is swapped as soon as the task releases the lock.  Note
this only applies to a task blocking by running code at ring zero.  If the
task has a semaphore or critical section lock (at ring one) the task will
still be swapped; ring one can not block ring zero.

As for legOS, your description seems to be right-on.


Thank you.

I am very interested to know how legOS/brickOS works for you; and how your
project is progressing.  If/When possible let us know how it is going.  And
of course, ask any questions you have.

// Joe



Message is in Reply To:
  Interruptions in BrickOS
 
Hi, I'am a researcher of the Free University Of Brussels. We're currently working on embedded systems. We would like to generate code for embedded systems from a specification language which could be used for formal verification. We chose Legos for (...) (22 years ago, 4-Nov-02, to lugnet.robotics.rcx.legos)

2 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