Marcus Folkesson

Embedded Linux Artist

get_maintainers and git send-email

get_maintainers and git send-email Many with me prefer email as communication channel, especially for patches. Github, Gerrit and all other "nice" and "user friendly" tools that tries to "help" you to manage your submissions does not simply fit my workflow. As you may already know, all patches to the Linux kernel is by email. scripts/get_maintainer.pl (see [1] for more info about the process) is a handy tool that takes a patch as input and gives back a bunch of emails addresses.

OOM-killer

OOM-killer When the system is running out of memory, the Out-Of-Memory (OOM) killer picks a process to kill based on the current memory footprint. In case of OOM, we will calculate a badness score between 0 (never kill) and 1000 for each process in the system. The process with the highest score will be killed. A score of 0 is reserved for unkillable tasks such as the global init process (see [1]) or kernel threads (processes with PF_KTHREAD flag set). cover

Embedded Linux course in Linköping

Embedded Linux course in Linköping I tech in our Embedded Linux course on a regular basis, this time in Linköping. It's a fun course with interesting labs where you will write your own linux device driver for a custom board. The course itself is quite moderate, but with talented participants, we easily slip over to more interesting things like memory management, the MTD subsystem, how ftrace works internally and how to use it, different contexts, introduce perf and much more. cover

printk()

printk() So, a week in Prague has come to its end. The Embedded Linux Conference Europe was this year co-located with Open Source Summit and offered a lot of interesting talks on various topics. One of the hottest topics this year was about our most beloved debugging function - prink(). What is so hard with printing? It turns out that printk is quite deadlock-prone and that is not an easy thing to work around in the current infrastructure of the kernel.

libostree and $OSTREE_REPO environment path

libostree and $OSTREE_REPO environment path libostree is a great tool to handle incremental or full updates for an Linux file system. But virtually all commands of ostree requires the --repo argument to override the default system repository path. This is really annoying after a while so my first attempt to get rid of this was to create an alias : 1alias ost='ostree --repo=/tmp/repo' It works but is not good. To solve it once and for all I was about to implement support for getting the repo path from an environment variable.

FIT vs legacy image format

FIT vs legacy image format U-Boot supports several image formats when booting a kernel. However, a Linux system usually need multiple files for booting. Such files may be the kernel itself, an initrd and a device tree blob. A typical embedded Linux system have all these files in at least two-three different configurations. It's not uncommon to have a Default configuration Rescue configuration Development configuration Production configuration ... Only these four configurations may end up with unmanageable amount of different files.

config utility for Buildroot

config utility for Buildroot I'm using the ./scripts/config script in the Linux kernel tree a lot. The script is used to manipulate a .config file from the command line which is quite nice to be able to do. I use it mostly to enable configurations from a script or as a part of automated tests. Buildroot is also using KBuild as its configuration system so I adapted this script and submitted a patch.

Memory management in the kernel

Memory management in the kernel Memory management is among the most complex parts in the Linux kernel. There is so many critical parts such as page allocator, slab allocator, virtual memory handling, memory mapping, MMU, IOMMU and so on. All these parts has to work perfect (or at least allmost perfect :-) ) because all system do use them either they want to or not. If there is a bug or performance issue you will be noticed quite soon.

MMAP memory between kernel and userspace

MMAP memory between kernel and userspace Allocate memory in kernel space and then let the userspace map it to their virtual address space sounds like an easy task, and sure it's. There are just a few things that is good to know about page mapping. The MMU (Memory Management Unit) contains page tables with entries for mapping between virtual and physical addresses. These pages is the smallest units that the MMU deals with.

PID1 in containers

PID1 in containers What is PID 1 The top-most process in a UNIX system has PID (Process ID) 1 and is usually the init process. The Init process is the first userspace application started on a system and is started by the kernel at boottime. The kernel is looking in a few predefined paths (and the init kernel parameter). If no such application is found, the system will panic().