embedded-linux

How to create a large file on a VFAT partition efficiently in embedded Linux

a 夏天 提交于 2019-12-07 15:02:06
问题 I'm trying to create a large empty file on a VFAT partition by using the `dd' command in an embedded linux box: dd if=/dev/zero of=/mnt/flash/file bs=1M count=1 seek=1023 The intention was to skip the first 1023 blocks and write only 1 block at the end of the file, which should be very quick on a native EXT3 partition, and it indeed is. However, this operation turned out to be quite slow on a VFAT partition, along with the following message: lowmem_shrink:: nr_to_scan=128, gfp_mask=d0, other

How do you get a struct device for a Linux character device

我与影子孤独终老i 提交于 2019-12-07 11:12:48
问题 I have a Linux kernel module that implements a character device driver. I've read through Linux Device Drivers and followed several tutorials. At this point, I have a simple module that provides open , release , and write file operations. I'm trying to use the Generic DMA Layer to create a streaming DMA mapping. I'm confused by the following excerpt from LDD: Many of the functions below require a struct device . This structure is the low-level representation of a device within the Linux

Linux System call

╄→гoц情女王★ 提交于 2019-12-07 10:39:11
问题 I am able to get the execution of system calls invocation and it's processing in Kernel. But few things are not yet clear to me. Upon entering the swi routine, the Kernel saves the User mode registers on stack. The question is- Who's stack is it? (As swi handling and the corresponding system call routine needs the stack frame to work upon) If it is Kernel's own stack, from where will get the stack allocated..? Will it start using the current's stack? If yes, then current can be any process

reading serial port blocks for unknown reason

天大地大妈咪最大 提交于 2019-12-07 09:12:02
问题 I am trying to interface a contact-less smart card reader over UART (usbserial) using termios framework under Linux. The code works fine on the PC, but when I cross-compile and try it out on an ARM9 target, it is able to open the device and even writing the command to the device, but the read command blocks indefinitely. Here is the code snippet : int mifare_rdr_init(struct mifare_1K * ptr, char *rdr_devnode) { bzero(ptr, sizeof(struct mifare_1K)); // zero the entire structure // open serial

What is dev_id parameter in request_irq?

北战南征 提交于 2019-12-07 07:47:51
问题 In the function declaration int request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *), unsigned long irqflags, const char *devname, void *dev_id); Is dev_id an 'in' parameter or an 'out' parameter ? Where do we get this number from ? 回答1: Dev_id is an input argument and must be globally unique. Normally the address of the device data structure is used as the Dev_id . It has value NULL if the interrupt line is NOT shared. It holds relevance only when the interrupt

Under what conditions would /sys/kernel/debug/gpio be empty?

最后都变了- 提交于 2019-12-07 06:32:10
问题 Summary My aim is to control the GPIO pins in Peppermint 4 Linux (Kernel version 3.8.0) on an Intel motherboard (NM70 chipset with C1037U processor). I'm debugging issues I'm having using the sysfs interface and am trying to understand the conditions where /sys/kernel/debug/gpio would be empty? When attempting to export pins 0 to 255 by echo XX > /sys/class/gpio/export for XX from 0 to 255, I get the following error message echo: write error: No such device Under what conditions would /sys

Notify gpio interrupt to user space from a kernel module [closed]

£可爱£侵袭症+ 提交于 2019-12-07 05:24:56
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 6 years ago . I have a code which detects GPIO interrupt in a kernel module. Now,I am looking for a mechanism to notify user space upon detecting gpio interrupt from kernel module. Any example / code snippet with certain advantages/disadvantages over different options? I would appreciate

How to do a remote debug using GDB from Qt Creator?

≡放荡痞女 提交于 2019-12-07 05:06:03
问题 I'm working on a Embedded Linux application and I would like to use GDB to debug it. The problem is that, although the Kit configuration seems fine (the Debugger option is correctly pointed to the GDB correspondent to the device's GCC - device is a Linux ARM), when I ask Qt Creator to run in debug mode it returns an error in the "Application Output": sh: gdbserver: not found This seems strange since, as I sad, the configuration is fine and no error about that is reported by Qt Creator in any

USB Port Speed Linux [closed]

心已入冬 提交于 2019-12-07 03:49:39
问题 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 5 years ago . How to programatically determine the usb port speed in embedded devices running the Linux kernel? 回答1: You can read /sys/bus/usb/devices/usb?/speed - it'll give you the bus speed of the root hub(s) in Mbps: either 1.5, 12, 480 or 5000. The first two indicate USB1 (low speed or full speed), the third USB2 and the

Dependency failure while installing libboost-all-dev on ubuntu core 14.04

天涯浪子 提交于 2019-12-07 03:45:07
问题 Does someone know why I get the following after "sudo apt-get install libboost-all-dev": Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: libboost-all-dev : Depends: libboost-context-dev but it is not going