Reputation: 1
Definition: The device file is the interface between programs and the device driver. The device driver is in the kernel; the programs (applications) are in user space. The way a program can access the driver in the kernel is via the appropriate device special file.
Named pipe exist as a device special file in the file system.
My question:
I the case of named pipe, if it is a device special file, then(by definition) device file is an interface to some device driver in kernel space. Does corresponding device driver exist in kernel space?
Because, I do not see major/minor number below
$ ls -l MYFIFO
prw-r--r-- 1 root root 0 Dec 14 22:15 MYFIFO|
Upvotes: 0
Views: 747
Reputation: 11
There is a driver named "NPFS Driver" and its file is Npfs.sys
"NPFs stands for NPFS (Named Pipe Filesystem) Driver" -https://www.file.net/process/npfs.sys.html
And
npsvctrig.sys is the file for the driver named "Named pipe service triggers"
Both of these drivers are on my system, found using the software Serviwin, and it shows the drivers are 'Started'. For reference, there are other drivers that are stopped, so these two drivers must be in active use. No idea if this is what you're after.
Upvotes: 1
Reputation: 37232
Lets define "kernel" as 2 categories of things - the "core services" (like physical memory management, scheduler, etc), and then "non-core services" (things that aren't always present, like device drivers, file systems, etc - e.g. like ext2 might not be present because you're using RieserFS instead). Note that this is already limited to specific type of kernel (e.g. monolithic kernels and not micro-kernel).
Lets define "device driver" as a piece of code intended sit between one abstraction (the kernel's device driver API, as determined by the OS/kernel designer) and another abstraction (the hardware interface provided by the corresponding device, as determined by hardware designer/manufacturer).
For almost all kernels, one of the "core services" is IPC (Inter-Process Communication) - some way for processes to communicate. For lots of kernels there are multiple different forms of IPC (shared memory, messages, signals, etc). Pipes are just another form of IPC.
Most pipes don't have a name - you just get some sort of opaque handle (e.g. a file descriptor). A named pipe is the same as a normal pipe; except that you associate a name to the pipe so that other processes can find the opaque handle from a "known" name.
Based on all of the above; named pipes do not have a device driver (and are a "core service" and therefore aren't even in the same category as device drivers).
However, "based on all of the above" means "based on my definitions that I made up". The real problem here is that there's no real consensus for how any of the terminology is defined. This is why good books (and good OS documentation) will explicitly define these things. This is also why about half of the people that read this answer will disagree (because they define things like "device driver" differently).
Upvotes: 1