Showing posts with label Embedded linux. Show all posts
Showing posts with label Embedded linux. Show all posts

Saturday, 31 March 2018

Unit Testing Simple Linux Kernel Module

This morning, I am trying to learn Linux Kernel development from https://blog.sourcerer.io/writing-a-simple-linux-kernel-module-d9dc3762c234  Link  .

The examples are very good. However, I am looking for a way to do unit testing and I can't find any info on how to do this. I am a unit test advocate and I fully support unit testing. Why? Because system testing is expensive and from my experience, time-consuming.

I would like to unit test on Eclipse so that I could use Eclipse CDT and GDB's full power in terms of debugging.

Eclipse Oxygen.3 CDT Release (4.7.3)
With just a few #defines and #ifdefs, I was able to come up with a way to do simple unit tests using asserts. Nothing impressive actually, however the quick feedback of unit tests will be very helpful in getting good code coverage of testing.

I placed the source code demonstration here: Link

For now this will work, however I will be improving this and will be adding a proper unit testing framework.

Saturday, 7 October 2017

Embedded Linux: Buildroot and BeagleBone

Buildroot for BeagleBone Black - Hyperterminal @ 115200bps
I just created a custom embedded linux platform using Buildroot for my Beaglebone Black. Buildroot is very easy to use. I was able to create my Embedded Linux image within 1 hour (including the Buildroot compilation).

I posted the whole procedure on my youtube: https://www.youtube.com/watch?v=QLzGKIx9Mz8

I used LUBuntu because it is more lightweight compared to the main Ubuntu distribution.