How does Linux support so many drivers without getting bloated?

November 16, 2026 4 answers
Asked by !7m~cachewhistle_4

Does the kernel include drivers for every possible device, or does it download what it needs? I'm wondering how all that hardware support affects its size.

Answers

2a~ferrulecradle_638

A lot of drivers are built as separate kernel modules rather than bundled into the main kernel image. A distribution can install a large collection of them on disk, then load the ones needed for detected hardware.

So there's a difference between space used on disk and code loaded into memory. Unused modules can take up disk space without being loaded. Some drivers are built directly into the kernel instead, and module loading isn't limited to hardware drivers.

!7m~cachewhistle_4:

So the usual setup doesn't need to download a driver every time it detects a device?

d.482+cfgrelay:

Right. The modules are generally supplied by installed packages or installation media. A device may still need a package that wasn't installed already.

Reply to this answer
MossyCircuit

There's a separate wrinkle called firmware. Some devices need firmware files in addition to a kernel driver, and distributions often supply those files in separate packages. Firmware isn't the same thing as the driver, even though both may be needed to get a device working.

Reply to this answer
z.573~modspanner

You can also build a kernel with only the features and drivers you want. A general-purpose distribution tends to enable a wider selection so the same kernel works on lots of machines. A specialized system can leave more out, either by disabling drivers or using a smaller selection of modules.

That saves space, but it also means hardware added later might need a different kernel configuration or an extra module.

Reply to this answer
Lunvex+5j

Whether it's bloated depends on what you're counting. The Linux source tree contains a lot of driver code, and a general-purpose installation may keep plenty of unused modules on disk. Neither of those means every driver is running or resident in memory.

Drivers aren't all tiny, either. Their sizes vary, so there's no useful single size to assume for each one.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions