How does the same Linux version work on different hardware












1















My understanding is that the kernel understands how to communicate with the different hardware in a system via specific device trees.



How is it that I can download one version of Ubuntu and I am able to install this on any system where the hardware may vary?



The same goes for the BeagleBone embedded boards. There is a default Debian image which can flash to any of the different type of BeagleBone boards which have different peripherals. How does it know which device tree / device tree overlay to use when the same image works for all?










share|improve this question



























    1















    My understanding is that the kernel understands how to communicate with the different hardware in a system via specific device trees.



    How is it that I can download one version of Ubuntu and I am able to install this on any system where the hardware may vary?



    The same goes for the BeagleBone embedded boards. There is a default Debian image which can flash to any of the different type of BeagleBone boards which have different peripherals. How does it know which device tree / device tree overlay to use when the same image works for all?










    share|improve this question

























      1












      1








      1








      My understanding is that the kernel understands how to communicate with the different hardware in a system via specific device trees.



      How is it that I can download one version of Ubuntu and I am able to install this on any system where the hardware may vary?



      The same goes for the BeagleBone embedded boards. There is a default Debian image which can flash to any of the different type of BeagleBone boards which have different peripherals. How does it know which device tree / device tree overlay to use when the same image works for all?










      share|improve this question














      My understanding is that the kernel understands how to communicate with the different hardware in a system via specific device trees.



      How is it that I can download one version of Ubuntu and I am able to install this on any system where the hardware may vary?



      The same goes for the BeagleBone embedded boards. There is a default Debian image which can flash to any of the different type of BeagleBone boards which have different peripherals. How does it know which device tree / device tree overlay to use when the same image works for all?







      linux ubuntu disk-image device-tree beagleboneblack






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 14 hours ago









      Engineer999Engineer999

      1266




      1266






















          2 Answers
          2






          active

          oldest

          votes


















          2














          The device drivers (i.e. the part of the kernel that interact directly with the hardware) can be compiled as kernel modules. These are separate files, which can be loaded or unloaded by the kernel, as necessary, depending on the hardware present in the system.



          The generic kernels that are shipped with mainstream Linux distributions tend to be supplied with all of the drivers for every conceivable piece of hardware compiled as modules. So, when the kernel boots up on a given system, it probes out and detects what hardware is on the system and then directs the userspace program, udev, to load whatever kernel modules are needed for the specific hardware.






          share|improve this answer
























          • Urgh! I forgot to mention udev! +1

            – Fabby
            14 hours ago











          • Thanks. I notice with Windows, when we install it, different hardware gets detected and then then the specific drivers for different hardware gets installed for use with Windows. Therefore if for example we swap the hard disk from a HP computer to a Dell computer, it probably won't work due to the wrong drivers installed. With Linux however I guess this is different?? The hardware gets detected and the device drivers get loaded on boot-up every time?

            – Engineer999
            14 hours ago






          • 1





            @Engineer999 yup unless you have very old or very new hardware that the kernel knows nothing about and then you might have to build a custom kernel.

            – Fabby
            14 hours ago













          • @Engineer999 I believe it should do. By default, all of the drivers/modules are provided, for as much hardware as possible. Except very new hardware, as Fabby mentioned.

            – Time4Tea
            14 hours ago






          • 1





            Or old obsolete hardware @Time4Tea modules do get removed too.

            – Fabby
            14 hours ago



















          2














          The Linux Kernel Map shows in some detail the device control. It contains something called "drivers" and "modules" that can be extended by "Loadable Kernel Modules".



          E.G.: USB devices generally have a module that gets loaded when the device gets attached whereas the USB root hub is statically linked into the kernel and an nVidia card need a driver downloaded from nVidia.



          That's why most distributions run on a wide variety of hardware, but not necessarily all very new hardware, which might need a separate module or a driver.



          For more information on the difference between a driver and a module have a look here



          How the kernel knows which modules to load digs deeper into the hardware layer and it does it by enumerating:




          • the PCI bus

          • the SCSI bus

          • the USB hub

          • the DSPs
            ...






          share|improve this answer

























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "106"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f495169%2fhow-does-the-same-linux-version-work-on-different-hardware%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            The device drivers (i.e. the part of the kernel that interact directly with the hardware) can be compiled as kernel modules. These are separate files, which can be loaded or unloaded by the kernel, as necessary, depending on the hardware present in the system.



            The generic kernels that are shipped with mainstream Linux distributions tend to be supplied with all of the drivers for every conceivable piece of hardware compiled as modules. So, when the kernel boots up on a given system, it probes out and detects what hardware is on the system and then directs the userspace program, udev, to load whatever kernel modules are needed for the specific hardware.






            share|improve this answer
























            • Urgh! I forgot to mention udev! +1

              – Fabby
              14 hours ago











            • Thanks. I notice with Windows, when we install it, different hardware gets detected and then then the specific drivers for different hardware gets installed for use with Windows. Therefore if for example we swap the hard disk from a HP computer to a Dell computer, it probably won't work due to the wrong drivers installed. With Linux however I guess this is different?? The hardware gets detected and the device drivers get loaded on boot-up every time?

              – Engineer999
              14 hours ago






            • 1





              @Engineer999 yup unless you have very old or very new hardware that the kernel knows nothing about and then you might have to build a custom kernel.

              – Fabby
              14 hours ago













            • @Engineer999 I believe it should do. By default, all of the drivers/modules are provided, for as much hardware as possible. Except very new hardware, as Fabby mentioned.

              – Time4Tea
              14 hours ago






            • 1





              Or old obsolete hardware @Time4Tea modules do get removed too.

              – Fabby
              14 hours ago
















            2














            The device drivers (i.e. the part of the kernel that interact directly with the hardware) can be compiled as kernel modules. These are separate files, which can be loaded or unloaded by the kernel, as necessary, depending on the hardware present in the system.



            The generic kernels that are shipped with mainstream Linux distributions tend to be supplied with all of the drivers for every conceivable piece of hardware compiled as modules. So, when the kernel boots up on a given system, it probes out and detects what hardware is on the system and then directs the userspace program, udev, to load whatever kernel modules are needed for the specific hardware.






            share|improve this answer
























            • Urgh! I forgot to mention udev! +1

              – Fabby
              14 hours ago











            • Thanks. I notice with Windows, when we install it, different hardware gets detected and then then the specific drivers for different hardware gets installed for use with Windows. Therefore if for example we swap the hard disk from a HP computer to a Dell computer, it probably won't work due to the wrong drivers installed. With Linux however I guess this is different?? The hardware gets detected and the device drivers get loaded on boot-up every time?

              – Engineer999
              14 hours ago






            • 1





              @Engineer999 yup unless you have very old or very new hardware that the kernel knows nothing about and then you might have to build a custom kernel.

              – Fabby
              14 hours ago













            • @Engineer999 I believe it should do. By default, all of the drivers/modules are provided, for as much hardware as possible. Except very new hardware, as Fabby mentioned.

              – Time4Tea
              14 hours ago






            • 1





              Or old obsolete hardware @Time4Tea modules do get removed too.

              – Fabby
              14 hours ago














            2












            2








            2







            The device drivers (i.e. the part of the kernel that interact directly with the hardware) can be compiled as kernel modules. These are separate files, which can be loaded or unloaded by the kernel, as necessary, depending on the hardware present in the system.



            The generic kernels that are shipped with mainstream Linux distributions tend to be supplied with all of the drivers for every conceivable piece of hardware compiled as modules. So, when the kernel boots up on a given system, it probes out and detects what hardware is on the system and then directs the userspace program, udev, to load whatever kernel modules are needed for the specific hardware.






            share|improve this answer













            The device drivers (i.e. the part of the kernel that interact directly with the hardware) can be compiled as kernel modules. These are separate files, which can be loaded or unloaded by the kernel, as necessary, depending on the hardware present in the system.



            The generic kernels that are shipped with mainstream Linux distributions tend to be supplied with all of the drivers for every conceivable piece of hardware compiled as modules. So, when the kernel boots up on a given system, it probes out and detects what hardware is on the system and then directs the userspace program, udev, to load whatever kernel modules are needed for the specific hardware.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 14 hours ago









            Time4TeaTime4Tea

            1,071321




            1,071321













            • Urgh! I forgot to mention udev! +1

              – Fabby
              14 hours ago











            • Thanks. I notice with Windows, when we install it, different hardware gets detected and then then the specific drivers for different hardware gets installed for use with Windows. Therefore if for example we swap the hard disk from a HP computer to a Dell computer, it probably won't work due to the wrong drivers installed. With Linux however I guess this is different?? The hardware gets detected and the device drivers get loaded on boot-up every time?

              – Engineer999
              14 hours ago






            • 1





              @Engineer999 yup unless you have very old or very new hardware that the kernel knows nothing about and then you might have to build a custom kernel.

              – Fabby
              14 hours ago













            • @Engineer999 I believe it should do. By default, all of the drivers/modules are provided, for as much hardware as possible. Except very new hardware, as Fabby mentioned.

              – Time4Tea
              14 hours ago






            • 1





              Or old obsolete hardware @Time4Tea modules do get removed too.

              – Fabby
              14 hours ago



















            • Urgh! I forgot to mention udev! +1

              – Fabby
              14 hours ago











            • Thanks. I notice with Windows, when we install it, different hardware gets detected and then then the specific drivers for different hardware gets installed for use with Windows. Therefore if for example we swap the hard disk from a HP computer to a Dell computer, it probably won't work due to the wrong drivers installed. With Linux however I guess this is different?? The hardware gets detected and the device drivers get loaded on boot-up every time?

              – Engineer999
              14 hours ago






            • 1





              @Engineer999 yup unless you have very old or very new hardware that the kernel knows nothing about and then you might have to build a custom kernel.

              – Fabby
              14 hours ago













            • @Engineer999 I believe it should do. By default, all of the drivers/modules are provided, for as much hardware as possible. Except very new hardware, as Fabby mentioned.

              – Time4Tea
              14 hours ago






            • 1





              Or old obsolete hardware @Time4Tea modules do get removed too.

              – Fabby
              14 hours ago

















            Urgh! I forgot to mention udev! +1

            – Fabby
            14 hours ago





            Urgh! I forgot to mention udev! +1

            – Fabby
            14 hours ago













            Thanks. I notice with Windows, when we install it, different hardware gets detected and then then the specific drivers for different hardware gets installed for use with Windows. Therefore if for example we swap the hard disk from a HP computer to a Dell computer, it probably won't work due to the wrong drivers installed. With Linux however I guess this is different?? The hardware gets detected and the device drivers get loaded on boot-up every time?

            – Engineer999
            14 hours ago





            Thanks. I notice with Windows, when we install it, different hardware gets detected and then then the specific drivers for different hardware gets installed for use with Windows. Therefore if for example we swap the hard disk from a HP computer to a Dell computer, it probably won't work due to the wrong drivers installed. With Linux however I guess this is different?? The hardware gets detected and the device drivers get loaded on boot-up every time?

            – Engineer999
            14 hours ago




            1




            1





            @Engineer999 yup unless you have very old or very new hardware that the kernel knows nothing about and then you might have to build a custom kernel.

            – Fabby
            14 hours ago







            @Engineer999 yup unless you have very old or very new hardware that the kernel knows nothing about and then you might have to build a custom kernel.

            – Fabby
            14 hours ago















            @Engineer999 I believe it should do. By default, all of the drivers/modules are provided, for as much hardware as possible. Except very new hardware, as Fabby mentioned.

            – Time4Tea
            14 hours ago





            @Engineer999 I believe it should do. By default, all of the drivers/modules are provided, for as much hardware as possible. Except very new hardware, as Fabby mentioned.

            – Time4Tea
            14 hours ago




            1




            1





            Or old obsolete hardware @Time4Tea modules do get removed too.

            – Fabby
            14 hours ago





            Or old obsolete hardware @Time4Tea modules do get removed too.

            – Fabby
            14 hours ago













            2














            The Linux Kernel Map shows in some detail the device control. It contains something called "drivers" and "modules" that can be extended by "Loadable Kernel Modules".



            E.G.: USB devices generally have a module that gets loaded when the device gets attached whereas the USB root hub is statically linked into the kernel and an nVidia card need a driver downloaded from nVidia.



            That's why most distributions run on a wide variety of hardware, but not necessarily all very new hardware, which might need a separate module or a driver.



            For more information on the difference between a driver and a module have a look here



            How the kernel knows which modules to load digs deeper into the hardware layer and it does it by enumerating:




            • the PCI bus

            • the SCSI bus

            • the USB hub

            • the DSPs
              ...






            share|improve this answer






























              2














              The Linux Kernel Map shows in some detail the device control. It contains something called "drivers" and "modules" that can be extended by "Loadable Kernel Modules".



              E.G.: USB devices generally have a module that gets loaded when the device gets attached whereas the USB root hub is statically linked into the kernel and an nVidia card need a driver downloaded from nVidia.



              That's why most distributions run on a wide variety of hardware, but not necessarily all very new hardware, which might need a separate module or a driver.



              For more information on the difference between a driver and a module have a look here



              How the kernel knows which modules to load digs deeper into the hardware layer and it does it by enumerating:




              • the PCI bus

              • the SCSI bus

              • the USB hub

              • the DSPs
                ...






              share|improve this answer




























                2












                2








                2







                The Linux Kernel Map shows in some detail the device control. It contains something called "drivers" and "modules" that can be extended by "Loadable Kernel Modules".



                E.G.: USB devices generally have a module that gets loaded when the device gets attached whereas the USB root hub is statically linked into the kernel and an nVidia card need a driver downloaded from nVidia.



                That's why most distributions run on a wide variety of hardware, but not necessarily all very new hardware, which might need a separate module or a driver.



                For more information on the difference between a driver and a module have a look here



                How the kernel knows which modules to load digs deeper into the hardware layer and it does it by enumerating:




                • the PCI bus

                • the SCSI bus

                • the USB hub

                • the DSPs
                  ...






                share|improve this answer















                The Linux Kernel Map shows in some detail the device control. It contains something called "drivers" and "modules" that can be extended by "Loadable Kernel Modules".



                E.G.: USB devices generally have a module that gets loaded when the device gets attached whereas the USB root hub is statically linked into the kernel and an nVidia card need a driver downloaded from nVidia.



                That's why most distributions run on a wide variety of hardware, but not necessarily all very new hardware, which might need a separate module or a driver.



                For more information on the difference between a driver and a module have a look here



                How the kernel knows which modules to load digs deeper into the hardware layer and it does it by enumerating:




                • the PCI bus

                • the SCSI bus

                • the USB hub

                • the DSPs
                  ...







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 14 hours ago

























                answered 14 hours ago









                FabbyFabby

                3,84811229




                3,84811229






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f495169%2fhow-does-the-same-linux-version-work-on-different-hardware%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Loup dans la culture

                    How to solve the problem of ntp “Unable to contact time server” from KDE?

                    Connection limited (no internet access)