Programming :: Issue Ioctls To A Usb Driver From User Space?
Sep 17, 2010
I am looking for a way to issue ioctls to a usb driver from user space. Upon googling, I found that usbfs provides a way to do that, anyhow I can't find sample code to try that out.
Note:
I have written a sample usb driver on the lines of 'Linux device drivers' book. Now I need to try ioctls with usb drivers.
View 2 Replies
ADVERTISEMENT
Dec 13, 2010
I am developing a I2C CDROM client driver. The CDROM firmware supports TOC information read through a I2C command. It sends the TOC information in burst ( Interrupts a GPIO pin when it is ready ) and my CPU does a I2C read to read the TOC. When the CDROM firmware finishes sending the last data burst , it informs my CPU that it is done with the TOC, by a flag in the last data burst. I would like to know, which is the most efficinet way I can send these TOC information to userspace?
View 4 Replies
View Related
Jul 7, 2009
I wanna write a file in kernel space but from my searching I can to know that instead of writeing file in kernel space ,I can write data to user space by copy_to_user space.
But link is missing ...I dont know how will my user space will access kernel space means my function in kernel space which will do copy_to_user /....How my user space function will call my kernel level function ..
Can any one of you provide me with some example file which are doing this .I know every char driver is using it ...but i could not trace back how user level function is accessing it ...i m confused between user space and kernel space.
View 2 Replies
View Related
Jul 14, 2009
How to use execv from kernel space to call a user space program writtenfor socket prog.
I tried to write code for socket in kernel but its not working.
Socket code in kernel is also needed.
View 2 Replies
View Related
Jul 21, 2011
I have the following requirement in my module. The driver gets some data from the external device. After getting 1MB of data it has to send it to the user space application. What is the best thing to implement for this in driver.? Is it ok to implement like, after getting data, the driver will send a signal to the user space application. Then the user space application sends an ioctl to read the data. Is there any alternate, that the driver directly sends the data without the user space application asks for it.?
View 4 Replies
View Related
Oct 26, 2010
I use an application that encapsulates IPv4 packets in an IPv4 tunnel using the TUN/TAP driver in Linux. There is a fancy protocol used between the 2 layers. This software works like a charm.
I have started modifying the source code in order to send IPv6 packets in an IPv4 tunnel. So far, the software seems to work fine but the information (packets) does not seem to make their way back to the user space.
I initiate an ICMPv6 packet with ping6. It gets in the tun0 interface. The software makes the IPv4 encapsulation and sends the information out of the system. The ICMPv6 echo reply comes back to the system with the corresponding encapsulation. The software removes the encapsulation and writes the packet in the tun0 interface. The ping6 application never receives ICMPv6 echo reply.
I have confirmed the integrity of the transaction using tcpdump on the tun0 interface. The interface comes up with the "inet 6 addr" only. The interface has the flags "UP POINTOPOINT RUNNING". The RX/TX counters are incrementing and no drops are observed at the interface level.
How can I troubleshoot this problem? There seems to be a lost link between the tun0 driver and the user space applications. The system uses SuSE Linux Enterprise 10 SP1. This is based on kernel 2.6.16. This is quite old.
View 3 Replies
View Related
Jan 4, 2010
Logical Memory Space of 4GB is divided in to 3GB User Space and 1GB Kernel Space. Always. Correct?
1. How can we change it? (just changing value of PAGE_OFFSET is okay?)
2. If system have only 256MB of memory (embedded system) and suppose Kernel Modules eat away all the memory during boot. User space will be left will no memory. Is this case possible?
View 2 Replies
View Related
Jul 14, 2011
I have written a device driver and I would like to disable an interrupt. In kernel space there is a function called "disable_irq(int irq)", but, is it possible to do it from user space?
View 7 Replies
View Related
Jun 10, 2009
I'm using vmsplice & splice to send memory buffers through a TCP socket. I have two issues using these methods:
1) According to the documentation, when using vmsplice with the flag SPLICE_F_GIFT, you cannot modify the buffer you've "given" the kernel. Currently, each time I want to send a buffer, I have to allocate a page-aligned buffer (fill it with data) and send it using vmsplice- splice. When can I deallocate this buffer? Is it possible to modify this buffer after the buffer is sent through the socket?
2) The buffer should be page-aligned both in memory and in length, but most of the time the sent messages (to the TCP socket) - are smaller than a page size - is it possible to "clear" the pipe from the remaining buffer?
View 1 Replies
View Related
Dec 10, 2008
I am writing a program which i dont want the kernel scheduler to preempt before certain time duration. I am using the system call sched_get_priority_max to set the maximum priority. However it is not producing results.
View 3 Replies
View Related
Jul 28, 2010
I want to simulate a serial protocol in user space program to test reception algorithm. The protocol is similar to UART protocol but frame format is different. The duration of 1 bit is 114,46 us. In my main function I'm creating two threads. Tx for simulating transmitting data and Rx for reception data. For measure time I use create_timer() function and signals. Each thread has its own timer and signal handler. Tx timer uses SIGUSR1 and Rx timer uses SIGUSR2. Tx thread sets the global variable and Rx reads it.
The timers are set to sample with 114,46 us period. When they reach this value signal handler should set the flag. Flag is check in thread and some operation are made. When I set the timers period for longer time (100 ms) everything works fine but when I change it to default value (114,46 us) the Rx thread doesn't receive the proper data. I am wondering if the 114,46 timer period is possible to simulate in user space? Whether the time will give me the proper resolution ? Theoretically it should provide 1 ns resolution.
View 3 Replies
View Related
Feb 7, 2010
I have a user Application for transferring the data from one PC to the other PC using Ethernet Port, can we create a device driver for that ?? that means it should act like a virtual device, if we write data into /dev/some file, it should go the other PC
View 3 Replies
View Related
Sep 22, 2009
I am writing device driver in which i have to call callback function from kernel space, which are saving my data. But the callback functions are in userspace. While accessing them i am getting segmentation fault.
View 1 Replies
View Related
Jun 21, 2010
In a 32-bit system, max memory addressable is 4GB. Now Linux kernel does memory mapping division of 1GB for kernel address space and 3GB for user address space. That means 4GB of virtual address space is divided between kernel (1GB) and user (3GB).
Q1. All virtual mapping utilizes the available physical RAM without any division? I mean to say that if RAM is 512MB then a page in kernel space can lie any where RAM (leave aside old PCI dma accesses)? (How this fits to fact that kernel memory is non-pageble)
Q2. If a process is created in user space, it has visibility 4GB address space or 3GB address space?
View 2 Replies
View Related
Jun 16, 2011
Do you think there is a way of accessing different user data from another account which I have set up.
Ie. user 1 = account has messed up
user 2 = account works fine
access user account 1 home directory from user 2 work space?
View 9 Replies
View Related
Nov 28, 2010
measure kernel space time and user space time?
View 1 Replies
View Related
May 27, 2009
I want to get the disk space usage of each user on the machine. I Have found the command -du but how can I consultate the usage per user? The only thing I can is to consultate the usage of maps...
View 3 Replies
View Related
Oct 25, 2010
I'm pretty new to this whole (micro)kernel architecture story.
Im wondering if a kernel module is running in kernel or in user space?
Is a driver running as kernel module slower than a driver build into kernel?
If so, are there some current articles, benchmarks?
View 4 Replies
View Related
Jun 27, 2010
I hope this is the right place to post to because I haven't found any other related forums.I'm working on an AMD opteron running Linux 2.6.28.6 I want to preload a hardware performance counter (register) with a value to have it overflow after a number of a specific event counts. As I understand, when the counter in the register overflows, an interrupt will be generated and handled by the appropriate interrupt handler. How can my user-level application get notified whenever the interrupt occurs? I want to obtain information on the instruction that caused the overflow. Is this possible? I think this is different than responding to signals with sigaction().
View 1 Replies
View Related
Feb 22, 2010
If the calling process passes me the virtual address of an its array for example, how can I access it without using copy_from_user?
View 2 Replies
View Related
Jul 12, 2010
what difference between user and kernel space.
View 2 Replies
View Related
Nov 11, 2010
cusexmp, the example of CUSE program, works. Is there real programs that makes use of it? For example, a thing that just mirrors other character device or thing that allows networked character devices.
View 1 Replies
View Related
Dec 24, 2009
i am using linux redHat 5 and fedora9 How can assgin disk space quota to particular user suppose i have 4 users
user1
user2
user3
user4
All four users have a each folder
/data/folder1
/data/folder2
/data/folder3
/data/folder4
i want to assign space limit/restriction of 100MB on each on folder.
View 3 Replies
View Related
Jul 14, 2011
I've been looking to get some torrent downloads running on school servers, but I obviously can't install a torrent client because I don't have root (and by extent, can't run anything requiring root privileges). Servers are running various versions of Red Hat (at least the x86_64 ones are, I don't want to recompile if I don't have to). Google has failed me thus far.
View 13 Replies
View Related
May 3, 2010
I need a shared buffer between user and kernel space. I read that one way is to allocated buffer in kernel and then call mmap from the user space. I searched for an example but couldn't find something useful. If you know, could you please send me any links or sample code that does this..
View 1 Replies
View Related
Feb 18, 2010
I have a list of Logical Block Addresses that I need to read from the disk. Is there any way to do this from user space?
View 1 Replies
View Related
Sep 13, 2011
I want to create account for user named John Doe.
I'm trying: useradd "John Doe" and it's not work.
How to create user account with space inside on CentOS CLI?
View 6 Replies
View Related
Oct 4, 2010
I have a 80GB HDD on which I have installed Ubuntu10.04. I have about 45GB space remaining. I am trying to install Fedora13. I create : 2GB / partition - 2.4GB swap partition. I want to create 6GB /usr partition and it says not enough disk space? Why is it giving that message?
View 1 Replies
View Related
Feb 8, 2011
I am unable to access a standard memory pcie card bar registers through my driver on the pcie interface for Zotec H55 ITX motherboard (it includes a built in NVideo engine). This is the following setup:
1. Fedora 14 32 bit pcie scan does see the board (lspci -n show card on pcie bus #2)
2. Configuration register read is good. (pci_read_config_byte())
3. The following driver commands did correctly return bar information: pci_rsource_start(), pci_resource_end(),pci_resource_len()
4. The commands iowrite32() or memcopy_toio() results in no pcie transfers (determined through pcie core probing)
5. The same driver code fully functioned on the Intel DH57JG mini-ITX. (using lspci -n, pcie located on pcie bus #1)
6. Note, it seems that the pcie connector for Zotec is on bus#2, where as Intel MB pcie connector is on bus#1. Note also that the Zotec has a built in NVidia graphics engine.
The following driver code was used. Again, it worked on DH57JG:
pcid.pciaddr_phy_str_bar0 = pci_resource_start(pcid.pcidev,0);
if(pcid.pciaddr_phy_str_bar0 == 0) {
printk(KERN_INFO "fail to get pci start address for Bar0.
");
return -ENODEV; }
pcid.pciaddr_phy_len_bar0 = pci_resource_len(pcid.pcidev,0);
if(pcid.pciaddr_phy_len_bar0 == 0) {
printk(KERN_INFO "fail to get pci end address for Bar0.
"); .....
// testing
for(i=0;i<100;i++)
for(j=0;j<4;j++){
iowrite32(0x13572348,(void *)(pcid.pciaddr_base_bar2+(long unsigned int)(4*j)));
iowrite32(0x12344321,(void *)(pcid.pciaddr_base_bar0));}
i = ioread32((void *)(pcid.pciaddr_base_bar2));
printk(KERN_INFO "pci bar2 reg0=%x
",i); <<<<< FAIL .....
View 1 Replies
View Related
Jul 4, 2011
There are some user-space based NFS clients (e.g. NFS Client library). Can I bypass file permissions by using such client? code...
Client1 uses usual NFS client (kernel-mode based) and user1@client1 can read only file1, but not file2.
As I understand, client1 sends uid in nfs request, server1 do a permissions check based on the request data. So, I suggest this is possible to have a client2:
Client2 uses user-space client, and hacker@client2 knows uids of user1 and user2; If he wants to read file1 he can send uid of user1; if he wants to read file2, he sends uid of user2.
Is the scheme possible?
View 1 Replies
View Related