embedded-linux

How to compile dts Linux device tree source files to dtb?

自闭症网瘾萝莉.ら 提交于 2019-11-28 18:35:31
问题 I have a device tree file (.dts) and I want to compile the file for my powerpc based board. How can I do it on my machine, which is not powerpc based?? Can I do it with the DTC installed on my Ubuntu system? Or will it be more like using a separate compiler and passing ARCH information (like using a toolchain)? 回答1: Device trees do not need to be compiled with "architecture-aware" tools. The dtc compiler on your ubuntu machine is probably current enough to compile your device tree. Or you can

how to use the libnl library to trigger nl80211 commands?

孤人 提交于 2019-11-28 18:30:05
Please can someone give an simple example on how to use libnl to use nl80211. I tried to go through iw source code but it is very confusing. Can any one give a simple program on how to trigger nl80211 commands such as NL80211_CMD_GET_WIPHY using the libnl. Here is a very basic program sending a NL80211_CMD_GET_INTERFACE , and parsing out the interface type returned in the NL80211_CMD_GET_INTERFACE attribute. Beware, there is very little error checking here, you should not use any of this program as is! Almost all these functions can fail. #include "netlink/netlink.h" #include "netlink/genl

Userspace vs kernel space driver

柔情痞子 提交于 2019-11-28 17:30:05
I am looking to write a PWM driver. I know that there are two ways we can control a hardware driver: User space driver. Kernel space driver If in general (do not consider a PWM driver case) we have to make a decision whether to go for user space or kernel space driver. Then what factors we have to take into consideration apart from these? User space driver can directly mmap() /dev/mem memory to their virtual address space and need no context switching. Userspace driver cannot have interrupt handlers implemented (They have to poll for interrupt). Userspace driver cannot perform DMA (As DMA

How does the linux kernel manage less than 1GB physical memory?

爷,独闯天下 提交于 2019-11-28 15:05:13
I'm learning the linux kernel internals and while reading "Understanding Linux Kernel", quite a few memory related questions struck me. One of them is, how the Linux kernel handles the memory mapping if the physical memory of say only 512 MB is installed on my system. As I read, kernel maps 0(or 16) MB-896MB physical RAM into 0xC0000000 linear address and can directly address it. So, in the above described case where I only have 512 MB: How can the kernel map 896 MB from only 512 MB ? In the scheme described, the kernel set things up so that every process's page tables mapped virtual addresses

what does “-sh: executable_path:not found” mean

我只是一个虾纸丫 提交于 2019-11-28 14:24:11
i am trying to run an executable in linux shell ( OpenELEC on raspberry pi ) OpenELEC:~ # /storage/fingi/usr/lib/autossh/autossh -sh: /storage/fingi/usr/lib/autossh/autossh: not found What does the "not found" in this case mean ? If i try to do ldd: OpenELEC:~ # ldd /storage/fingi/usr/lib/autossh/autossh /usr/bin/ldd: eval: line 1: /storage/fingi/usr/lib/autossh/autossh: not found And if i do file: OpenELEC:~ # file /storage/fingi/usr/lib/autossh/autossh /storage/fingi/usr/lib/autossh/autossh: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for

How to write a simple Linux device driver?

两盒软妹~` 提交于 2019-11-28 13:32:39
问题 I need to write an SPI Linux character device driver for omap4 from scratch. I know some basics of writing device drivers. But, I don't know how to start writing platform specific device driver from scratch. I've written some basic char drivers, and I thought writing SPI device driver would be similar to it. Char drivers have a structure file_operations which contains the functions implemented in the driver. struct file_operations Fops = { .read = device_read, .write = device_write, .ioctl =

Are kernel headers depend on processor type, vendor etc?

对着背影说爱祢 提交于 2019-11-28 10:47:06
问题 I have downloaded the sources for a Linux kernel from kernel.org and created the header files by calling make ARCH=arm headers_check I have an embedded platform and ask myself if this is enough because I don't have the header files from the vendor. What are the dependencies of header files? It looks to me that header files are quite hardware specific and I expect that they depend on the CPU type etc.. Is it enough to specify the architecture just by ARCH=arm? Is it probable that a vendor of

Why does arm-linux-gnueabi-g++-4.4 always build a “7-A” binary?

无人久伴 提交于 2019-11-28 08:48:24
I'm running Ubuntu 12:04LTS and installed arm-linux-gnueabi C and C++ compiler. The compiled binary won't run on my target board. It looks like even if I specify the cpu and arch, the compiler still builds a binary for the wrong CPU. Instead of atm9tdmi it build and 7-A. Am I doing something wrong or is there something I should have configured? Thanks. ~/ArmTest$ arm-linux-gnueabi-g++-4.4 -mcpu=arm9tdmi -march=armv4t -O main.cpp -o CPPTest ~/ArmTest$ readelf -A CPPTest Attribute Section: aeabi File Attributes Tag_CPU_name: "7-A" Tag_CPU_arch: v7 Tag_CPU_arch_profile: Application Tag_ARM_ISA

call to request_mem_region() fails

馋奶兔 提交于 2019-11-28 06:07:52
问题 The start address 0x4806E000 (UART4 base address) is already present in /proc/iomem with the name omap4-uart. How to disable the memory regions already allocated ?. Edit : Even though request_mem_region is successful the console during booting shows this messages. [ 0.758514] Serial: 8250/16550 driver, 3 ports, IRQ sharing enabled [ 0.760040] omap_uart.0: ttyO0 at MMIO 0x4806a000 (irq = 104) is a OMAP UART0 [ 0.760498] omap_uart.1: ttyO1 at MMIO 0x4806c000 (irq = 105) is a OMAP UART1 [ 0

Cross compiling a kernel module

佐手、 提交于 2019-11-28 04:22:20
I'm trying to cross compile a helloworld kernel (2.6.x) module for ARM architecture on my intel x86 host. The codesourcery tool chain for ARM is located at: /home/ravi/workspace/hawk/arm-2009q3 The kernel source is located at : /home/ravi/workspace/hawk/linux-omapl1 My Makefile: ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi obj-m := Hello.o KDIR := /home/ravi/workspace/hawk/linux-omapl1 PWD := $(shell pwd) default: $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules clean: $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) clean When i run make , the .ko produced is that of my host machine which means the makefile is