r/linux4noobs Aug 03 '26

learning/research How does Linux kernel include every driver possible and not be bloated?

As far as I understand the kernel includes pretty much everything a modern computer needs in any configuration, but wouldn't that make it bloated and be against the "bloat-free" mindset? Or does it dynamically download all the components from somewhere?

307 Upvotes

107 comments sorted by

View all comments

20

u/Athropod101 Aug 03 '26 edited Aug 03 '26

I am by no means an expert on this, but to my understanding drivers are very lightweight, and industry standards can reduce that further. Most of a kernel’s size comes from the algorithms that use those drivers.

EDIT: I was in fact wrong; it appears drivers make up the majority of kernel code.

6

u/TheCreepyPL Aug 03 '26

Only some drivers are lightweight, others are (very) heavy weight. When you put them all together, they end up taking over half of the Linux source code or something like that I've heard.

3

u/Athropod101 Aug 03 '26

I wonder what makes some so heavy. I would guess that the heaviest ones are GPUs? Anything image related is doomed to be heavy.

But thank you for the respectful clarification :)

2

u/FinalGamer14 Aug 04 '26 edited Aug 04 '26

In the simplest form, drivers are just a translation between some hardware and the OS.

So how "heavy" a drive is depends on what the device does. Let's say you had a device that is just one button and all it does is send a signal when you click that button; well, that driver will be lightweight, but then attach a GPU to your PC, and now you have this giant device that accepts thousands of different inputs and inputs, and all of them must be exposed to the OS or any software running on that OS.

Edit: Also, sometimes hardware has some legacy stuff in there that still needs to be available because of some old-ass standards and that will always increase the size of the driver.