Language Selection

English French German Italian Portuguese Spanish

Understanding a Kernel OOPS

Filed under
Linux
HowTos

Understanding a kernel panic and doing forensics to catch the bug is considered a hacker‘s job. This is one of those complex tasks that requires a sound knowledge of the architecture you are working on, and the internals of the Linux kernel. Depending the on the type of error detected by the kernel, panics in the Linux kernel are classified as hard panics (Aiee!) and soft panics (Oops!). This article explains a sample Linux kernel oops, and helps to create a simple oops and debug it. It is mainly intended for developers getting into kernel development, who need to debug the panics that the kernel throws at them. Knowledge of the Linux kernel, and C programming, is assumed.

An oops is what the kernel throws at us when it finds something faulty, or an exception, in the kernel code. Oopses are somewhat like the segfaults of user-space. An oops dumps its message on the console; it contains processor status, and CPU registers when the fault occurred. The offending process which triggered this oops gets killed without releasing locks or cleaning up structures. The system may not even resume its normal operations sometimes; this is called an unstable state. Once an oops has occurred, the system cannot be trusted any further.

Let’s try to generate an oops message with sample code, and try to understand the dump.

Setting up the machine to capture an oops

The running kernel should be compiled with CONFIG_DEBUG_INFO, and syslogd should be running. To generate and understand an oops message, let’s throw together a sample kernel module, oops.c:

rest here




More in Tux Machines

ST Releases Free Linux IDE for 32-Bit MCUs

The 32-bit microcontroller world is starting to open up to world Linux. This week, leading ARM Cortex-M vendor STMicroelectronics (ST) released a free Linux desktop version of its development software for its line of STM32 microcontroller units (MCUs). The tools include ST’s STM32CubeMX configurator and initialization tool, as well as its System Workbench for STM32 (SW4STM32), an Eclipse-based IDE created by Ac6 Tools. SW4STM32 is supported with toolchain, forums, blogs, and technical support by the openSTM32.org development community. Read more

Today in Techrights

Lumina Desktop Getting Ready for FreeBSD 11.0

Ken Moore, the lead developer for the BSD-based Lumina Desktop Environment, announced that another step towards the release of a full-fledged desktop environment for BSD variants (and Linux distros, for that matter) has been achieved with the release of version 0.8.8 yesterday. For those of you keeping score at home, the Lumina Desktop Environment — let’s just call it Lumina for short — is a lightweight, XDG-compliant, BSD-licensed desktop environment focusing on getting work done while minimizing system overhead. Specifically designed for PC-BSD and FreeBSD, it has also been ported to many other BSD variants and Linux distros. Lumina is based on the Qt graphical toolkit and the Fluxbox window manager, and uses a small number of X utilities for various tasks. Read more

Linux Foundation Certified System Administrator: Jorge Tudela Gonzalez de Riancho

The Linux Foundation offers many resources for developers, users, and administrators of Linux systems, including its Linux Certification Program, which is designed to give you a way to differentiate yourself in a competitive job market. To illustrate how well the certification prepares you for the real world, the Linux Foundation is featuring some of those who have recently passed the certification examinations. These testimonials should help you decide if either the Linux Foundation Certified System Administrator or the Linux Foundation Certified Engineer certification is right for you. In this installment, we talk with Jorge Tudela Gonzalez de Riancho. Read more