• Removing modules
  • Creating and loading a kernel module
  • Linux: This Book Includes 4 Manuscripts. The Underground Bible to the unix operating System with Tools On Security and Kali Hacking to Understand Computer Programming, Data Science and Command Line




    Download 6,34 Mb.
    Pdf ko'rish
    bet108/203
    Sana10.01.2024
    Hajmi6,34 Mb.
    #134102
    1   ...   104   105   106   107   108   109   110   111   ...   203
    Bog'liq
    Linux This Book Includes 4 Manuscripts The Underground Bible

    Inserting modules
    The presence of only three kernels leads to the need to add some more
    kernels to help enhance functionality. In the normal Linux OS, modules are
    kept in the /lib/modules//kernel/ directory, and they have a .ko extension. To
    insert a module into the kernel, one should use the insmod command. The
    user will simply type the syntax insmod .ko
    For example: # insmod /lib/ modules/ 4.4.0-21-generic /kernel/
    drivers/cpufreq /SpeedStep- lib.ko
    Removing modules
    At times, one may decide that some modules are not useful at the time.
    They will, therefore, need to remove them from the kernel. To remove the
    modules from the kernel, the user needs to use the rmmod command.
    rmmod .ko is the syntax for removal of modules. However,
    it is essential to note that a module in use by a program cannot be removed.
    For example: # rmmod /lib/ modules /4.4.0-21-generic /kernel/ drivers/
    cpufreq/ speedstep-lib.ko
    Creating and loading a kernel module
    One can be able to create and add their new kernels to their operating
    systems. Creating new kernels is a simple step process. Below are the steps
    to follow in the process of creating a kernel.


    1. Add the header lines. The general format for adding the header
    lines is as follows.
    #include
    #include
    #include
    2. The next step is to include a description of the module being
    created, the details of the author or person creating the kernel.
    The license is also essential in this section. This step helps to
    specify the module being created by giving it a name, the author,
    and license. The general format to follow under this section is as
    follows.
    MODULE_DESCRIPTION("Kernel module 2");
    MODULE_AUTHOR("Author Name");
    MODULE_LICENSE("GPL");
    3. After the above steps, the user can then compile a kernel
    module before they can load the module. The compilation of the
    module is done using two files a Kbuild file and Makefile. When
    this process is complete, the kernel is ready
    4. The final step is inserting the module. The insertion process
    involves the use of the insmod command

    Download 6,34 Mb.
    1   ...   104   105   106   107   108   109   110   111   ...   203




    Download 6,34 Mb.
    Pdf ko'rish

    Bosh sahifa
    Aloqalar

        Bosh sahifa



    Linux: This Book Includes 4 Manuscripts. The Underground Bible to the unix operating System with Tools On Security and Kali Hacking to Understand Computer Programming, Data Science and Command Line

    Download 6,34 Mb.
    Pdf ko'rish