From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

CRIO-9036 and how to write drivers for ni linux real-time

Hello Guys,

I would love to have a bit of guidance around the existing materials for the driver hacking(building) on the ni linux real-time platform.

  • Do any of you know a good starting point to figure out the proper way of writing drivers for NI linux real-time?
  • Do we have any books or reference manuals for this?
  • Anybody sharing his experiences on the topic would be absolutely appreciated.

In addition: I am comfortably with the linux platform and c/c++, make, kernel compilation, etc.

Cheers,

Vil

0 Kudos
Message 1 of 8
(5,148 Views)

vil,

There are some great materials out there on getting started with kernel development, I would recommend starting with a simple module (something as basic as printing to the kernel log on insertion/removal) and expand by researching the areas that you will need to know for the type of kernel module you want to write. A good cross-reference (either online or generated using something like cscope or ctags or the indexer in Eclipse w/ CDT (note: some of the filenames of the kernel source can prove problematic for Windows, kernel development on Windows is not recommended).

A reasonable book is a good curated walk through the majority of the kernel systems, but the problem that these books invariably run into is that the kernel is an evolving, changing system. Even if some of the aspects are a little outdated, the book will tend to have a more careful and complete discussion of the systems within the kernel.

Message 2 of 8
(3,987 Views)

One "slightly outdated but mostly still valid" book is: https://lwn.net/Kernel/LDD3/

Message 3 of 8
(3,987 Views)

BradM, Gration: Thanks guys for the ideas, I do have come across these myself after a bit of researching today. What I am really looking forward to find is some crio (ni linux rt) specific thoughts or examples, pitfalls, or best practices. However I know that NI rt is just a custom flavour of linux basically running the same kernel, in a pretty alright and typical environment, so I might have to just jump in as you guys mentioned with the ideas provided so far.

0 Kudos
Message 4 of 8
(3,987 Views)

The biggest "gotchas" are cross-compiliing (if you are taking this approach) and the kernel format on Zynq targets (an Flattened Image Tree with Device Tree Blobs).

0 Kudos
Message 5 of 8
(3,987 Views)

vil,

If you intend on attending NIWeek this year, we have a planned session that covers this particular area. Keep an eye out and/or contact Deborah_B

Message 6 of 8
(3,987 Views)

Details on this NIWeek session are now posted in this discussion, we hope you can make it!

Deborah Burke
NI Hardware and Drivers Product Manager
Certified LabVIEW Architect
0 Kudos
Message 7 of 8
(3,987 Views)

Thank you Deborah!

0 Kudos
Message 8 of 8
(3,987 Views)