All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] Migrating device drivers from RTLinux to Xenomai/Analogy
@ 2016-11-25 22:03 andrija
  2016-11-28 13:46 ` Jorge Ramirez
  0 siblings, 1 reply; 6+ messages in thread
From: andrija @ 2016-11-25 22:03 UTC (permalink / raw)
  To: xenomai

Hi,

I am wondering if any Xenomai users or admins/contributors can give me 
an idea of the scale of a project I am thinking of undertaking.

My university has PCs running RTLinux (on RedHat if I remember 
correctly) with custom-made data acquisition (DAQ) boards which are used 
to control some equipment and record back data in laboratory experiments 
for electrical engineering students. Now, those PCs are very old and 
failing regularly, and as I understand RTLinux has been effectively 
discontinued, so they want to replace them with something else.

They have found Xenomai as an attractive option, and I have been asked 
to write drivers for the DAQ boards (the boards connect as PCI cards).

As I understand, I would have to use Analogy to implement the drivers 
for real-time operation, however what is missing obviously is the actual 
device driver Analogy will talk to. Analogy as I can see comes with a 
bunch of drivers for commercial DAQ boards (from NI and so on), but I 
need to have my own since it is a custom board.

I have code for the DAQ board drivers (written in C) from RTLinux. Now I 
am familiar with driver basics but am no expert. The code seems 
straightforward enough.

How much of an effort would it be to port said drivers to 
Xenomai/Analogy, approximately? Is this relatively straightforward, or 
does it require writing from scratch?

Thanks a lot for any guidance on this issue.

Cheers,
Andrija Stupar
University of Toronto


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Xenomai] Migrating device drivers from RTLinux to Xenomai/Analogy
  2016-11-25 22:03 [Xenomai] Migrating device drivers from RTLinux to Xenomai/Analogy andrija
@ 2016-11-28 13:46 ` Jorge Ramirez
  2016-11-28 19:34   ` andrija
  0 siblings, 1 reply; 6+ messages in thread
From: Jorge Ramirez @ 2016-11-28 13:46 UTC (permalink / raw)
  To: andrija, xenomai

On 11/25/2016 11:03 PM, andrija@stupar.com wrote:
> How much of an effort would it be to port said drivers to 
> Xenomai/Analogy, approximately? Is this relatively straightforward, or 
> does it require writing from scratch? 

Hi Andrija

It really depends on the quality of the linux driver that you are trying 
to port and the RTLinux services that you depend on. Can your driver run 
on a vanilla kernel?
Maybe you could post your driver to github and we can then try to give 
you a ballpark estimate.

jorge


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Xenomai] Migrating device drivers from RTLinux to Xenomai/Analogy
  2016-11-28 13:46 ` Jorge Ramirez
@ 2016-11-28 19:34   ` andrija
  2016-11-29  2:04     ` Paul
  0 siblings, 1 reply; 6+ messages in thread
From: andrija @ 2016-11-28 19:34 UTC (permalink / raw)
  To: Jorge Ramirez; +Cc: xenomai

Hi Jorge,

Thanks for your reply. I have posted the driver on github:
https://github.com/AndrijaPFC/RTDAQDriver/blob/master/acromag.c

That's the only .c file. Here is the full repo., with all the header 
files:
https://github.com/AndrijaPFC/RTDAQDriver

I don't know if I can run it on a vanilla kernel, I haven't tried. I am 
looking at the system header files, and they don't seem to point to 
anything unusual in the .c file itself, except possibly for rtl_debug.h 
(which from searching for it online, I cannot determine whether it is 
something which comes with a vanilla kernel or not).

Another clue may be in the header file
https://github.com/AndrijaPFC/RTDAQDriver/blob/master/rtce_module.h

which itself invokes system header files rtl.h, rtl_sched.h and 
rtl_time.h which seem to like RT-Linux specific things...or no?

Thanks a lot again,

Andrija Stupar

