{"id":20105025,"url":"https://github.com/misyltoad/quick_kernel_dev_guide","last_synced_at":"2026-02-10T09:03:09.186Z","repository":{"id":257786727,"uuid":"675485474","full_name":"misyltoad/quick_kernel_dev_guide","owner":"misyltoad","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-07T03:22:38.000Z","size":1,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-13T04:44:45.632Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/misyltoad.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-08-07T03:22:12.000Z","updated_at":"2023-08-09T23:47:28.000Z","dependencies_parsed_at":"2024-09-20T17:17:29.778Z","dependency_job_id":"70fad6bf-387c-408e-b78d-bee9f7ad2652","html_url":"https://github.com/misyltoad/quick_kernel_dev_guide","commit_stats":null,"previous_names":["misyltoad/quick_kernel_dev_guide"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misyltoad%2Fquick_kernel_dev_guide","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misyltoad%2Fquick_kernel_dev_guide/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misyltoad%2Fquick_kernel_dev_guide/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misyltoad%2Fquick_kernel_dev_guide/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/misyltoad","download_url":"https://codeload.github.com/misyltoad/quick_kernel_dev_guide/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241549061,"owners_count":19980474,"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":"2024-11-13T17:45:38.050Z","updated_at":"2026-02-10T09:03:03.702Z","avatar_url":"https://github.com/misyltoad.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quick Kernel Development Setup Guide\n\n## Step 1\n\n### Make some rootfs to play with your kernel in:\n\n```\nvirt-builder debian-12 \\\n        --arch x86_64 \\\n        --hostname kerneldev \\\n        --root-password password:kerneldev \\\n        --size 16G \\\n        --update \\\n        --format raw \\\n        --install bcachefs-tools \\\n        --selinux-relabel \\\n        -o ./rootfs_debian\n```\n\nThis creates an up-to-date 16GB Debian rootfs called rootfs_debian with the root password `kerneldev` and the hostname `kerneldev`.\n\nThis also installs the package `bcachefs-tools` in the image. Neat!\n\n## Step 2\n### Build your kernel:\n\nThis guide assumes you know the basics of how to build a kernel in general.\n\nThe summary:\n```\nmake defconfig\n[ edit defconfig to include the features of what you are working on ]\nmake -j$(nproc)\n```\n\n*Note: For Fedora, and other images, you will need a kernel with CONFIG_BTRFS_FS=y which is NOT the default with defconfig.*\n\n## Step 3\n### Run your kernel\n\n```\nqemu-system-x86_64 \\\n    -drive file=rootfs_debian,format=raw,if=virtio \\\n    -enable-kvm \\\n    -append \"root=/dev/vda1 console=ttyS0\" \\\n    -kernel arch/x86/boot/bzImage \\\n    -cpu host \\\n    -nographic \\\n    -m 16G \\\n    -smp 8\n```\n\nThis makes some VM with 16GB of RAM and 8 cores using our rootfs.\n\nThis uses your terminal for input and output because it specifies `-nographic`.\n\nYou can exit/quit the VM using `CTRL+A X`\n\n`vda1` is just what happens to match the config for that Debian rootfs. If using another distro or version, you may need to change that number to eg. `vda2` or `vda3`. The quickest way to find it out is experimentation.\n\nNo need for initrd/ramdisk as all the modules are included in our `bzImage`.\n\n\n### Want something more advanced like GPU passthru for developing GPU drivers?\n\nRead this guide! It's great. You might have better luck with `virt-manager` than the commandline for launcing qemu.\n\nhttps://wiki.archlinux.org/title/PCI_passthrough_via_OVMF\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmisyltoad%2Fquick_kernel_dev_guide","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmisyltoad%2Fquick_kernel_dev_guide","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmisyltoad%2Fquick_kernel_dev_guide/lists"}