{"id":25334053,"url":"https://github.com/catrinlam/device-driver","last_synced_at":"2025-04-08T08:43:54.213Z","repository":{"id":175596012,"uuid":"654182022","full_name":"catrinlam/Device-Driver","owner":"catrinlam","description":"Character device which implements a simple way of message passing","archived":false,"fork":false,"pushed_at":"2023-06-15T15:04:25.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T05:34:46.419Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/catrinlam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-15T14:55:30.000Z","updated_at":"2023-06-15T14:58:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"e6676a3d-6135-4b4f-8031-9479d6b1790f","html_url":"https://github.com/catrinlam/Device-Driver","commit_stats":null,"previous_names":["winter7eaf/device-driver","ca7rin/device-driver","catrinlam/device-driver"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catrinlam%2FDevice-Driver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catrinlam%2FDevice-Driver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catrinlam%2FDevice-Driver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catrinlam%2FDevice-Driver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/catrinlam","download_url":"https://codeload.github.com/catrinlam/Device-Driver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247807678,"owners_count":20999570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-14T05:34:09.795Z","updated_at":"2025-04-08T08:43:54.182Z","avatar_url":"https://github.com/catrinlam.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Device-Driver\n\nC - VS code, done in virtual machine\n\nNov - Dec 2022\n\n- When the module is loaded, the device is created. An empty list of messages is created as well.\n- Removing the module deallocates all messages, removes the list of messages and removes the device.\n- Reading from the device returns one message, and removes this message from the kernel list. If the list of messages is empty, the reader returns -EAGAIN.\n- Writing to the device stores the message in kernel space and adds it to the list if the message is below the maximum size, and the limit of the number of all messages stored in the kernel  wouldn't be surpassed with this message. If the message is too big, -EINVAL is returned, and if the limit of the number of all messages was surpassed, -EBUSY is returned.\n- Handle several read and write attempts concurrently\n- obtain the messages in a FIFO manner\n---\nUseful commands:\n1. \"ls -l /dev/\" check the registered device name\n2. \"sudo insmod charDeviceDriver.ko\" insert the module to kernel\n3. \"sudo rmmod charDeviceDriver.ko\" remove the kernel module\n4. \"dmesg -w \u0026\" or \"tail -f /var/log/syslog\" check the kernel log printed by \"printk()\"\n5. \"mknod /dev/chardev c \u003cmajor\u003e \u003cminor\u003e\" make a device to talk to (check syslog for this, do this before read or write to device)\n6. \"echo \u003cmessage\u003e \u003e /dev/\u003cdevicename\u003e\" send message to the device (use \"sudo su\" change to root user before execute this)\n7. \"head -n 1 \u003c /dev/\u003cdevicename\u003e\" read one message from the device(use \"sudo su\" change to root user before execute this)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatrinlam%2Fdevice-driver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcatrinlam%2Fdevice-driver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatrinlam%2Fdevice-driver/lists"}