3 ms·
I always wanted the /dev/zero driver to use the device minor number to define the number that got used instead of zero, so you could mknod /dev/seven to make an
by DonHopkins 5y ago
I always wanted the /dev/zero driver to use the device minor number to define the number that got used instead of zero, so you could mknod /dev/seven to make an infinite source of beeps.
- enriquto 5y agoWhy don't you submit a patch to the kernel so that this beautiful idea becomes reality? It is free software: here you can easily be the change you want to see in the world. You may need to be careful because the major number is shared with /dev/null, but I doubt these numbers are hardcoded in many places.
- marcan_42 5y agoThey are definitely hardcoded in many places (e.g. embedded systems, early bring-up - udev style stuff is used for most things these days, but the core /dev/zero, /dev/null, /dev/console stuff is hardcoded everywhere). This would be a kernel-userspace ABI break, which is a big no-no. You could add a new major that does this (keeping the old numbers for compatibility), but I think you'd have a hard time convincing people that this is a worthwhile enough idea; hard-coded new major numbers are in short supply.
- DonHopkins 5y agoAt this point in history it would be prudent to support the full unicode character set, so you could have /dev/poop, etc.
- GoblinSlayer 5y ago/dev/echo - open it, write what you want and let it be echoed as much as you read.