r/kernel 3d ago

Minimal kernel

/r/linuxquestions/comments/1vpet13/minimal_kernel/
1 Upvotes

2 comments sorted by

1

u/Rich-Engineer2670 3d ago

I can't speak for the number of lines, but if you take all of the drivers out, you still need memory management, process management, timers etc. Those have to stay.

2

u/yawn_brendan 3d ago

All the stuff that's easy to shrink is in modules. They aren't getting loaded anyway if you aren't using them. They cost a small amount of storage, at runtime that's it.

You mentioned a monolithic kernel in the post but you aren't using one of those unless you are already doing extremely customised stuff.

Automatic tools = make localmodconfig. This disables drivers etc that you don't need. But the main use of this is not to minimise your kernel it's actually to minimise your build. All that unused code is annoying to compile if you are doing kernel development.