how to redirect from stdin to dev driver
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I am writing a device driver and have implemented file_operations write
method. I would also like to be able to just redirect to the device driver, e.g.:
echo "this text is sent to driver" > /dev/driver_name
I originally assumed this would magically work with the user space message being sent to the .write
and the other parameters set accordingly. LDD3 chapter 3 has some code which is pretty similar to mine, and the authors refer to testing/playing around both by invoking the write method directly and by redirecting to the driver (as I desire to do), making me think that I am on the right track. However, when I tried redirecting to the driver, I received a "Permission denied" error and it did nothing.
Any direction/links/suggestions would be greatly appreciated.
kernel drivers kernel-modules devices
add a comment |Â
up vote
0
down vote
favorite
I am writing a device driver and have implemented file_operations write
method. I would also like to be able to just redirect to the device driver, e.g.:
echo "this text is sent to driver" > /dev/driver_name
I originally assumed this would magically work with the user space message being sent to the .write
and the other parameters set accordingly. LDD3 chapter 3 has some code which is pretty similar to mine, and the authors refer to testing/playing around both by invoking the write method directly and by redirecting to the driver (as I desire to do), making me think that I am on the right track. However, when I tried redirecting to the driver, I received a "Permission denied" error and it did nothing.
Any direction/links/suggestions would be greatly appreciated.
kernel drivers kernel-modules devices
Do you have permissions to write to the device file?
â Ignacio Vazquez-Abrams
Apr 3 at 1:23
I sudo'd the above echo line. the permissions are crw------- with root as owner.
â Jebus
Apr 3 at 1:56
You ran the echo with superuser privileges, not the shell.
â Ignacio Vazquez-Abrams
Apr 3 at 1:57
ty. How to make a driver install with different permissions?
â Jebus
Apr 3 at 2:08
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am writing a device driver and have implemented file_operations write
method. I would also like to be able to just redirect to the device driver, e.g.:
echo "this text is sent to driver" > /dev/driver_name
I originally assumed this would magically work with the user space message being sent to the .write
and the other parameters set accordingly. LDD3 chapter 3 has some code which is pretty similar to mine, and the authors refer to testing/playing around both by invoking the write method directly and by redirecting to the driver (as I desire to do), making me think that I am on the right track. However, when I tried redirecting to the driver, I received a "Permission denied" error and it did nothing.
Any direction/links/suggestions would be greatly appreciated.
kernel drivers kernel-modules devices
I am writing a device driver and have implemented file_operations write
method. I would also like to be able to just redirect to the device driver, e.g.:
echo "this text is sent to driver" > /dev/driver_name
I originally assumed this would magically work with the user space message being sent to the .write
and the other parameters set accordingly. LDD3 chapter 3 has some code which is pretty similar to mine, and the authors refer to testing/playing around both by invoking the write method directly and by redirecting to the driver (as I desire to do), making me think that I am on the right track. However, when I tried redirecting to the driver, I received a "Permission denied" error and it did nothing.
Any direction/links/suggestions would be greatly appreciated.
kernel drivers kernel-modules devices
edited Apr 3 at 0:59
asked Apr 3 at 0:47
Jebus
114
114
Do you have permissions to write to the device file?
â Ignacio Vazquez-Abrams
Apr 3 at 1:23
I sudo'd the above echo line. the permissions are crw------- with root as owner.
â Jebus
Apr 3 at 1:56
You ran the echo with superuser privileges, not the shell.
â Ignacio Vazquez-Abrams
Apr 3 at 1:57
ty. How to make a driver install with different permissions?
â Jebus
Apr 3 at 2:08
add a comment |Â
Do you have permissions to write to the device file?
â Ignacio Vazquez-Abrams
Apr 3 at 1:23
I sudo'd the above echo line. the permissions are crw------- with root as owner.
â Jebus
Apr 3 at 1:56
You ran the echo with superuser privileges, not the shell.
â Ignacio Vazquez-Abrams
Apr 3 at 1:57
ty. How to make a driver install with different permissions?
â Jebus
Apr 3 at 2:08
Do you have permissions to write to the device file?
â Ignacio Vazquez-Abrams
Apr 3 at 1:23
Do you have permissions to write to the device file?
â Ignacio Vazquez-Abrams
Apr 3 at 1:23
I sudo'd the above echo line. the permissions are crw------- with root as owner.
â Jebus
Apr 3 at 1:56
I sudo'd the above echo line. the permissions are crw------- with root as owner.
â Jebus
Apr 3 at 1:56
You ran the echo with superuser privileges, not the shell.
â Ignacio Vazquez-Abrams
Apr 3 at 1:57
You ran the echo with superuser privileges, not the shell.
â Ignacio Vazquez-Abrams
Apr 3 at 1:57
ty. How to make a driver install with different permissions?
â Jebus
Apr 3 at 2:08
ty. How to make a driver install with different permissions?
â Jebus
Apr 3 at 2:08
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%2f435165%2fhow-to-redirect-from-stdin-to-dev-driver%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
Do you have permissions to write to the device file?
â Ignacio Vazquez-Abrams
Apr 3 at 1:23
I sudo'd the above echo line. the permissions are crw------- with root as owner.
â Jebus
Apr 3 at 1:56
You ran the echo with superuser privileges, not the shell.
â Ignacio Vazquez-Abrams
Apr 3 at 1:57
ty. How to make a driver install with different permissions?
â Jebus
Apr 3 at 2:08