embedded-linux

for_each_process - Does it iterate over the threads and the processes as well?

只谈情不闲聊 提交于 2019-12-21 12:12:02
问题 I would like to iterate all the tasks in the kernel (threads and processes) and print tid/pid and name using for_each_process macro: #define for_each_process(p) \ for (p = &init_task ; (p = next_task(p)) != &init_task ; ) How can I distinguish between thread and process? So I'll print it like that: if (p->real_parent->pid == NULL) printk("PROCESS: name: %s pid: %d \n",p->comm,p->pid); else printk("THREAD: name: %s tid: %d \n",p->comm,p->pid); 回答1: The following macros are what you need: /* *

Spidev do not write/read simultaneously using ioctl

给你一囗甜甜゛ 提交于 2019-12-21 09:39:11
问题 I hope to find some help even if this issue might be more hardware than software related (we'll see). I'm working on a custom board based on Freescales P1021 processor (ppc, e500v2 core). A external PCB will be connected and could be configured by SPI. The specifications of this external PCB reads as it expects a 2-byte command in full duplex mode and that only the last byte is used to transfer data back on MISO. Knowing this i currently work to prepare some pieces of software to test this

What is the minimum amount of RAM required to run Linux kernel on an Embedded device?

人走茶凉 提交于 2019-12-21 04:05:04
问题 What is the minimum amount of RAM required to run Linux kernel on an Embedded device? In Linux-0.11 for 80x86 , the minimum RAM required was 2MB to load the kernel data structures and interrupt vectors. How much is the minimum needed RAM for present Linux-3.18 kernel? Does different architectures like x86 and ARM have different requirements for minimum RAM required for booting? How does one calculates the same? 回答1: It's possible to shrink it down to ~600 KiB. Check the work done by Tom

Getting uname information from a compressed kernel image

人盡茶涼 提交于 2019-12-21 00:16:43
问题 Is there a good way to extract the same information that uname does from a compressed kernel image? I want this to be able to check the dog tags of kernel sitting in dormant mtd's on an Embedded Linux system and compare it to the currently running kernel. 回答1: For Linux image compressed with gzip, use this: dd if=arch/arm/boot/zImage bs=1 skip=$(LC_ALL=C grep -a -b -o $'\x1f\x8b\x08\x00\x00\x00\x00\x00' arch/arm/boot/zImage | head -n 1 | cut -d ':' -f 1) | zcat | grep -a 'Linux version' For

Need cross gdb for device

不羁岁月 提交于 2019-12-20 12:34:11
问题 I installed gcc-arm-linux-gnueabihf cross-compiler on Ubuntu 12.04, and now I am able to build a program for embedded device. Where can I find cross gdb for debugging? gcc-arm-linux-gnueabihf reference contains gdb-arm-linux-gnueabihf in the Related Packages list, which seems to be the debugger that I am looking for. But this package is not available. 回答1: I recommend getting gdb from the Linaro toolchain rather than the Ubuntu repositories. Download gcc-linaro-arm-linux-gnueabihf-4.7-2012.10

mapping memory reserved by mmap kernel boot param into user space

一个人想着一个人 提交于 2019-12-20 10:47:36
问题 As discussed in this question, i am reserving a memory chunk at the boot time using a kernel boot parameter memmap=8G$64G I have written a character driver kernel module which , during initialization does a ioremap of this reserved memory chunk. As explained here , in my driver mmap all i need to do is remap_pfn_range for this memory chunk pointer returned by the ioremap . I am running this on 3.0 linux kernel . My user space application opens this memory chunk as a device mounted by the

Tips for learning embedded linux [closed]

前提是你 提交于 2019-12-20 08:22:46
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I want to learn the basics of embedded linux. To do this I am assuming that I need to go and buy some sort of hardware board and have the linux kernel code. I have no idea where to start with this and any tips/pointers would be most welcome. Ideally I would like people to point out a full system (e.g. this

Tips for learning embedded linux [closed]

百般思念 提交于 2019-12-20 08:22:34
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I want to learn the basics of embedded linux. To do this I am assuming that I need to go and buy some sort of hardware board and have the linux kernel code. I have no idea where to start with this and any tips/pointers would be most welcome. Ideally I would like people to point out a full system (e.g. this

Function caller in linux kernel

浪子不回头ぞ 提交于 2019-12-20 08:11:11
问题 Is there a way to get function caller in linux kernel? I know __ func __ returns the function name which is executing. I am looking for the function which called " __ func __ " 回答1: You can get the caller with __builtin_return_address(0) . The caller's caller is __builtin_return_address(1) and so on. It's a GCC extension, documented in the gcc manual: http://gcc.gnu.org/onlinedocs/gcc/Return-Address.html Edit: I should probably point out, that gets you the address of the caller. If you want

Function caller in linux kernel

时光毁灭记忆、已成空白 提交于 2019-12-20 08:08:43
问题 Is there a way to get function caller in linux kernel? I know __ func __ returns the function name which is executing. I am looking for the function which called " __ func __ " 回答1: You can get the caller with __builtin_return_address(0) . The caller's caller is __builtin_return_address(1) and so on. It's a GCC extension, documented in the gcc manual: http://gcc.gnu.org/onlinedocs/gcc/Return-Address.html Edit: I should probably point out, that gets you the address of the caller. If you want