11.07.2015 Views

An Open Ravenscar Real-Time Kernel for GNAT - DIT - Universidad ...

An Open Ravenscar Real-Time Kernel for GNAT - DIT - Universidad ...

An Open Ravenscar Real-Time Kernel for GNAT - DIT - Universidad ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

vantage of the <strong>Ravenscar</strong> profile restrictions to implement only one kind of mutualexclusion locks.Condition variables are also simplified with respect POSIX, in that there are notimed waits and there are no suspended task queues, as the maximum number of tasksthat can be waiting on a condition is one. The fact that the <strong>Ravenscar</strong> profile doesnot allow select statements, timed wait operations, or ATCs, has also resulted in greatsimplification.Locks implement the Immediate Priority Ceiling Protocol (IPCP), which is thesame as the Ceiling Locking policy defined by the ALRM [2] (D3).3.3 <strong>Time</strong> managementThe package <strong>Kernel</strong>.<strong>Time</strong> provides timing support in a very simplified way. A time typeis defined that represents both absolute time and time intervals as an integer number ofnanoseconds. There is a monotonic clock that gives an absolute time value, measuredfrom system startup.According to the <strong>Ravenscar</strong> profile specification, only an absolute delay (delay until)operation is provided. Delayed threads are kept in a delay queue which is ordered bywakeup time. Since a delay cannot be canceled, as there are no abort statements orATCs, there is no need to keep delayed threads waiting on a condition variable, ascurrent GNARL implementations do.3.4 Storage managementAlthough the <strong>Ravenscar</strong> profile does not <strong>for</strong>bid all kinds of dynamic storage management,as the profile does not deal with non tasking features of Ada, it seems reasonableto expect <strong>Ravenscar</strong> compliant programs not to use dynamic storage pools. Consequently,only a limited <strong>for</strong>m of memory management is provided, in order to allocateTCB and stack space <strong>for</strong> new threads. Since threads can only be created at systemstartup, and cannot terminate, this restricted <strong>for</strong>m of storage allocation can be made ina safe way, using a simple linear algorithm.The task stacks are protected in order to avoid stack overflow or underflow. Thehardware segment protection mechanism is used <strong>for</strong> this purpose.3.5 Interrupt handling<strong>An</strong> interrupt represents a class of events that are detected by the hardware or the kernelitself. When an interrupt occurs an Interrupt Service Routine (ISR) is invoked to makethe interrupt available to the kernel. In Ada 95, a high-level handler can be attached tothe interrupt so that is is automatically started by the runtime system when the interruptoccurs. The handler may be a parameterless protected procedure or a task entry,although the latter is only included <strong>for</strong> compatibility with Ada 83.Current GNARL implementations use interrupt service tasks that are activated whenan interrupt occurs, and then call the associated interrupt handler procedure. In this way,priorities and mutual exclusion are handled in the standard way <strong>for</strong> tasks and protected

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!