对于初学者内核开发来说,什么是好的准系统 Linux 发行版?
在我的操作系统课程中,我们希望使用我们自己的一些简单的 C 系统调用来修改 Linux 内核。
适合此目的的好的发行版是什么? 我们不需要任何装饰,不需要 GUI,普通内核等。越基本越好。
In my Operating Systems class we are looking to modify a Linux kernel with some simple system calls of our own in C.
What would be a good distro suited for this purpose? We don't need any frills, no GUI, a vanilla kernel, etc. The more basic the better.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(11)
我能够使用最小化的 Gentoo 安装非常轻松地修改内核。
只需安装gentoo,按照安装说明进行操作,然后:
I was able to modify the kernel pretty easily using a minimal Gentoo install.
Just install gentoo, follow the installation instructions, then:
在我上学期的操作系统课程中,我们使用了 用户模式 Linux,这是最大的优势因为当您对系统进行冲洗时,您可以简单地终止该进程,而不会对主机环境造成任何风险。
无论您使用什么内核,添加/修改系统调用都是乏味但微不足道的。 然而,2.6 内核更加庞大和复杂,因此如果您要以重大方式修改代码,旧内核更容易使用并且有更好的文档记录。 (即:更容易找到书籍和参考资料)
快乐黑客:)
In my operating systems course last semester we used User Mode Linux, the big advantage being that when you hose the system, you can simply kill the process with no risk to the host environment.
Adding/Modifying system calls is tedious but trivial regardless of the kernel you use. However the 2.6 kernel is significantly more massive and complex, so if you're going to be modifying the code in a significant way the older kernels are easier to work with and much better documented. (ie: easier to find books and references)
Happy hacking :)
archlinux++
但实际上..gentoo、slack 和 arch 或多或少都是不错的选择
archlinux++
but really.. gentoo, slack, and arch are all more-or-less good choices
Arch Linux 为内核开发提供了一个很棒的平台,而且功能也非常强大。 如果您学习使用 pacman,它实际上会使测试您的内核修改变得非常容易,并以合理的方式提供源代码和工具。
我确实认为,如果您认真学习 Linux 和内核破解,那么从头开始安装 Linux 应该在您的列表中。 这是一本很棒的发行版/书籍,可以让您自己构建开发平台。
Arch Linux provides a great platform for kernel development that is also very functional. If you learn to use pacman, it will actually make testing your kernel modifications quite easily and provides the sources and tools in a sane manner.
I do think that if you are serious about learning linux and kernel hacking, doing a Linux From Scratch install should be on your list. It's a great distro/book and will let you build the platform for development yourself.
在所有发行版上,您可以安装 vanilla kernel.org 源代码,而不是与发行版相关的内核包,当您想要进行内核开发时,这可能是一个好主意。
然而,当您想要使用任何带有非 2.6 内核的最新发行版时,您就会遇到麻烦,因为它们通常以无法在 2.4 上运行的方式构建 libc6。 此外,许多硬件管理的核心(如 udev)需要相当新的内核。
除此之外,使用 Debian 为您提供了一个准系统,并且使用 内核包。
On all distributions, you can install the vanilla kernel.org sources instead of the distribution-related kernel packages, which is probably a good idea anyway when you want to do kernel development.
However, you'll be in trouble when you want to use any recent distribution with non-2.6 kernels, because they often build libc6 in a way that it cannot run with 2.4. Additionally, a lot of the guts of hardware management (like udev) require fairly recent kernels.
Apart from that, using Debian gives you a barebone system, and installing your own kernels is a breeze with kernel-package.
我不一定会说任何特定的发行版都适合内核开发,但如果您想要一个传统的 Linux 发行版,并且不会在您和内核之间堆积太多自定义配置内容,那么 Slackware 是一个不错的选择。
I wouldn't necessarily say any particular distro is geared towards kernel development as such, but if you want a traditional Linux distro that doesn't pile too much custom configuration stuff between you and the kernel, Slackware is a decent choice.
我的建议是获取最新的内核。 与旧内核相比,它内部将有更多的调试功能。 此外,对于新手来说,较旧的内核看起来几乎与最新的内核一样复杂。
至于发行版本身,你不会真的出错。 如果您只想尝试一些自定义系统调用,那么请使用任何能为您提供良好开发环境的主流发行版。 然后编译并尝试您的自定义 glibc,而无需将其安装在发行版上。
My suggestion is to grab the latest kernel. There will be more debugging features inside it than in an older kernel. Also, older kernels would pretty much look just as complex as the most recent to the newbie.
As for the distribution itself, you can't really go wrong. If all you want is to try some custom system calls, then grab whatever mainstream distribution which gives you a nice development environment. Then compile and try your customized glibc without installing it over the distro's.
在选择用于内核开发的发行版时,请记住您要破解的是内核,而不是发行版本身。 因此,您会想要一个简单的发行版,尽可能不妨碍您。 Ubuntu 说得很好。
伊纳赫
When choosing a distro for kernel development, remember that it's the kernel you want to hack, not the distro itself. You will therefor want an easy distro that stays out of your way as much as possible. Ubuntu says out of the way fairly nicely.
IANAKH
非 Linux 替代方案是 Geek OS,但这主要针对教育级别,并且不是实用的内核。 但它非常简单。
A non-linux alternative is Geek OS, but this is very much aimed at the educational level, and is not a practical kernel. It is ultra-simple though.
好吧,我发现一个叫做“minix”的软件,它并不是真正的 Linux 发行版,而是专门为教学而制作的,但如果你只能使用 Linux 发行版,那么没关系,我很确定所有发行版都有相同的内核
well I have found one called "minix" it isn't really a linux distro, but it was made specifically for teaching, but if you can only use a linux distro, then it shouldn't matter, I am pretty sure all distros have the same kernel
Gentoo 如果你不介意自动编译(大多数人认为gentoo 是Linux From Scratch => 你必须自己做所有事情)。
如果您的计算机速度较慢(笔记本电脑),请使用 Arch。
这两者的最大优点是它们有非常非常好的文档,并且只需安装 Gentoo fe 即可让您了解有关 init 系统以及必须运行哪些服务的基本知识。 如果从指南中复制和粘贴命令,它就毫无价值了(幸运的是,手册让人们思考一下,从而防止孩子们安装gentoo并接管我们整洁的#irc):D
Gentoo if you dont mind automated compilation (most people think that gentoo is Linux From Scratch => you have to do everything on your own).
Arch if you have slower computer (laptop).
Biggest advantage of these two is that they have very very good documentation and only installing Gentoo f.e. gives you basic knowledge about init system and what services has to run. If one copy&paste commands from guide it's worthless though (luckily handbook makes people think a bit, thus preventing kids from installing gentoo and taking over our neat #irc) :D