This reminded me of <a href="https://mveg.es/posts/writing-a-device-driver-for-unix-v6/" rel="nofollow">https://mveg.es/posts/writing-a-device-driver-for-unix-v6/</a>, which was recently discussed here under <a href="https://news.ycombinator.com/item?id=30679923" rel="nofollow">https://news.ycombinator.com/item?id=30679923</a><p>Also... have you considered contributing this content to the NetBSD Internals book? <a href="https://www.netbsd.org/docs/internals/en/netbsd-internals.html" rel="nofollow">https://www.netbsd.org/docs/internals/en/netbsd-internals.ht...</a> :)
<i>as that would end up copying the \0 along with the rest of the string into the driver</i><p>What? echo definitely doesn't append null terminators. It does append a newline, which you can omit with the -n option or ending the string with \c, depending on which standard it follows.
... as long as you don't want to do fancy IOCTL() work. basically, its the jump table model from 1980s with a few extra twists like templating.<p>"here, steal this mknod number" is dangerous. It pays to check nothing else is using that value. Thats what registries are for in the end.