Task #6. Драйвер символьного устройства∗
Description∗
Implement a character device driver for text messaging between users.
References∗
- procfs demo.
- sysfs demo.
- Использование параметров при загрузке модуля.
- Модуль как драйвер. Пример реализации.
Guidance∗
Use the following names:
Your.Name- as a home directory of your projects;task06- as a directory of the current project;partXX- as a directory of the corresponding subtask (XX- subtask number);src- as a sources directory.
Implement a character device driver with the following requirements:
- 1kB buffer size;
- buffer increase as a module parameter;
- should be available for all users;
- works only ASCII strings.
Add the interfaces into the driver:
sysfsfor buffer clean up;procfsfor displaying used buffer volume and buffer size.
Implement bash script for the driver testing.
Provide a test scenario.
Extra∗
Implemented character device should be committed to GitLab repository. During implementation, please follow to code and git style.
Project Workflow
- Fork the repo.
- Clone that fork to a local repository.
- Add the repo as remote to your local clone (e.g. as
main). -
Your main branch is
main/your.name, you’ll share your solutions as MRs to this branch:- Create a branch and add commits there. Push this branch to remote:
git checkout -b branch_name # add commits here git push -u origin HEAD:branch_name - Create a merge request in GitLab web interface from
branch_namein your fork toyour.namein the repo.
- Create a branch and add commits there. Push this branch to remote:
Merge the latest changes from main/master branch
git checkout your.name
git fetch main
git merge main/master
# Resolve conflicts
git push