Marcus Folkesson

Embedded Linux Artist

2.2" TFT display on Beaglebone

2.2" TFT display on Beaglebone I recently bought a 2.2" TFT display on Ebay (come on, 7 bucks...) and was up to use it with my BeagleBone. Luckily for me there was no Linux driver for the ILI9341 controller so it's just to roll up my sleeves and get to work. Boot up the BeagleBone I haven't booted up my bone for a while and support for the board seems cover

Magic SysRq

Magic SysRq Every kernel-hacker should knows about the magic SysRQ. Period. To enable the magic, make sure CONFIG_MAGIC_SYSRQ is set in your Kernel hacking tab. I use this feature a lot, mostly for set loglevel and reboot the system. But it is also very useful to get information out of the system even if it is completely frozen. As everybody is using GNU Screen (what else?) as their TTY terminal, the keyboard combination is: ctrl+A B.

Take control of your Buffalo Linkstation NAS

Take control of your Buffalo Linkstation NAS I finally bought a NAS for all of my super-important stuff. It became a Buffalo Linkstation LS200, most because of the price ($300 for 4TB). It supports all of the standard protocols such as FTP, SAMBA, ATP and so on. However, it would be really useful to use some sane protocols like sftp so you could use rsync for your backup scripts.

High resolution timers

High resolution timers Nearly all systems has some kind of Programmable Interrupt Timer (PIT) or High Precision Event Timer (HPET) that is programmed to periodically interrupt the operating system (if not configured with CONFIG_NO_HZ). The kernel performs several tasks in these ticks such as timekeeping, calculate statistics for the currently running process, schedule a new process and so on. The interrupt occurs at regular intervals - exactly HZ times per second.

NAT with Linux

NAT with Linux To share an internet connection may sometimes be very practical when working with embedded devices. The network may have restrictions/authentications that stops you from plug in your device into the network of the big company you are working for. But what about creating your own network and use your computer as NAT (Network Address Translation)? It's not that hard to setup, it's actually just a few command lines away.

-ENOENT, but believe me, it's there

-ENOENT, but believe me, it's there Almost every ELF-file in a Linux environment is dynamically linked, and the operating system has to locate all dynamic libraries in order to execute the file. To its help, it has the runtime dynamic linker, whose only job is to interpret the ELF file format, load the shared objects with unresolved references, and, at last, execute and pass over the control to the ELF file.

Modules with parameters

Modules with parameters Everybody knows that modules can take parameters, either via /sys/modules/<module>/parameters, sysctl or via cmdline to the kernel, but how are these parameters created? Parameters without callbacks The Linux kernel provides the module_param() macro. The syntax is: 1module_param(name, type, perm) Which will simply create the module parameter and expose it as an entry in /sys/modules/<module>/parameters. Code example 1int debug_flag; 2module_param(debug_flag, bool, S_IRUSR | S_IWUSR | S_IRGRP) 3MODULE_PARM_DESC(debug_flag, "Set to 1 if debug should be enabled, 0 otherwise"); MODULE_PARM_DESC() is a short description of the parameter.

Terminate a hanging SSH session

Terminate a hanging SSH session It may be very frustrating when SSH sessions just hangs because the target is power cycling or something. Lucky for you there is a "secret" escape sequence that allows you to terminate the session (and a few other things). The escape sequence is <enter>~X where X is a command letter. To see all available key sequences, type <enter>~?. Example output: 1 marcus@Ilos:~$ ~? 2 Supported escape sequences: 3 ~.

Interrupts, and how to divide them between cores

Interrupts, and how to divide them between cores Symetric MultiProcessing (SMP) are becoming increasingly common in embedded systems. Many chip manufacturers such as Texas Instruments and Freescale offers ARM multicores, even FPGA manufacturers like Xilinx and Altera has System-on-Chip with multiple ARM cores. One benefit with SoC is that it's even possible to add soft cores in the programmable logic if it's necessary. The trend is clear, multiple cores is here and it's not likely to be fewer of them.

Linux memory overcommit

Linux memory overcommit Linux is generous in terms of memory, it will almost never fail on requests from malloc(3) with friends. What does this mean in practice and how may it be a potential issue? In short, overcommit memory means that the system will give the application so much memory it's asking for, even if the physical memory is not available. How does this work? Well, the requested memory comes with one small restriction; the application is given as much memory it demands if it not going to use it.