embedded-linux

Content of /proc/iomem

戏子无情 提交于 2019-11-28 02:13:22
问题 1) Is it possible to access a physical address which is not defined in /proc/iomem? 2) If the physical address range of a device does not appear in /proc/iomem, does it mean that the device has not been utilized/initialized yet? 回答1: 1) Is it possible to access a physical address which is not defined in /proc/iomem? Yes. Assuming an ARM processor which memory maps all directly-connected periperals, the driver could perform an ioremap() operation to map the physical memory to virtual memory

how to change the host type for a 'Canadian cross' compilation of GCC with crosstool-NG

 ̄綄美尐妖づ 提交于 2019-11-28 02:05:31
问题 I've installed crosstool-NG and built GCC on a host+build x86 machine that targets arm-unknown-linux-gnueabi. I've then used arm-unknown-linux-gnueabi-gcc to compile a program that ran well on my ARM board. I'm wanting to now build GCC, targeting ARM to be hosted on ARM. I believe the lingo is build=i486-pc-linux-gnu target=arm-unknown-linux-gnueabi-gcc host=arm-unknown-linux-gnueabi-gcc How do I do this? do I run ./configure for crosstool-NG passing --host=arm-unknown-linux-gnueabi-gcc? or

Difference between device_register and driver_register

懵懂的女人 提交于 2019-11-28 02:04:58
问题 I am writing a UART driver. I came across the two functions in the chapter 14.Linux Device Model. int device_register(struct device *dev); int driver_register(struct device_driver *drv); Since UART is a char driver I have dynamically created the major number using ( alloc_chrdev_region) and added the device to kernel by using cdevadd() . I came across uart_register_driver() and platform_driver_register() in omap-serial.c. I could map the driver_register with the platform_driver_register() but

The irq in kernel function asm_do_IRQ() is different from the one I request in module

你说的曾经没有我的故事 提交于 2019-11-28 02:02:53
I did some experiment with a cortex-A9 development board. I used gpio_to_irq() to get an irq num and I requested the irq and wrote a small driver with it , it was 196 in syslog . And I added some printks in asm_do_IRQ. When I triggered the gpio interrupt , the driver works fine but the irq num in asm_do_IRQ was 62 .I can't understand. Why the irq number was different from the one I request? The driver is as follow: #include <linux/module.h> #include <linux/interrupt.h> #include <linux/irq.h> #include <linux/gpio.h> #define GPIO_N 36 //gpio number int flag = 0; static irqreturn_t handler(int

Can I prevent a Linux user space pthread yielding in critical code?

十年热恋 提交于 2019-11-28 01:01:07
问题 I am working on an user space app for an embedded Linux project using the 2.6.24.3 kernel. My app passes data between two file nodes by creating 2 pthreads that each sleep until a asynchronous IO operation completes at which point it wakes and runs a completion handler. The completion handlers need to keep track of how many transfers are pending and maintain a handful of linked lists that one thread will add to and the other will remove. // sleep here until events arrive or time out expires

How to get the address of a kernel module that was inserted using insmod?

拈花ヽ惹草 提交于 2019-11-28 00:39:32
问题 I would like to know the address of a kernel module. Actually, from stack trace it looks that the crash has been triggered from a kernel module (which have been insmoded after system boots up). There are several modules I insmod manually. So I need to detect which module among these is triggering the crash. Please let me know how to get the address of each modules loaded using insmod. 回答1: cat /proc/modules should give you a rough guide to where things are loaded. You might get more of a clue

Install things on Pepper

断了今生、忘了曾经 提交于 2019-11-28 00:33:02
How would I install things on Pepper, since I don't know what package manager it uses. I usually use apt on my Ubuntu machine and want to install some packages on Pepper. I'm not sure what package manager Pepper has (if any) and want to install some packages, but also only know the name of the package using apt (not sure if the package name is the same on other package managers). And if possible, would I be able to install apt on Pepper. Thanks. Note: From the research I've done, Pepper is using NaoQi which is based off Gentoo which uses portage. You don't have root access on Pepper, which

Building kernel uImage using LOADADDR

痞子三分冷 提交于 2019-11-27 22:27:40
While building the kernel I am giving LOADADDR as "0x80008000": make uImage LOADADDR=0x80008000 Can you please help to understand what is the use of this? Can I change the LOADADDR, is there any restriction on the length of the LOADADDR? (I'm assuming that you're using ARM based on the mention of U-Boot and the value of LOADADDR.) Can you please help to understand what is the use of this? LOADADDR specifies the address where the kernel image will be located by the linker. (This is true for a few architectures (e.g. Blackfin), but not for ARM. LOADADDR specifies the address where the kernel

Driving Beaglebone GPIO through /dev/mem

坚强是说给别人听的谎言 提交于 2019-11-27 17:10:47
I'm trying to write a C program for blinking a LED on the Beaglebone. I know I can use the sysfs way...but I'd like to see if it is possible to get the same result mapping the physical address space with /dev/mem. I have a header file, beaglebone_gpio.h wit the following contents: #ifndef _BEAGLEBONE_GPIO_H_ #define _BEAGLEBONE_GPIO_H_ #define GPIO1_START_ADDR 0x4804C000 #define GPIO1_END_ADDR 0x4804DFFF #define GPIO1_SIZE (GPIO1_END_ADDR - GPIO1_START_ADDR) #define GPIO_OE 0x134 #define GPIO_SETDATAOUT 0x194 #define GPIO_CLEARDATAOUT 0x190 #define USR0_LED (1<<21) #define USR1_LED (1<<22)

How to cross-compile for MIPS?

[亡魂溺海] 提交于 2019-11-27 16:09:53
问题 I have a DVB receiver (set-top box) similar like Dreambox and it has MIPS cpu It has embedded Linux and I can connect to it with telnet Question is how to compile simple "Hello World" application in C? Where to get toolchain, SDK? 回答1: You should use Codescape SDK. 回答2: http://www.linux-mips.org/wiki/Toolchains There you have some prebuilt cross compilers, or the instruction to build GCC as a cross compiler. 来源: https://stackoverflow.com/questions/5291190/how-to-cross-compile-for-mips