NRAO Home  >  Green Bank  |  Wiki Topic:    GB > Software > TWikiUsers > JoeBrandt > DcrRTAIMagmaNotes
   Changes | Index | Contents | Search | Statistics | Go

DCR on RHE4 Configuration Notes

Porting the Digital Continuum backend to Redhat Enterprise 4 requires a system running a 2.6 kernel with RTAI. From reading the RTAI exploder lists, the Magma (development) branch has support for the more recent (2.6.14.3) kernels. I started with the 2.6.10 release and the 'stable' 3.2 Volcano branch, but this was a non-starter for a variety of reasons.

Getting the Software

Driver 2.4 to 2.6 Porting Notes:

Lots of things have changed between 2.4 and 2.6. A good reference is the LWN Porting Guide. Some of the things directly impacting our drivers are:

Interactions with do_gettimeofday()

This system makes calls to get the system time from inside the kernel RTAI module. This presents some possibility for deadlock, unless some special care is used. A good synopsis of the problem was posted on the RTAI mailing list (https://mail.rtai.org/pipermail/rtai/2004-February/006574.html). The problem boils down to a senario where the call from an RTAI context may find the xtime_lock busy, and since Linux isn't active at that point ... deadlock.

The perscription is to always check for the locked condition prior to calling do_gettimeofday(). If we find it locked, use the tsc timer to estimate and fake a time. This is all nicely packaged in a RTAI safe function 'rt_do_gettimeofday()'.

In 2.4 kernels, the lock type was a rwlock_t, in 2.6 this has changed to a seqlock_t, which is faster. The write lock increments a sequence number, as does the write_unlock. In order to detect a write-lock condition, we look for an odd (as in 1,3,5,7) return value. Works fine.

Misc. To Do Items:

OS Build and Configuration

Quick-start

It all seems so simple in hindsight...

Start by downloading the latest release of RTAI:

Unpack the source look in .../base/arch/i386/patches to see what kernel versions are supported, then go get that source version from kernel.org.

Unpack and patch the source like so:

Configure the kernel ... build, install, Reboot, test normal operation ...

Configure RTAI ... build, install, run the kernel and user-space testsuites

-- JoeBrandt - 02 Dec 2005

Attachment: sort Action: Size: Date: Who: Comment:
config-2.6.14.3-RTAI-Magma action 51502 02 Dec 2005 - 21:11 JoeBrandt Initial working version for 'tank'.

Topic DcrRTAIMagmaNotes . { Edit | Attach | Ref-By | Printable | Diffs | r1.5 | > | r1.4 | > | r1.3 | More }
Revision r1.5 - 15 Dec 2005 - 23:12 GMT - JoeBrandt
Parents: TWikiUsers > JoeBrandt
Content copyright © 1999-2007 by the contributing authors.
All material on this collaboration platform is the property of the contributing authors.