Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(12)
我向您推荐 BSD 内核! BSD 内核的黑客要少得多,因此跟随其演变更容易。 BSD 和 Linux 内核都有出色的黑客,但有些人认为 BSD 较低的名气会过滤掉新手。 当源代码每天不更新 100 次时,做出设计决策也会更容易。
在 BSD 选择中,我最喜欢的是 NetBSD。 它可能不是您想要的台式机的无痛选择,但由于它非常注重便携性,因此质量相当不错。 我认为这部分说明了一切:
如果您已经工作了足够长的时间,您就会知道 NetBSD 对于学习良好的编码来说是一种相当大的乐趣。 尽管在专业上你会发现 Linux 有更多的机会,但
无论你采取哪种选择,开始加入他们的邮件列表,关注讨论。 研究一些补丁,最后尝试自己修复错误。 关于书籍,请搜索 Diomidis Spinellis 文章和他的书。 它不完全是一本内核书籍,但有 NetBSD 示例,对处理大型软件有很大帮助。
I recommend you the BSD kernels! BSD kernels have far fewer hackers so following their evolution is easier. Either BSD and Linux kernels have great hackers, but some people argue that BSD lower fame filters out novice ones. Also taking design decisions is easier when the sources are not being updated 100 times a day.
Among the BSD choices, my favorite one is NetBSD. It might not be the pain-free choice you want for your desktop, but because it has a strong focus on portability, the quality is quite good. I think this part say it all:
If you have been working long enough, you will know that NetBSD is a quite joy for learning good coding. Although professionally you will find more chances with Linux
Whichever choice you take, start joining their mail lists, follow the discussions. Study some patches and finally try to do your own bug-fixing. Regarding books, search for Diomidis Spinellis articles and his book. It is not exactly a kernel book, but has NetBSD examples and helps a lot to tackle large software.
注意到这里缺乏 BSD,我想我应该加入:
我自己没有参加任何课程,但我在其他场合听过 Marshall Kirk McKusick 的演讲,他真的很擅长他所做的事情。
当然还有 BSD 手册页,它们是极好的资源,因为它们的维护程度比一般的 Linux 手册页要大得多。 以 uvm(9) 手册页为例,描述了OpenBSD 中的虚拟内存接口。
不太相关,但我也会推荐视频伯克利软件发行版的历史因为它很好地介绍了 UNIX 历史和文化的 BSD 部分,以及当时的许多搞笑轶事。
Noting the lack of BSDs here, I figured I'd chip in:
I haven't taken any of the courses myself, but I've heard Marshall Kirk McKusick speak on other occasions, and he is really good at what he does.
And of course the BSD man pages, which are an excellent resource as they are maintained to a far greater extent than your average Linux man-page. Take for instance the uvm(9) man-page, describing the virtual memory interface in OpenBSD.
Not quite related, but I'll also recommend the video History of the Berkeley Software Distributions as it gives a nice introduction to the BSD parts of the UNIX history and culture as well as plenty of hilarious anectodes from back when.
当我在大学时,我花了一个学期的时间学习操作系统,作为其中的一部分,我们必须在 Linux 中实现基于 RAM 的文件系统。
这是了解 Linux 内核的内部结构并掌握所有内容如何组合在一起的绝佳方式 - 并且了解它如何与标准工具交互也非常有趣。
When I was at uni I spent a semester studying operating systems, and as part of this had an assignment where we had to implement a RAM-based filesystem in Linux.
It was a fantastic way to get to understand the internals of the Linux keurnel and to get a grasp on how everything fits together - And a heck of a lot of fun playing around with how it interacts with standard tools too.
Linux 和 Minix 学起来很有趣。 如果您还想了解现代微内核操作系统是什么样子,您可以看看 QNX。 完整的文档可以在线获取,并且非常容易访问。 例如,这本在线书籍。
Linux and Minix are fun to learn. If you also want to learn how a modern micro-kernel operating system looks like, you can look at QNX. The complete documentation is available online and it is very accessible. For example, this online book.
似乎没有人提到代码明智的 BSD 更干净、更一致。 文档也更好(正如已经提到的)。 但由于无论您选择什么系统,都会有很多摆弄的情况 - 我会选择您更经常使用的系统。
Nobody seems to have mentioned that code-wise BSD is much cleaner and more consistent. The documentation's way better too (as already mentioned). But since there's a whole lot of fiddling with whatever system you choose - I'd pick the one you use more often.
采纳 Mike Stone 的建议并从 Minix 开始。 这就是莱纳斯所做的! 这本教科书写得非常好,Tannenbaum 很好地展示了如何在真实系统中实现各种功能。
Take Mike Stone's advice and start with Minix. That's what Linus did! The textbook is really well written, and Tannenbaum does a great job of showing how the various features are implemented in a real system.
没有什么可以替代深入研究代码。 尝试找到您感兴趣的驱动程序或子系统并进行研究。 使用 VMware Workstation 等工具,可以非常轻松地进行任何您想要的更改、快照虚拟机并运行修改后的内核。 如果内核在启动时出现恐慌,谁在乎呢? 只需跳回快照并解决问题即可。
对于书籍,我强烈推荐 Robert Love 的 Linux Kernel Development。 这是一本写得很精彩的书——信息量大、组织合理、幽默……一点也不枯燥。
There's no substitute for diving into the code. Try to find a driver or subsystem that you're interested in and poke around with it. With tools like VMware Workstation it's super easy to make whatever changes you want, snapshot the VM, and run your modified kernel. If the kernel panics on boot, who cares? Just jump back to the snapshot and fix the problem.
For books, I strongly recommend Linux Kernel Development by Robert Love. It's a wonderfully written book -- lots of information, organized sanely, and humorous... not dry reading at all.
除了已经提到的好书(操作系统设计与实现特别好)之外,获取 1.x 版本的 Linux 内核,将其加载到 VMWare 或 VirtualBox 中并从那里开始使用。
您将需要花费大量时间浏览源代码。 为此,请查看 http://lxr.linux.no/ 这是源代码的可浏览链接版本并使生活变得更加轻松。 对于 Linux 的第一个版本 (0.01),请查看 http://lxr.linux。否/linux-old+v0.01/。 乐趣始于 http://lxr.linux.no/linux -old+v0.01/boot/boot.s。 当您从一个版本升级到另一个版本时,请查看变更日志并深入研究那些已更改的部分,以免您再次重新阅读整个内容。
一旦您掌握了这些概念,请查看 2.0,然后查看 2.2,等等。准备好在这个过程中投入大量时间。
Aside from the good books already mentioned (Opeating System Design & Implementation is particularly good), get a hold of a 1.x release Linux Kernel, load it into VMWare or VirtualBox and start playing around from there.
You will need to spend a lot of time browsing source code. For this, check out http://lxr.linux.no/ which is a browsable linked version of the source and makes life a lot easier. For the very first version of Linux (0.01) check out http://lxr.linux.no/linux-old+v0.01/. The fun begins at http://lxr.linux.no/linux-old+v0.01/boot/boot.s. As you progress from version to version, check out the ChangeLog and dig into those parts that have changed to save you re-reading the whole thing again.
Once you've gotten a hold of the concepts, look at 2.0, then 2.2, etc. Be prepared to sink A LOT of time into the process.
设备驱动程序
我之前出于同样的目的通过推荐购买了这些书籍,但我从未研究过它们我自己所以只把它们作为二手建议。
Device Drivers
I had previously bought these books on recommendation for the same purpose but I never got to studying them myself so only take them as second-hand advice.
我自己还没有尝试过,但是您可以转到 Linux From Scratch 并开始构建您自己的 Linux 发行版。 听起来像是需要大量时间的事情,但会让你深入了解 Linux 内核的内部结构以及每个部分的工作原理。 当然,您可以按照此处的任何其他提示来补充此学习内容。
I haven't tried it myself, but you can go to Linux From Scratch and start building your own Linux distribution. Sounds like something that'll take a junkload of time, but will result in an intimate knowledge of the guts of the Linux kernel and how each part works. Of course, you can supplement this learning by following any of the other tips here.
作为一名 Linux 用户,我想说 Linux 有一个很棒的社区供人们了解内核。 http://kernelnewbies.org 是开始提出问题和了解内核工作原理的好地方。 我无法推荐一本书,但是一旦您阅读了 kernelnewbies 的起始材料,源代码就有了很好的记录。
As a Linux user I'd say Linux has a great community for people to learn about the kernel. http://kernelnewbies.org is a great place to start asking questions and learning about how the kernel works. I can't make a book reccomendation, but once you've read the starting material on kernelnewbies the source is very well documented.
在大学里,我上了一堂操作系统课,我们使用了Tanenbaum 的书。 在课堂上,我们在Minix操作系统中实现了一个设备驱动程序。 这很有趣,我们学到了很多东西。
但需要注意的一件事是,如果您选择 Minix,它是为学习而设计的。 它是一个微内核,而 Linux 和 BSD 是一个整体内核,所以你学到的东西可能不能 100% 翻译成能够在 Linux 或 BSD 上工作,但你仍然可以从中获益匪浅,而不必费力去处理。尽可能多的信息。
顺便说一句,如果您读过只是为了好玩,Linus 实际上是在编写 Linux 之前,他曾尝试过 Minix,但这还不足以实现他的目的。
In college, I had an operating systems class where we used a book by Tanenbaum. In the class, we implemented a device driver in the Minix operating system. It was a lot of fun, and we learned a lot.
One thing to note though, if you pick Minix, it is designed for learning. It is a microkernel, while Linux and BSD are a monolithic kernel, so what you learn may not be 100% translatable to be able to work with Linux or BSD, but you can still gain a lot out of it, without having to process quite as much information.
As a side note, if you've read Just for Fun, Linus actually was playing with Minix before he wrote Linux, but it just wasn't enough for his purposes.