简体   繁体   English

没有目录为/usr/src/linux-2.x/include/asm-i386/unistd.h

[英]No directory as /usr/src/linux-2.x/include/asm-i386/unistd.h

I'm trying to build a kernel as a hobby project by following the project part given in the book Operating System Concepts by Silberschatz, Galvin and Gagne. 我正在按照Silberschatz,Galvin和Gagne的《 操作系统概念 》一书中给出的项目部分,尝试将内核构建为一个业余项目。 The book states: 该书指出:

The system call numbers for recent versions of the Linux kernel are listed in /usr/src/linux-2.x/include/asm-i386/unistd.h. /usr/src/linux-2.x/include/asm-i386/unistd.h中列出了最新版本的Linux内核的系统调用号。

But I can not find this directory. 但是我找不到这个目录。 There is no directory like linux-2.x ; 没有像linux-2.x这样的目录; all are of the form linux-3.x . 全部为linux-3.x形式。

These headers get automatically generated nowadays and the tables for that are in eg: linux-4.4.5/arch/x86/entry/syscalls/ . 这些标头如今已自动生成,其表位于例如linux-4.4.5/arch/x86/entry/syscalls/ Depending on the distribution you might need to install the kernel headers separately, eg: with Ubuntu (packet linux-headers-$VERSION . Version must fit the kernel version!). 根据发行版的不同,您可能需要单独安装内核头文件,例如:与Ubuntu(packet linux-headers-$VERSION 。版本必须适合内核版本!)。 I found them installed at /usr/src/linux-headers-3.13.0-37-generic/arch/x86/include/generated/asm/ (with Linux Mint which is based on Ubuntu) . 我发现它们安装在/usr/src/linux-headers-3.13.0-37-generic/arch/x86/include/generated/asm/ (使用基于Ubuntu的Linux Mint)。 The headers there get included from the regular unistd.h to be found (again for x86) in /usr/src/linux-headers-3.16.0-37/arch/x86/include/asm/unistd.h . 那里的标头包含在/usr/src/linux-headers-3.16.0-37/arch/x86/include/asm/unistd.h的常规unistd.h中(对于x86也是这样)。 (actual version of kernel may vary). (内核的实际版本可能有所不同)。

Last kernel with major version 2 is 2.6.39.4 from August 2011. You can try it but it won't boot on hardware more modern than an old Pentium. 自2011年8月起,主版本2的最新内核为2.6.39.4 。您可以尝试使用该内核,但不能在比旧奔腾更现代的硬件上启动。 If you have such an old machine or have a machine with enough horsepower to run a virtual Pentium machine--go for it. 如果您有这样一台旧计算机或一台具有足够功能来运行虚拟奔腾计算机的计算机,那就去吧。 But I would recommend to upgrade you book instead. 但我建议您升级您的书。

If you are wondering why you (and I) have a version 3 instead of the most recent 4.9: if your hardware runs with it, it has no grave security related bugs and you don't need any of the things in the most recent kernel, then use the one your distribution gave you, they know what they are doing (he said boldly). 如果您想知道为什么(和我)使用版本3而不是最新的4.9:如果您的硬件与之一起运行,则它没有与安全性相关的严重漏洞,并且您不需要最新内核中的任何内容,然后使用您的发行版给您的那个,他们知道他们在做什么(他大胆地说)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM