Writing a NetBSD Kernel Module
saurvs.github.io
saurvs.github.io
Also... have you considered contributing this content to the NetBSD Internals book? https://www.netbsd.org/docs/internals/en/netbsd-internals.ht... :)
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.
"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.