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

Clash 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?
linux linux-kernel drivers kernel-modules serial-port
add a comment |Â
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?
linux linux-kernel drivers kernel-modules serial-port
add a comment |Â
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?
linux linux-kernel drivers kernel-modules serial-port
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
linux linux-kernel drivers kernel-modules serial-port
asked Aug 13 at 8:41
Ams
112
112
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password