The Linux power management mechanism distinguishes between three sleep states: Standby, Suspend-to-RAM (STR) and hibernation. They have increasing energy saving and wake up latency, although in practise STR saves more energy and has very similar wake up latency as the Standby mode. STR needs to be supported by the platform hardware. Main memory needs to be refreshed to preserve [...]
1) Kernel command line arguments Add 'init=/bin/bash no_console_suspend' to boot to a basic shell and keep the console output while the suspend is happening. 2) Mount proc and sys: mount -t proc /proc proc mount -t sysfs /sys sys 3) Prepare the wake up source: Any wake up source is valid, like a GPIO: echo [...]
Overview ftrace is a tracing facility built into the Linux kernel. It originated in the real time enhancements efforts and is now merged into mainstream. However not all features are supported by all architectures. This overview is based around the x86 architecture as the rest will slowly catchup feature wise. General settings Mount the debugfs [...]
Every driver has an entry point function, minimaly defined as: static __init mydriver_init( void ) { return platform_driver_register(&my_driver); } module_init(mydriver_init); The __init macro is used to describe the function as only being required during initialisation time, so that the kernel can remove this function and release its memory after initialization. To recover memory used by [...]
Linux includes a set of defines in include/linux/autoconf.h after configuration which is included with every file. Eclipse misses this and grays out code which is actually being built. Configure the kernel (for example with make xconfig) to create include/linux/autoconf.h Start eclipse with -vmargs -Xmx512M or more to avoid memory issues. Create a new Makefile C project. In [...]
Applications You will need a gdb client running on the host and a gdb server running on the target from your cross compilation toolkit. On the target: arch-gdbserver local_ip:local_port my_app my_args gdbserver can also attach to a running process with the –attach parameter. On the host: arch-gdb –symbols=my_apptarget extended-remote target_ip:remote_portCtrl-Cbt Graphical GDB DDD and Insight [...]
After being on holidays I am slowly catching up with things. A big one has been the null pointer exploit on the Linux kernel that has been there for almost 8 years. All Linux 2.4/2.6 versions since May 2001 are believed to be affected: Linux 2.4, from 2.4.4 up to and including 2.4.37.4 Linux [...]
Working on a 2.6.24.7 Linux kernel with the rt25 real time patch, there is a kernel memory leak that can be triggered by the following snippet: #include #include #include #include #include int setProcessAffinity( unsigned int bktID ) { unsigned long mask = 0; unsigned int len = sizeof(mask); unsigned int core_nr = (bktID/8); mask [...]