Is it called a “device driver” if it is not pointing to a hardware device?












0















The following diagram shows the relationship between a device file, a device driver, and a hardware device:



Application <---> /dev/device_file <---> device driver <---> hardware device


So the application writes data to the device file, and then the data gets passed to the device driver, and then the device driver passes the data to the hardware device (and the opposite happens when reading).



But there are device drivers in Linux that don't point to a hardware device, for example, the /dev/random device file points to a device driver that doesn't point to a hardware device:



Application <---> /dev/random <---> device driver


Is it accurate to say that /dev/random points to a "device driver", or is there another terminology to use?










share|improve this question























  • These are called pseudo-devices on some systems.

    – Kusalananda
    Mar 7 at 22:25











  • When you read/write/ioctl the device file, you're calling into the driver program, which might operate the read hardware or calling some internal non-hardware-related kernel function. The device node itself is simply an interface that kernel expose to you.

    – 炸鱼薯条德里克
    Mar 8 at 0:41
















0















The following diagram shows the relationship between a device file, a device driver, and a hardware device:



Application <---> /dev/device_file <---> device driver <---> hardware device


So the application writes data to the device file, and then the data gets passed to the device driver, and then the device driver passes the data to the hardware device (and the opposite happens when reading).



But there are device drivers in Linux that don't point to a hardware device, for example, the /dev/random device file points to a device driver that doesn't point to a hardware device:



Application <---> /dev/random <---> device driver


Is it accurate to say that /dev/random points to a "device driver", or is there another terminology to use?










share|improve this question























  • These are called pseudo-devices on some systems.

    – Kusalananda
    Mar 7 at 22:25











  • When you read/write/ioctl the device file, you're calling into the driver program, which might operate the read hardware or calling some internal non-hardware-related kernel function. The device node itself is simply an interface that kernel expose to you.

    – 炸鱼薯条德里克
    Mar 8 at 0:41














0












0








0


1






The following diagram shows the relationship between a device file, a device driver, and a hardware device:



Application <---> /dev/device_file <---> device driver <---> hardware device


So the application writes data to the device file, and then the data gets passed to the device driver, and then the device driver passes the data to the hardware device (and the opposite happens when reading).



But there are device drivers in Linux that don't point to a hardware device, for example, the /dev/random device file points to a device driver that doesn't point to a hardware device:



Application <---> /dev/random <---> device driver


Is it accurate to say that /dev/random points to a "device driver", or is there another terminology to use?










share|improve this question














The following diagram shows the relationship between a device file, a device driver, and a hardware device:



Application <---> /dev/device_file <---> device driver <---> hardware device


So the application writes data to the device file, and then the data gets passed to the device driver, and then the device driver passes the data to the hardware device (and the opposite happens when reading).



But there are device drivers in Linux that don't point to a hardware device, for example, the /dev/random device file points to a device driver that doesn't point to a hardware device:



Application <---> /dev/random <---> device driver


Is it accurate to say that /dev/random points to a "device driver", or is there another terminology to use?







linux terminology






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 7 at 22:22









user340660user340660

1




1













  • These are called pseudo-devices on some systems.

    – Kusalananda
    Mar 7 at 22:25











  • When you read/write/ioctl the device file, you're calling into the driver program, which might operate the read hardware or calling some internal non-hardware-related kernel function. The device node itself is simply an interface that kernel expose to you.

    – 炸鱼薯条德里克
    Mar 8 at 0:41



















  • These are called pseudo-devices on some systems.

    – Kusalananda
    Mar 7 at 22:25











  • When you read/write/ioctl the device file, you're calling into the driver program, which might operate the read hardware or calling some internal non-hardware-related kernel function. The device node itself is simply an interface that kernel expose to you.

    – 炸鱼薯条德里克
    Mar 8 at 0:41

















These are called pseudo-devices on some systems.

– Kusalananda
Mar 7 at 22:25





These are called pseudo-devices on some systems.

– Kusalananda
Mar 7 at 22:25













When you read/write/ioctl the device file, you're calling into the driver program, which might operate the read hardware or calling some internal non-hardware-related kernel function. The device node itself is simply an interface that kernel expose to you.

– 炸鱼薯条德里克
Mar 8 at 0:41





When you read/write/ioctl the device file, you're calling into the driver program, which might operate the read hardware or calling some internal non-hardware-related kernel function. The device node itself is simply an interface that kernel expose to you.

– 炸鱼薯条德里克
Mar 8 at 0:41










1 Answer
1






active

oldest

votes


















0














