How do I extract the kernel configuration from a kernel image file? The kernel image file type is: The kernel has been compiled with CONFIG_IKCONFIG enabled. However, returns Note: I am trying the get the config without booting the kernel. Answer If the kernel has been compiled with CONFIG_IKCONFIG=m (note th…
Tag: linux-kernel
How to add a member to task_struct to bypass “compiletime_assert”
I need to add members to task_struct in Linux kernel 4.8.0. However, when I did it and tried to build the kernel, the error message shows: How to get rid of such errors and build my kernel successfully? Answer The assertion you’re encountering is triggered by a macro (CHECK_MEMBER_AT_END_OF) that checks…
Linux console output on multiple UARTs
My embedded board has 2 UARTs. I want to have console output on both the UARTs. In kernel/Documentation/console/console.txt it’s mentioned that: you can only define one console per device type (serial, video). Does this mean I can use only one UART as console? Or, is it possible to redirect the console …
Linux layer on macOS [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack …
PC bootstrap process step by step
The bootstrapping process is a bit confusing, I hope I understand it correctly. I will try to describe my understandings and hopefully can be corrected. As this is an extremely important and I want to dive into the small details. BIOS: It sets up an interrupt descriptor table and initializes various devices. …
With hypervisor, How to surveillance the time when target process is created or terminated
I would like to make my hypervisor on linux for detecting and surveillance target process like a malware. To achieve this, the hypervisor need to detect processes that is created or terminated or task switched. On intel CPU, I knew that cr3 register indicate those roles. for example, when cr3 register value i…
How to avoid double creating directories in /proc?
I’m writing a Linux kernel module, and I’d like to create a subdirectory, /proc/foo/, and then expose several artificial files inside it that will be generated on the fly by my module. I know I can use proc_mkdir to create the foo directory, but if it already exists dmesg will display a warning, a…
Example device-tree-aware i2c gpio driver for Linux?
Is there a good example device-tree-aware i2c gpio driver for Linux? I’ve been looking at gpio-pcf857x but it has a header file containing struct pcf857x_platform_data which is used in board files. I am looking for a similar example, but where the i2c id is defined-in/retrieved-from the device tree. Ans…
How does Docker run a Linux kernel under macOS host?
I installed Docker on my macOS Sierra as follows. Note I don’t have VirtualBox installed. My macOS details. Once I run Docker from launchpad, I am able to run Docker containers. My question is how does Docker manage to run a Linux kernel within macOS? I thought Docker would at least require boot2docker …
Kernel API to get Physical RAM Offset
I’m writing a device driver (for Linux kernel 2.6.x) that interacts directly with physical RAM using physical addresses. For my device’s memory layout (according to the output of cat /proc/iomem), System RAM begins at physical address 0x80000000; however, this code may run on other devices with di…