{"id":26217025,"url":"https://github.com/franciscoraguilera/kernel-driver","last_synced_at":"2026-05-15T23:04:39.540Z","repository":{"id":281740392,"uuid":"946268291","full_name":"franciscoraguilera/kernel-driver","owner":"franciscoraguilera","description":"Linux kernel USB driver for the Apple Xserve Front Panel","archived":false,"fork":false,"pushed_at":"2025-03-10T22:05:15.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-10T23:19:50.529Z","etag":null,"topics":["apple","linux","linux-kernel","low-level-programming"],"latest_commit_sha":null,"homepage":"","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/franciscoraguilera.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":"2025-03-10T21:57:32.000Z","updated_at":"2025-03-10T22:39:17.000Z","dependencies_parsed_at":"2025-03-10T23:19:51.994Z","dependency_job_id":"4aee083c-0c77-4f5b-ac89-e035f2044bb0","html_url":"https://github.com/franciscoraguilera/kernel-driver","commit_stats":null,"previous_names":["franciscoraguilera/kernel-driver"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franciscoraguilera%2Fkernel-driver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franciscoraguilera%2Fkernel-driver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franciscoraguilera%2Fkernel-driver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franciscoraguilera%2Fkernel-driver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/franciscoraguilera","download_url":"https://codeload.github.com/franciscoraguilera/kernel-driver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243213981,"owners_count":20254902,"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":["apple","linux","linux-kernel","low-level-programming"],"created_at":"2025-03-12T12:18:36.207Z","updated_at":"2026-05-15T23:04:34.509Z","avatar_url":"https://github.com/franciscoraguilera.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Apple Xserve Front Panel USB Driver\n\nThis repository contains a Linux kernel USB driver for the Apple Xserve Front Panel. It provides support for basic bulk IN/OUT transfers, device‑specific IOCTL commands, and asynchronous event handling via an interrupt endpoint.\n\n## Overview\n\nThe driver is designed to interface with the Apple Xserve Front Panel (Vendor ID: `0x05AC`, Product ID: `0x821B`) and provides:\n- **Bulk Transfers:** Data read and write through USB bulk endpoints.\n- **Interrupt Handling:** Asynchronous event notifications via an interrupt endpoint.\n- **IOCTL Interface:** Device‑specific commands for operations such as retrieving device status and setting LED brightness.\n- **Character Device Interface:** Creation of `/dev/driver*` nodes for user-space interaction.\n\n## Features\n\n- **USB Bulk Transfers:**  \n  Read from and write to the device using bulk IN and OUT endpoints.\n\n- **Interrupt Endpoint Support:**  \n  Continuously monitors and processes asynchronous events from the device.\n\n- **Device‑Specific IOCTL Commands:**  \n  - `XSERVE_FP_IOCTL_GET_STATUS`: Retrieve the device status using a vendor-specific control message.\n  - `XSERVE_FP_IOCTL_SET_LED`: Set LED brightness (or similar hardware functionality) via a vendor-specific control message.\n\n- **Character Device Interface:**  \n  Exposes device functionality through a standard character device interface.\n\n## Requirements\n\n- **Kernel Version:** Linux Kernel 3.x or later.\n- **Development Tools:** Kernel headers, build tools, and a working Linux build environment.\n- **Hardware:** Apple Xserve Front Panel with Vendor ID `0x05AC` and Product ID `0x821B`.\n\n## Building and Installation\n\n1. **Clone the Repository:**\n\n   ```bash\n   git clone https://github.com/franciscoraguilera/driver.git\n   cd driver\n   ```\n\n2. **Build the Driver:**\n\n   Use the kernel build system to compile the module:\n\n   ```bash\n   make -C /lib/modules/$(uname -r)/build M=$(pwd) modules\n   ```\n\n3. **Insert the Module:**\n\n   Load the driver into the kernel:\n\n   ```bash\n   sudo insmod driver.ko\n   dmesg | tail -n 20  # Verify that the device was attached successfully.\n   ```\n\n4. **Create Device Nodes (if not automatically created):**\n\n   The driver registers a minor number (starting at 192) and should create `/dev/driver0`, `/dev/driver1`, etc. If needed, manually create a node:\n\n   ```bash\n   sudo mknod /dev/driver0 c 192 0\n   sudo chmod 666 /dev/driver0\n   ```\n\n## Usage\n\n### Reading Data:\n\nRead from the device using standard file operations:\n\n```bash\ncat /dev/driver0\n```\n\n### Writing Data:\n\nWrite data to the device:\n\n```bash\necho \"your data\" \u003e /dev/driver0\n```\n\n### Using IOCTL Commands:\n\nUse the provided IOCTL interface in your application to perform device‑specific operations. For example:\n\n```c\n// Example snippet in C\n#include \u003cfcntl.h\u003e\n#include \u003csys/ioctl.h\u003e\n#include \u003cstdio.h\u003e\n#include \"driver_ioctl.h\"  // Ensure this header defines XSERVE_FP_IOCTL_GET_STATUS and XSERVE_FP_IOCTL_SET_LED\n\nint main(void) {\n    int fd = open(\"/dev/driver0\", O_RDWR);\n    if (fd \u003c 0) {\n        perror(\"Failed to open device\");\n        return 1;\n    }\n\n    int status;\n    if (ioctl(fd, XSERVE_FP_IOCTL_GET_STATUS, \u0026status) \u003c 0) {\n        perror(\"ioctl GET_STATUS failed\");\n    } else {\n        printf(\"Device status: %d\\n\", status);\n    }\n\n    int led_value = 128;  // Example LED brightness value\n    if (ioctl(fd, XSERVE_FP_IOCTL_SET_LED, \u0026led_value) \u003c 0) {\n        perror(\"ioctl SET_LED failed\");\n    }\n\n    close(fd);\n    return 0;\n}\n```\n\n## Driver Structure\n\n### driver.c:\nContains the full implementation of the USB driver.\n\n#### Key Components:\n\n- **Probe/Disconnect Functions:**\n  Handle device initialization and cleanup.\n- **Bulk Transfer Handling:**\n  Implement data transfers through bulk IN and OUT endpoints.\n- **Interrupt Handling:**\n  Manage asynchronous events from the device via an interrupt endpoint.\n- **IOCTL Interface:**\n  Support device-specific commands for enhanced functionality.\n- **Character Device Registration:**\n  Automatically registers a device node under `/dev/driver*`.\n\n## Uninstallation\n\nTo remove the driver from the kernel, execute:\n\n```bash\nsudo rmmod driver\n```\n\nRemove the device node if it was manually created:\n\n```bash\nsudo rm /dev/driver0\n```\n\n## License\n\nThis project is licensed under the GNU General Public License (GPL).\n\n## Author\n\nFran (franciscoaguilera@ieee.org)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffranciscoraguilera%2Fkernel-driver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffranciscoraguilera%2Fkernel-driver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffranciscoraguilera%2Fkernel-driver/lists"}