How to recompile and run a prebuilt linux kernel driver as a custom module?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I am able to create a custom basic module (hello wrold kernel) and use insmod to load it into kernel space. However what I need now is to be able to use slip.c code by its entirety (copy and paste) into my own module and compile and run effectively. This way, the new module with slip sourcecode compiles, successfully insterted into kernel space by insmod, but, does not function as it should: running sudo slattach -p my_slip_replica -s 115200 /dev/ttyUSB0 -m & retruns with the error Hardware type my_slip_replica not supported. [1]+ Exit 1. By default, the linux kernel has slip.ko object file already compiled at /lib/modules/4.15.0-29-generic/kernel/drivers/net/slip and modprobe slip loads the module and indeed functions with no problems at all.



So my question is, how can I replicate slip.c (plus slip.h and possible a few more files) and run successfully?










share|improve this question

























    up vote
    1
    down vote

    favorite












    I am able to create a custom basic module (hello wrold kernel) and use insmod to load it into kernel space. However what I need now is to be able to use slip.c code by its entirety (copy and paste) into my own module and compile and run effectively. This way, the new module with slip sourcecode compiles, successfully insterted into kernel space by insmod, but, does not function as it should: running sudo slattach -p my_slip_replica -s 115200 /dev/ttyUSB0 -m & retruns with the error Hardware type my_slip_replica not supported. [1]+ Exit 1. By default, the linux kernel has slip.ko object file already compiled at /lib/modules/4.15.0-29-generic/kernel/drivers/net/slip and modprobe slip loads the module and indeed functions with no problems at all.



    So my question is, how can I replicate slip.c (plus slip.h and possible a few more files) and run successfully?










    share|improve this question























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I am able to create a custom basic module (hello wrold kernel) and use insmod to load it into kernel space. However what I need now is to be able to use slip.c code by its entirety (copy and paste) into my own module and compile and run effectively. This way, the new module with slip sourcecode compiles, successfully insterted into kernel space by insmod, but, does not function as it should: running sudo slattach -p my_slip_replica -s 115200 /dev/ttyUSB0 -m & retruns with the error Hardware type my_slip_replica not supported. [1]+ Exit 1. By default, the linux kernel has slip.ko object file already compiled at /lib/modules/4.15.0-29-generic/kernel/drivers/net/slip and modprobe slip loads the module and indeed functions with no problems at all.



      So my question is, how can I replicate slip.c (plus slip.h and possible a few more files) and run successfully?










      share|improve this question













      I am able to create a custom basic module (hello wrold kernel) and use insmod to load it into kernel space. However what I need now is to be able to use slip.c code by its entirety (copy and paste) into my own module and compile and run effectively. This way, the new module with slip sourcecode compiles, successfully insterted into kernel space by insmod, but, does not function as it should: running sudo slattach -p my_slip_replica -s 115200 /dev/ttyUSB0 -m & retruns with the error Hardware type my_slip_replica not supported. [1]+ Exit 1. By default, the linux kernel has slip.ko object file already compiled at /lib/modules/4.15.0-29-generic/kernel/drivers/net/slip and modprobe slip loads the module and indeed functions with no problems at all.



      So my question is, how can I replicate slip.c (plus slip.h and possible a few more files) and run successfully?







      linux linux-kernel drivers kernel-modules serial-port






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 13 at 8:41









      Ams

      112




      112

























          active

          oldest

          votes











          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',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          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%2f462247%2fhow-to-recompile-and-run-a-prebuilt-linux-kernel-driver-as-a-custom-module%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f462247%2fhow-to-recompile-and-run-a-prebuilt-linux-kernel-driver-as-a-custom-module%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          Peggy Mitchell

          Palaiologos

          The Forum (Inglewood, California)