TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Writing a NetBSD Kernel Module

75 pointsby jayp1418about 3 years ago

4 comments

jmmvabout 3 years ago
This reminded me of <a href="https:&#x2F;&#x2F;mveg.es&#x2F;posts&#x2F;writing-a-device-driver-for-unix-v6&#x2F;" rel="nofollow">https:&#x2F;&#x2F;mveg.es&#x2F;posts&#x2F;writing-a-device-driver-for-unix-v6&#x2F;</a>, which was recently discussed here under <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=30679923" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=30679923</a><p>Also... have you considered contributing this content to the NetBSD Internals book? <a href="https:&#x2F;&#x2F;www.netbsd.org&#x2F;docs&#x2F;internals&#x2F;en&#x2F;netbsd-internals.html" rel="nofollow">https:&#x2F;&#x2F;www.netbsd.org&#x2F;docs&#x2F;internals&#x2F;en&#x2F;netbsd-internals.ht...</a> :)
评论 #30928712 未加载
userbinatorabout 3 years ago
<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&#x27;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.
ggmabout 3 years ago
... as long as you don&#x27;t want to do fancy IOCTL() work. basically, its the jump table model from 1980s with a few extra twists like templating.<p>&quot;here, steal this mknod number&quot; is dangerous. It pays to check nothing else is using that value. Thats what registries are for in the end.
评论 #30930391 未加载
dganabout 3 years ago
Why would one want to write a module instead of using a library to achieve the same?