Reputation: 113
I am trying to understand the necessity of /dev node in Linux 2.6 . I do understand that, in Linux 2.4 days, entries under this directory were necessary so as to access the Drivers from userspace. But in 2.6 version we use /sys interface inorder to achieve this. But still could find entries for within /dev directory .
As a step towards understanding the same, I changed the name parameter (this was the name in my /dev directory ) , within "miscdevice" object, that was passed as input to "misc_register" API within my Sensor driver and still the driver worked the same way.
Are there any drivers which still relay on /dev node for their working ? If yes what are they ?
Thanks, Venkatesh.
Upvotes: 3
Views: 167
Reputation: 9230
You are confusing two different things...
The files in /dev
are the actual devices that you read and write to in order to interact with a device - so if you want to write to a serial port you open the file in /dev
that represents it and write to it.
The files in /sys
expose various attributes of the device to userspace so that programs can, for example, see what features a device supports, or hos it is configured. In a few cases the files in /sys
can be written to in order to change the configuration of the device in some way.
Upvotes: 3