• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

Linux device driver question

shaolin3a

Limp Gawd
Joined
May 6, 2006
Messages
147
I'm trying to write a software defined radio application in Linux (similar to GNU Radio for those who knows) and interfacing some hardware. Now, I'm not too familiar with driver development and this is my way to trying to get to learning how.

My question is: how do user-mode applications talk to device drivers in kernel space besides reading/writing to the corresponding /dev/xx file? In particular, I may have device-specific functions that my app would like to access. How is this done conventionally?

Any explanation or direction to some guides/books would be appreciated!
 
Thanks ambietZ! That does look like a good point for me to start. I'll start going through this now :)

I would still love to hear other suggestions or explanations.
 
In Linux applications in user-space communicate via system calls to kernel space. The same is true with device drivers in Linux. The kernel has subroutines which are specific to the device drivers or modules, though every device type has its own device driver. The given driver you choose to communicate with is chosen just like everything else by a file descriptor. Everything in Unix style operating systems is based on files, so a device driver or module is no different. The file descriptors for devices are a bit different and we call them major and minor numbers. Similar devices like IDE drives will have the same major number but different minor numbers to distinguish.

It is a lot to explain and a good book like Love's Kernel book would help you greatly.
 
Ah, so that's what major numbers do. I went through some tutorials that has me writing a sample driver and never knew what major numbers did. I'll see if I can pick up a copy of Linux Kernel Development.

Thanks for your input, Scotch!
 
Back
Top