TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

I summarized my understanding of Linux systems

342 点作者 lsc4719大约 1 年前

12 条评论

tmalsburg2大约 1 年前
I learned a lot about this from the book &quot;The design of the Unix operating system&quot; by Maurice J. Bach.¹ It&#x27;s an old book and many details deviate from actual present-day Linux, but it nonetheless gives a great overview of the key components and ideas.<p>¹ <a href="https:&#x2F;&#x2F;books.google.de&#x2F;books&#x2F;about&#x2F;The_Design_of_the_UNIX_Operating_System.html?id=BxZpQgAACAAJ&amp;source=kp_book_description&amp;redir_esc=y" rel="nofollow">https:&#x2F;&#x2F;books.google.de&#x2F;books&#x2F;about&#x2F;The_Design_of_the_UNIX_O...</a>
评论 #39704466 未加载
评论 #39704353 未加载
cookiengineer大约 1 年前
I can recommend taking a look at &#x2F;proc and &#x2F;sys, because that will clear up a lot of how things are intertwined and connected.<p>procfs is what&#x27;s used by pretty much all tools that do something with processes, like ps, top etc.<p>The everything is a file philosophy becomes much more clear then. Even low level syscalls and their structs are offered by the kernel as file paths so you can interact with them by parsing those files as a struct, without actually needing to use kernel headers for compilation.<p>eBPF and its bytecode VM are a little over the top, but are essential to known about in the upcoming years cause a lot of tools is moving towards using their own bpf modules.
评论 #39701657 未加载
richardwhiuk大约 1 年前
I don&#x27;t understand what the boxes on this diagram are meant to represent.<p>It feels like an elaborate mechanism to draw something wrong in the hopes people will correct it.
评论 #39705433 未加载
评论 #39706428 未加载
评论 #39702998 未加载
dfc大约 1 年前
My mental model of Linux does not have the CPU&#x2F;Memory in user space. What am I missing?
评论 #39702242 未加载
评论 #39702059 未加载
knorker大约 1 年前
Whenever I&#x27;ve made notes like this, it&#x27;s never been useful to my future self nor to anyone else.<p>The only use I&#x27;ve had of this kind of documentation is that the process of writing it, made me understand it better. Basically write-only documentation.<p>I would call myself a Linux expert, and while I can kinda see what you mean with this diagram, it would not have been useful to me back before I was an expert.
评论 #39709063 未加载
评论 #39705174 未加载
评论 #39708788 未加载
timeforcomputer大约 1 年前
Nice! I want to do something similar and map my understanding of Linux. I find some diagrams on Wikipedia fascinating (example: <a href="https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;File:Linux_Graphics_Stack_2013.svg" rel="nofollow">https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;File:Linux_Graphics_Stack_20...</a>, but more to do with the user library ecosystem rather than kernel and program runtime). These diagrams make me want to learn about each part and be able to comprehend in principle what is happening on my machine. Eventually...
评论 #39705782 未加载
smitty1e大约 1 年前
I think it needs three areas, not two:<p>1. User space<p>2. Kernel<p>3. Hardware&#x2F;network<p>The kernel protects users from hardware, and hardware from users.
评论 #39701579 未加载
评论 #39701590 未加载
thesuperbigfrog大约 1 年前
&quot;The Linux Programming Interface&quot; by Michael Kerrisk is one of the best technical resources I have found and used to understand Linux:<p><a href="https:&#x2F;&#x2F;man7.org&#x2F;tlpi&#x2F;" rel="nofollow">https:&#x2F;&#x2F;man7.org&#x2F;tlpi&#x2F;</a><p>Description from the book&#x27;s website:<p>&quot;The Linux Programming Interface (TLPI) describes system programming on Linux and UNIX.<p>TLPI is both a guide and reference book for system programming:<p>If you are new to system programming, you can read TLPI linearly as an introductory guide: each chapter builds on concepts presented in earlier chapters, with forward references kept to a minimum. Most chapters conclude with a set of exercises intended to consolidate the reader&#x27;s understanding of the topics covered in the chapter.<p>If you are an experienced system programmer, TLPI provides a comprehensive reference that you can consult for details of nearly the entire Linux and UNIX (i.e., POSIX) system programming interface. To support this use, the book is thoroughly cross referenced and has an extensive index.&quot;
peter_d_sherman大约 1 年前
A future simple linux-like (or unix-like) OS -- could theoretically be created with <i>only 4 syscalls</i>:<p>open() read() write() close()<p>Such a theoretical linux-like or unix-like OS would assume quite literally that <i>&quot;everything is a file&quot;</i> -- including the ability to <i>perform all other syscall&#x2F;API calls&#x2F;functions via special system files</i>, probably located in &#x2F;proc and&#x2F;or &#x2F;sys and&#x2F;or other special directories, as other posters have previously alluded to...<p>Also, these 4 syscalls could theoretically be combined into a <i>single syscall</i> -- something like (I&#x27;ll use a Pascal-like syntax here because it will read easier):<p>FileHandleOrResult = <i>OpenOrReadOrWriteOrClose(FileHandle: Integer; Mode: Integer; pData: Pointer; pDataLen: Integer);</i><p>if Mode = 1 then open();<p>if Mode = 2 then read();<p>if Mode = 3 then write();<p>if Mode = 4 then close();<p>FileHandle is the handle for the file IF we have one; that&#x27;s for read() write() and close() -- for open() it could be -1, or whatever...<p>Mode is the mode, as previously enumerated.<p>pData is a pointer to a pre-allocated data buffer, the data to read or write, or the full filename when opening...<p>(And of course, the OS could overwrite it with text strings of any error messages that occur... if errors should occur...)<p>pDataLen is the size of that buffer in bytes.<p>When the Mode is open(), pData contains a string of the path and file to open.<p>When Mode is read(), pData is read <i>to</i>, that is, overwritten.<p>When Mode is write(), pData is used to write <i>from</i>.<p>All in all, pretty simple, pretty straightforward...<p>A <i>&quot;one syscall Linux or Unix (or Linux-like or Unix-like) operating system&quot;</i>, if you will... for simplicity and understanding!<p>(Andrew Tannenbaum would be pleased!)<p>Related: &quot;One-instruction set computer&quot; (OISC): <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;One-instruction_set_computer" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;One-instruction_set_computer</a>
评论 #39708380 未加载
评论 #39708770 未加载
评论 #39708931 未加载
xwowsersx大约 1 年前
Could someone suggest hands-on resources for learning about kernels, such as a book or series on writing your own kernel? I&#x27;d like to gain a deeper understanding of their workings and I think hands-on or project based learning would help.
评论 #39722107 未加载
pjmlp大约 1 年前
UNIX IPC is kind of missing, streams, pipes, message boxes, shared memory.<p>SUN RPC for NFS, yellow pages,...
begueradj大约 1 年前
Why a UML book is listed as a reference ?
评论 #39704114 未加载