Skip to main content

Posts

Showing posts from March, 2014

Using Netlink to post events from kernelspace to userspace

I have been working on an older version of Linux on which I wanted to use netlink as a way to post events from kernelspace to userspace. I wanted to avoid using  Netlink Protocol Library Suite (libnl)  so that I could delve deeper into netlink and have better control of what I am doing. I was already successful in using  Generic Netlink Sockets  to perform two way request-response communication between kernelspace and userspace. This time I referred ACPI daemon 1.0.10's source and used genlmsg_multicast() to post events from the kernel side. The implementation of netlink has evolved over time and the following code ought to work only on kernels versioned around 2.6.35 (I tested my code on Ubuntu 10.10) Source Code Organization: kern/genl_event.c: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57

Cross compiling programs (userspace) for embedded Linux ARM boards like OLinuXino

This post describes how to use a Ubuntu Desktop/Laptop to compile C programs that can run on embedded ARM boards like iMX233-OLinuXino-MAXI On your Ubuntu x86 laptop (I used Ubuntu 12.04 x86), visit http://www.mentor.com/embedded-software/codesourcery and click on "Download Lite Edition". Sourcery CodeBench Lite Edition is a free, unsupported version of Sourcery CodeBench, available for select processors. On the next page, click on "Download the GNU/Linux Release" under the section titled "ARM Processors"  You will need to enter you contact details on the next page before you can download. The download link will be emailed to you. Click on the link in your mail. It will be something like: Download your Lite edition copy of Sourcery CodeBench now:  http://go.mentor.com/3kcqy On the page that opens up, there will be a link to the recommended latest version of the compiler as well as links to the older releases. Click on the link to the recommended