Your model is not correct. The dev files are provided by udev (or in older Linux's devfs). Now udev is apart of systemd. None of this is required at all, you can use drivers with direct API calls (like in Windows). In fact, afaik, some systems don't build with it.



Create a file in /dev is just a function of whatever created dev. Checkout mount | grep ' /dev '



udev on /dev type devtmpfs (rw,nosuid,relatime,size=8087376k,nr_inodes=2021844,mode=755)
^ See the udev. That's what created the abstraction.


The driver exists in the kernel. The abstraction layers is provided so you have file/io to the device. This follows the Unix methodology that all things are files, but it's not required.






share|improve this answer


























  • Device nodes are part of the kernel API, they’re not an external abstraction. Some drivers have equivalent system calls (e.g. getrandom()) but most don’t.

    – Stephen Kitt
    Mar 8 at 5:37












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f505023%2fis-it-called-a-device-driver-if-it-is-not-pointing-to-a-hardware-device%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Your model is not correct. The dev files are provided by udev (or in older Linux's devfs). Now udev is apart of systemd. None of this is required at all, you can use drivers with direct API calls (like in Windows). In fact, afaik, some systems don't build with it.



Create a file in /dev is just a function of whatever created dev. Checkout mount | grep ' /dev '



udev on /dev type devtmpfs (rw,nosuid,relatime,size=8087376k,nr_inodes=2021844,mode=755)
^ See the udev. That's what created the abstraction.


The driver exists in the kernel. The abstraction layers is provided so you have file/io to the device. This follows the Unix methodology that all things are files, but it's not required.






share|improve this answer


























  • Device nodes are part of the kernel API, they’re not an external abstraction. Some drivers have equivalent system calls (e.g. getrandom()) but most don’t.

    – Stephen Kitt
    Mar 8 at 5:37
















0














Your model is not correct. The dev files are provided by udev (or in older Linux's devfs). Now udev is apart of systemd. None of this is required at all, you can use drivers with direct API calls (like in Windows). In fact, afaik, some systems don't build with it.



Create a file in /dev is just a function of whatever created dev. Checkout mount | grep ' /dev '



udev on /dev type devtmpfs (rw,nosuid,relatime,size=8087376k,nr_inodes=2021844,mode=755)
^ See the udev. That's what created the abstraction.


The driver exists in the kernel. The abstraction layers is provided so you have file/io to the device. This follows the Unix methodology that all things are files, but it's not required.






share|improve this answer


























  • Device nodes are part of the kernel API, they’re not an external abstraction. Some drivers have equivalent system calls (e.g. getrandom()) but most don’t.

    – Stephen Kitt
    Mar 8 at 5:37














0












0








0







Your model is not correct. The dev files are provided by udev (or in older Linux's devfs). Now udev is apart of systemd. None of this is required at all, you can use drivers with direct API calls (like in Windows). In fact, afaik, some systems don't build with it.



Create a file in /dev is just a function of whatever created dev. Checkout mount | grep ' /dev '



udev on /dev type devtmpfs (rw,nosuid,relatime,size=8087376k,nr_inodes=2021844,mode=755)
^ See the udev. That's what created the abstraction.


The driver exists in the kernel. The abstraction layers is provided so you have file/io to the device. This follows the Unix methodology that all things are files, but it's not required.






share|improve this answer















Your model is not correct. The dev files are provided by udev (or in older Linux's devfs). Now udev is apart of systemd. None of this is required at all, you can use drivers with direct API calls (like in Windows). In fact, afaik, some systems don't build with it.



Create a file in /dev is just a function of whatever created dev. Checkout mount | grep ' /dev '



udev on /dev type devtmpfs (rw,nosuid,relatime,size=8087376k,nr_inodes=2021844,mode=755)
^ See the udev. That's what created the abstraction.


The driver exists in the kernel. The abstraction layers is provided so you have file/io to the device. This follows the Unix methodology that all things are files, but it's not required.







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 8 at 0:17

























answered Mar 8 at 0:11









Evan CarrollEvan Carroll

6,055114586




6,055114586













  • Device nodes are part of the kernel API, they’re not an external abstraction. Some drivers have equivalent system calls (e.g. getrandom()) but most don’t.

    – Stephen Kitt
    Mar 8 at 5:37



















  • Device nodes are part of the kernel API, they’re not an external abstraction. Some drivers have equivalent system calls (e.g. getrandom()) but most don’t.

    – Stephen Kitt
    Mar 8 at 5:37

















Device nodes are part of the kernel API, they’re not an external abstraction. Some drivers have equivalent system calls (e.g. getrandom()) but most don’t.

– Stephen Kitt
Mar 8 at 5:37





Device nodes are part of the kernel API, they’re not an external abstraction. Some drivers have equivalent system calls (e.g. getrandom()) but most don’t.

– Stephen Kitt
Mar 8 at 5:37


















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f505023%2fis-it-called-a-device-driver-if-it-is-not-pointing-to-a-hardware-device%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

is 'sed' thread safe

How to make a Squid Proxy server?