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.

Tutorial – Write a System Call

198 pointsby zerognowlover 8 years ago

7 comments

warriorkittyover 8 years ago
I decided to read ep1[0] too and I saw a picture &quot;use all the memory&quot;. I don&#x27;t know if it&#x27;s funnier that I checked if you have an &quot;alt&quot; HTML tag or that you actually wrote the text from the picture. People with alt tags are MVPs. :)<p>[0] - <a href="https:&#x2F;&#x2F;brennan.io&#x2F;2016&#x2F;10&#x2F;13&#x2F;kernel-dev-ep1&#x2F;" rel="nofollow">https:&#x2F;&#x2F;brennan.io&#x2F;2016&#x2F;10&#x2F;13&#x2F;kernel-dev-ep1&#x2F;</a>
评论 #13000970 未加载
评论 #13001367 未加载
thirdreplicatorover 8 years ago
Thoroughly enjoyed the tutorial, but why would one want to make a custom system call? What superpowers does this give you? Thanks in advance for your answers.
评论 #13002490 未加载
eximiusover 8 years ago
Hmm... This is certainly very interesting. Can anyone think of any neat kernel-only things that one might implement for kicks as a learning project? Particularly for someone who hasn&#x27;t done kernel programming? It could definitely be a silly thing, but probably more useful than printing to the kernel log.
评论 #13003159 未加载
评论 #13003432 未加载
voltagex_over 8 years ago
Great tutorial. Just a tip - if you change www.kernel.org to cdn.kernel.org you&#x27;ll get a closer mirror site.
评论 #13000743 未加载
dezgegover 8 years ago
One correction to the strncpy_from_user part, specifically this:<p>&gt; The process could try to read another process’s memory by giving a pointer that maps into another process’s address space.<p>This cannot happen, there is no such thing as &quot;a pointer that maps into another process&#x27;s address space&quot;. A virtual address in Linux (on x86 and probably almost all arches) accesses either the processes own memory map (where access to unmapped addresses causes a fault even when done from ring 0) or the kernel virtual mapping.
rogerbover 8 years ago
Really cool tutorial, thanks for writing this up !
xenadu02over 8 years ago
I thought Linux uses sysenter&#x2F;sysexit, not int 0x80&#x2F;iret?<p>Still a good tutorial; there is no magic, it&#x27;s all just software.
评论 #13000764 未加载
评论 #13000736 未加载