On 2016-11-28 08:46, Jorge Ramirez wrote:
> On 11/25/2016 11:03 PM, andrija@stupar.com wrote:
>> How much of an effort would it be to port said drivers to 
>> Xenomai/Analogy, approximately? Is this relatively straightforward, or 
>> does it require writing from scratch?
> 
> Hi Andrija
> 
> It really depends on the quality of the linux driver that you are
> trying to port and the RTLinux services that you depend on. Can your
> driver run on a vanilla kernel?
> Maybe you could post your driver to github and we can then try to give
> you a ballpark estimate.
> 
> jorge
> 
> _______________________________________________
> Xenomai mailing list
> Xenomai@xenomai.org
> https://xenomai.org/mailman/listinfo/xenomai


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Xenomai] Migrating device drivers from RTLinux to Xenomai/Analogy
  2016-11-28 19:34   ` andrija
@ 2016-11-29  2:04     ` Paul
  2016-12-01 13:22       ` Jorge Ramirez
  0 siblings, 1 reply; 6+ messages in thread
From: Paul @ 2016-11-29  2:04 UTC (permalink / raw)
  To: andrija; +Cc: xenomai

On Mon, 28 Nov 2016 14:34:03 -0500
andrija@stupar.com wrote:

> Thanks for your reply. I have posted the driver on github:
> https://github.com/AndrijaPFC/RTDAQDriver/blob/master/acromag.c

Had a quick scan of the code, and have a couple of observations.

The Linux kernel has seen quite a few changes since the 2.4 days. The
makefiles for starters. There are also builtin functions for
downloading fpga binary blobs from disk so you no longer have to hard
code them in to the module - I'm assuming the missing fpga_prog.h
contains the binary blob.

The PCI interface has changed and there are also routines to handle
Industry Pack modules - It may be worth your while contacting Acromag
and asking them what support they can offer. You may even find drivers
exist in the latest kernel for your IP modules - These could be used as
a reference or modified to suit you application.


Regards, Paul.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Xenomai] Migrating device drivers from RTLinux to Xenomai/Analogy
  2016-11-29  2:04     ` Paul
@ 2016-12-01 13:22       ` Jorge Ramirez
  2016-12-01 19:47         ` andrija
  0 siblings, 1 reply; 6+ messages in thread
From: Jorge Ramirez @ 2016-12-01 13:22 UTC (permalink / raw)
  To: Paul, andrija; +Cc: xenomai

On 11/28/2016 09:04 PM, Paul wrote:
> On Mon, 28 Nov 2016 14:34:03 -0500
> andrija@stupar.com wrote:
>
>> Thanks for your reply. I have posted the driver on github:
>> https://github.com/AndrijaPFC/RTDAQDriver/blob/master/acromag.c
> Had a quick scan of the code, and have a couple of observations.
>
> The Linux kernel has seen quite a few changes since the 2.4 days. The
> makefiles for starters. There are also builtin functions for
> downloading fpga binary blobs from disk so you no longer have to hard
> code them in to the module - I'm assuming the missing fpga_prog.h
> contains the binary blob.
>
> The PCI interface has changed and there are also routines to handle
> Industry Pack modules - It may be worth your while contacting Acromag
> and asking them what support they can offer. You may even find drivers
> exist in the latest kernel for your IP modules - These could be used as
> a reference or modified to suit you application.


The effort to get this driver under Xenomai seems trivial (a little bit 
longer if you want to bring it under the Analogy stack, maybe a couple 
of weeks).
You should consider throwing away the code and writing it from scratch 
avoiding some of the terrible hacks they have crafted around some 
platform issues (usleep causing segmentation faults?)



>
>
> Regards, Paul.
>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Xenomai] Migrating device drivers from RTLinux to Xenomai/Analogy
  2016-12-01 13:22       ` Jorge Ramirez
@ 2016-12-01 19:47         ` andrija
  0 siblings, 0 replies; 6+ messages in thread
From: andrija @ 2016-12-01 19:47 UTC (permalink / raw)
  To: Jorge Ramirez; +Cc: xenomai

Hi Paul and Jorge,

Thanks for your input, it's much appreciated.

Regards,

Andrija


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-12-01 19:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-25 22:03 [Xenomai] Migrating device drivers from RTLinux to Xenomai/Analogy andrija
2016-11-28 13:46 ` Jorge Ramirez
2016-11-28 19:34   ` andrija
2016-11-29  2:04     ` Paul
2016-12-01 13:22       ` Jorge Ramirez
2016-12-01 19:47         ` andrija

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.