{"id":24468926,"url":"https://github.com/ivan-guerra/linux_device_drivers","last_synced_at":"2026-04-29T09:31:38.537Z","repository":{"id":65525583,"uuid":"523590605","full_name":"ivan-guerra/linux_device_drivers","owner":"ivan-guerra","description":"A containerized Linux dev environment with working LDD3 modules","archived":false,"fork":false,"pushed_at":"2023-03-23T07:40:26.000Z","size":98,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-09T09:42:21.119Z","etag":null,"topics":["linux","linux-device-drivers","linux-kernel"],"latest_commit_sha":null,"homepage":"https://programmador.com/posts/2022/linux-device-drivers/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ivan-guerra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2022-08-11T04:57:43.000Z","updated_at":"2024-07-07T02:32:30.000Z","dependencies_parsed_at":"2025-06-09T09:46:19.325Z","dependency_job_id":null,"html_url":"https://github.com/ivan-guerra/linux_device_drivers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ivan-guerra/linux_device_drivers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivan-guerra%2Flinux_device_drivers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivan-guerra%2Flinux_device_drivers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivan-guerra%2Flinux_device_drivers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivan-guerra%2Flinux_device_drivers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ivan-guerra","download_url":"https://codeload.github.com/ivan-guerra/linux_device_drivers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivan-guerra%2Flinux_device_drivers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32419799,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T06:29:02.080Z","status":"ssl_error","status_checked_at":"2026-04-29T06:29:00.631Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["linux","linux-device-drivers","linux-kernel"],"created_at":"2025-01-21T07:13:31.802Z","updated_at":"2026-04-29T09:31:38.522Z","avatar_url":"https://github.com/ivan-guerra.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Linux Device Drivers 3rd Edition\n\nThis project contains a subset of the example modules introduced throughout the\n[Linux Device Drivers 3rd edition](https://lwn.net/Kernel/LDD3/) text.\nLDD3 examples are meant to be compatible with Linux Kernel v2.6. This project\nuses kernel v5.19. Modernized sources for the modules found in Chapters 1-12\nare provided.\n\nIncluded with the project is a set of Docker containers that can be used to\n\n* Build a custom initramfs\n* Configure and build the Linux kernel\n* Build out-of-tree kernel modules\n\nThe containers create the initramfs and kernel bzImage that can be handed off\nto the QEMU emulator. From within the emulator, we can load/unload our custom\nmodules and experiment with LDD3's in memory \"devices\" from the safety of a\nsandboxed environment.\n\n### Checking Out the Project\n\nThis project includes the `linux-next` branch for kernel v5.19 as a submodule.\nThere's a lot of code and a lot of git history that comes along with the\n`linux-next` submodule. To speed up the checkout process and save space on your\nPC, you may want to follow these steps when cloning the repo:\n```\n$ git clone git@github.com:ivan-guerra/linux_device_drivers.git\n$ cd linux_device_drivers\n$ git submodule init\n$ git submodule update --depth 1\n```\nYou can change the argument to `--depth` to include however much history\nyou like or remove it completey for the full history.\n\n### Building and Running the Examples\n\nTo build and run the examples, you will need Docker and QEMU installed on\nyour host PC. The steps that follow were run on a Fedora 36 PC with\nDocker v20.10 and QEMU v6.2 installed.\n\nAll scripts referenced below can be found under `scripts/`.\n\nTo build the kernel, modules, and initramfs:\n```\n$ ./build.sh\n```\n\nTo run the kernel with the init ram disk:\n```\n$ ./run.sh\n```\n\nOnce the virtual machine boots, you can find the example modules under the\n`/modules/` directory. Many of the modules include a `MODNAME_load` and\ncorresponding `MODNAME_unload` script. You can run these scripts to load/unload\nthe modules or you can do so directly yourself using the userland tools\nprovided (i.e., `insmod`, `rmmod`, `mknod`, etc.).\n\n### GDB Support\n\nIt can sometimes be useful to run an interactive debugger against your module\nto diagnose issues. This project includes support for GDB debug of kernel\ncode and modules.\n\nYou will first need to compile a kernel with debug info, kgdb debug support,\nand more. You can find the details of which config parameters are required by\nreading this\n[Star Lab's article](https://www.starlab.io/blog/using-gdb-to-debug-the-linux-kernel).\nWhen you're ready, run the `build.sh` script and configure/build the kernel\nand all modules.\n\nThe `run.sh` script includes GDB debug support. To launch your kernel in debug\nmode:\n```\n$ ./run.sh -g\n```\n\nFrom a seperate terminal, you can connect gdb to your live kernel and begin\nstepping through code. Note, `$LINUX_OBJ_DIR` below refers to the directory\ncontaining the Linux kernel objects produced by the build. These should always\nbe under `/path/to/linux_device_drivers/bin/obj`.\n```\n$ cd $LINUX_OBJ_DIR\n$ gdb vmlinux\n(gdb) target remote localhost:1234\n```\nAt this point, you can set breakpoints, step through code, etc. Be wary, there\nare quite a few differences between using GDB to debug the kernel versus a\nuserland app. It's worth taking the time to read some articles to understand\nwhat those differences are.\n\n### Source Material\n\nThe authors and publishers have made the text and source code for these\nexamples publicly avilable. Here are the links to the source material I used:\n\n* [Linux Device Drivers 3rd Edition](https://lwn.net/Kernel/LDD3/)\n* [Original Example Files](https://resources.oreilly.com/examples/9780596005900)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivan-guerra%2Flinux_device_drivers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivan-guerra%2Flinux_device_drivers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivan-guerra%2Flinux_device_drivers/lists"}