Ubuntu 16.04 上的 Linux Kernel v2.6.34 编译错误

Ubuntu 16.04 上的 Linux Kernel v2.6.34 编译错误

我是内核开发新手。我正在尝试安装Linux 内核 v2.6.34在 Ubuntu 16.04 上,因为大多数书籍都解释了这个版本,所以我认为这是一个很好的开始。我的最终目标是理解和修改内存管理(特别是在最新的内核中)。在编译过程中,我遇到了以下错误。

/home/irfan/kernel/linux-2.6.34/arch/x86/include/asm/percpu.h:204:33: note: in expansion of macro ‘percpu_to_op’
 #define percpu_write(var, val)  percpu_to_op("mov", var, val)
                                 ^
/home/irfan/kernel/linux-2.6.34/arch/x86/include/asm/irq_regs.h:26:2: note: in expansion of macro ‘percpu_write’
  percpu_write(irq_regs, new_regs);
  ^
arch/x86/kernel/quirks.c: In function ‘ich_force_enable_hpet’:
arch/x86/kernel/quirks.c:98:2: warning: parameter names (without types) in function declaration
  u32 uninitialized_var(rcba);
  ^
arch/x86/kernel/quirks.c:104:36: error: ‘rcba’ undeclared (first use in this function)
  pci_read_config_dword(dev, 0xF0, &rcba);
                                    ^
arch/x86/kernel/quirks.c:104:36: note: each undeclared identifier is reported only once for each function it appears in
arch/x86/kernel/quirks.c: In function ‘old_ich_force_hpet_resume’:
arch/x86/kernel/quirks.c:188:2: warning: parameter names (without types) in function declaration
  u32 uninitialized_var(gen_cntl);
  ^
arch/x86/kernel/quirks.c:193:43: error: ‘gen_cntl’ undeclared (first use in this function)
  pci_read_config_dword(cached_dev, 0xD0, &gen_cntl);
                                           ^
arch/x86/kernel/quirks.c: In function ‘old_ich_force_enable_hpet’:
arch/x86/kernel/quirks.c:210:2: warning: parameter names (without types) in function declaration
  u32 uninitialized_var(gen_cntl);
  ^
arch/x86/kernel/quirks.c:215:36: error: ‘gen_cntl’ undeclared (first use in this function)
  pci_read_config_dword(dev, 0xD0, &gen_cntl);
                                    ^
arch/x86/kernel/quirks.c: In function ‘vt8237_force_enable_hpet’:
arch/x86/kernel/quirks.c:301:2: warning: parameter names (without types) in function declaration
  u32 uninitialized_var(val);
  ^
arch/x86/kernel/quirks.c:311:36: error: ‘val’ undeclared (first use in this function)
  pci_read_config_dword(dev, 0x68, &val);
                                    ^
arch/x86/kernel/quirks.c: In function ‘nvidia_force_enable_hpet’:
arch/x86/kernel/quirks.c:426:2: warning: parameter names (without types) in function declaration
  u32 uninitialized_var(val);
  ^
arch/x86/kernel/quirks.c:437:36: error: ‘val’ undeclared (first use in this function)
  pci_read_config_dword(dev, 0x44, &val);
                                    ^
scripts/Makefile.build:230: recipe for target 'arch/x86/kernel/quirks.o' failed
make[2]: *** [arch/x86/kernel/quirks.o] Error 1
scripts/Makefile.build:366: recipe for target 'arch/x86/kernel' failed
make[1]: *** [arch/x86/kernel] Error 2
Makefile:884: recipe for target 'arch/x86' failed
make: *** [arch/x86] Error 2

我尝试过,但没有成功,也没有找到有关此错误的任何资料/帮助。

答案1

你正在读的书已经过时了。Ubuntu 16.04 附带内核 4.4。低于此版本的任何版本都太旧了,无法在现代发行版上构建。转到https://www.kernel.org/了解 Linux 内核的长期版本,并寻找与时俱进的书籍。更不用说 16.04 也有 3 年的历史了。你应该至少考虑当前的 LTS 版本。

相关内容