Kategorie: programming

Udev Sidenotes

Debugging Automatic Debugging Set udev_log=debug in /etc/udev/udev.conf for a persistent change, run udevadm control –log-priority=debug for a temporary change. If you are running systemd, you can find the output in journalctl –follow | grep udev Manual Printing Add RUN+=“/bin/sh -c ‚echo \“hello world\“ > /dev/kmsg'“ to your rules, when the rule is executed you will…

Cross Toolchain for Raspberry Pi

Short Guide If you are looking for a toolchain for cross-compiling software for the Raspberry Pi, you will most probably end up at the official tools repository. For sure, you are an up-to-date and security-conscious developer and therefore you may be frozen-in-terror when you see that those toolchains are three to seven years old. In…

Linux Driver Loading, Binding and Registration

In Linux we have two different types of how drivers find their way into the system. The first is builtin drivers, those drivers are compiled into the kernel image – they are always there and you cannot get rid of them easily (well, you can blacklist them). The other way is the way modules go.…

Design Patterns in C++: Strategy

The Strategy Pattern allows you to change an algorithm at runtime. Image for example some algorithms to calculate the square root, as you may know there are plenty of it. They all do the same, but they all have their own upsides and downsides – one is more accurate, the other one is less expensive…

Notepad++ und GHDL

VHDL ist eine mächtige Hardwarebeschreibungssprache (HDL), ursprünglich entwickelt für das Department of Defence. Aber früher oder später erkannten natürlich auch wirtschaftliche Unternehmen den Nutzen einer solchen Sprache die es mit unter ermöglicht, Hardware automatisch aus dem beschriebenen Verhalten bzw. den Konstrukten, erzeugen zu lassen. VHDL gehört neben Verilog zu den meistgenutzten und ausgereiftesten HDL. Leider…

Design Patterns in C++: Observer

The Observer Pattern is one of the heavily used ones and well, the name says it : It’s purpose is to observe other classes for any updates. To be a bit more exact: you register the Observer classes at the Subject class and when the Subject changes, then all Observers get notified. So, to be…

Design Patterns in C++: Singleton

The Singleton Design Pattern guarantees that there is always at most one lonesome instance of the class around. The following implementation of a Singleton in CPP is thread-safe as long as you are using C++11 or above! It is based on a stackoverflow Q&A. Singleton_Classname.h Singleton_Classname.cpp

Linux HID driver hooks

The linux HID subsystem offers kernel driver programmers a whole bunch of hooks to insert custom code before, after and while automatic processing. Those hooks are defined in <linux/hid.h>, unfortunately they aren’t documented very well similarly to the whole loading process of driver modules in Linux.