-1

I am trying to understand the linux kernel and there is one thing that is puzzling me for quite a while. As linux is used across variety of platforms (like smartphones,desktop,supercomputers etc) and also on various architectures, so does the same kernel code is used by all or a different one and also since it includes some assembly codes so it must be architecture specific.

so do the developers in linux community apply patches to a single kernel or there are multiple versions of kernel each for different architecture and platforms?

  • Sharing your research helps everyone. Tell us what you've tried and why it didn’t meet your needs. This demonstrates that you’ve taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer. Also see How to Ask – gnat Dec 2 '13 at 8:12
  • 1
    The kernel source code is one big integrated repository. When compiling a kernel, you specify which architecture it's for, and various bits of code for hardware-specific tasks get included and excluded. That includes all of the inline assembly code, of course. – Kilian Foth Dec 2 '13 at 8:42
  • You could just look at the source code to see how it's done – James Dec 2 '13 at 22:24
4

Actually, the assembly parts and the other architecture specific parts are pretty small.

Very little code is actually assembly, mostly parts dealing with the very early booting process.

A little bit more code is platform-specific code, but it's still relatively little compared to the huge majority of code that's pretty platform-independent.

General framework, schedulers, most drivers and many other parts are platform-independent C code that just use the thin platform-dependent layer to actually access the hardware.

So there is a single Linux git repository that holds the code for (almost) architectures that Linux runs on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.