0

When I am compiling a Linux kernel, the amount of drivers and modules I compile is definitely affecting the size of produced binary. But does it also affect the size of kernel when it loads into memory?

I mean, when I compile drivers that I don't need for my hardware, will the kernel just ignore them, or are they also loaded in RAM?

TL;DR :
I compile kernel A containing ONLY drivers that I need;
Kernel B containing drivers I need + extra drivers I don't.
Will kernel B eat more memory than kernel A?

4

1 回答 1

2
  1. 作为 Linux 内核映像的一部分构建的任何驱动程序都会在引导期间加载到主内存中,并且无论是否使用它都会继续消耗主内存。

  2. 作为单独模块构建的驱动程序,即.ko文件可以根据需要单独加载。除非它们被加载,否则它们不会消耗任何主内存。

于 2013-08-02T08:16:05.977 回答