Skip to content

Clarify write usage in comment for /dev/chardev #326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 27, 2025

Conversation

minhsun-c
Copy link

@minhsun-c minhsun-c commented Jul 27, 2025

The original comment referred to /dev/hello, but the actual device created by the module is /dev/chardev.

In addition, writing to /dev/chardev using output redirection (>) typically fails due to insufficient permissions, since redirection is handled by the shell before sudo applies. As a result, the device_write() function may never be entered.

This change updates the comment to recommend using a pipe with sudo tee, which correctly elevates privileges and allows the write operation to reach the driver.

Summary by Bito

This pull request clarifies the write operation for the /dev/chardev device by correcting the previous comment that referenced /dev/hello. It now includes guidance on using a pipe with `sudo tee` to address permission issues during output redirection.

The original comment referred to /dev/hello, but the actual device
created by the module is /dev/chardev.

In addition, writing to /dev/chardev using output redirection (>)
typically fails due to insufficient permissions, since redirection is
handled by the shell before sudo applies. As a result, the
device_write() function may never be entered.

This change updates the comment to recommend using a pipe with
`sudo tee`, which correctly elevates privileges and allows the write
operation to reach the driver.
@jserv jserv merged commit 7a9112b into sysprog21:master Jul 27, 2025
1 check passed
@jserv
Copy link
Contributor

jserv commented Jul 27, 2025

Thank @minhsun-c for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants