{"id":18743187,"url":"https://github.com/kbingham/qemu-kernel","last_synced_at":"2026-02-09T16:08:11.979Z","repository":{"id":145220589,"uuid":"142287386","full_name":"kbingham/qemu-kernel","owner":"kbingham","description":null,"archived":false,"fork":false,"pushed_at":"2018-07-25T10:54:39.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-02T10:04:03.838Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kbingham.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}},"created_at":"2018-07-25T10:53:24.000Z","updated_at":"2018-07-25T10:54:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"a8d9cdc3-7e10-4770-985f-ba7629aa1111","html_url":"https://github.com/kbingham/qemu-kernel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kbingham/qemu-kernel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbingham%2Fqemu-kernel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbingham%2Fqemu-kernel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbingham%2Fqemu-kernel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbingham%2Fqemu-kernel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kbingham","download_url":"https://codeload.github.com/kbingham/qemu-kernel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbingham%2Fqemu-kernel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29271899,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T13:47:44.167Z","status":"ssl_error","status_checked_at":"2026-02-09T13:47:43.721Z","response_time":56,"last_error":"SSL_read: 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":[],"created_at":"2024-11-07T16:10:30.251Z","updated_at":"2026-02-09T16:08:11.958Z","avatar_url":"https://github.com/kbingham.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Linux Kernel Awareness QEMU-Test environment\n\nThe following steps assume that the reader is already experienced in cross compiling, and building kernels.\nAn ubuntu/debian build host is assumed.\n\n## Prerequisites\nYou will need the following packages instaled on your system:\n```\nsudo apt-get update\nsudo apt-get install -y build-essential git-core gcc-arm-linux-gnueabi qemu-system-arm\nsudo apt-get install -y texinfo libncurses5-dev python-dev bison flex\n```\n\n## Building\nClone this repository and type 'make' in the new folder. The scripts will clone the correct repositories, and build both binutils-gdb and the kernel configured for an ARM target.\n\n```\ngit clone http://git.linaro.org/people/kieran.bingham/qemu-kernel.git\ncd qemu-kernel\nmake\n```\n## Usage\nOnce the build process has completed, you will need to have two terminals open. I prefer to have these side-by-side for visibility\n\n### Terminal 1: Running Kernel in QEmu\nOne terminal will be required to boot a kernel, and observe it's console output. These scripts disable graphics console capablity of qemu, simplifying the process to a text based view.\n```\nmake qemu-run\n```\n\n### Terminal 2: Connecting to the QEmu kernel with GDB\nIn the other terminal, you will establish the connection to the running kernel:\n```\nmake qemu-gdb\n```\n\n## Using LKD-C implementation\nWhen you have a running kernel, and GDB session, you should find your self presented with a command prompt in gdb:\n```\nRemote debugging using localhost:32777\nEnabling Linux Kernel Debugger 7.11-development build Mar  2 2016.\ncpu_v7_do_idle () at /home/kbingham/qemu-kernel/sources/linux/arch/arm/mm/proc-v7.S:74\n74              ret     lr\n(gdb)\n```\n\nInitially, the Linux Kernel awareness is disabled, and can be introduced by executing the following command:\n```\n(gdb) set linux-awareness loaded\n```\n\nYou should be presented with a list of new threads being added to the system:\n```\n[New [swapper/0]]\n[New [kthreadd]]\n[New [ksoftirqd/0]]\n[New [kworker/0:0]]\n...\n```\n\nAt this point, you can inspect the thread list to see the new tasks integrated into the GDB thread list:\n```\n(gdb) info threads\n  Id   Target Id         Frame \n* 1    [swapper/0] (TGID:0 \u003cC0\u003e) cpu_v7_do_idle () at linux/arch/arm/mm/proc-v7.S:74\n  2    [swapper/1] (TGID:0 \u003cC1\u003e) cpu_v7_do_idle () at linux/arch/arm/mm/proc-v7.S:74\n  3    [swapper/0] (TGID:1) context_switch (next=\u003coptimized out\u003e, prev=\u003coptimized out\u003e, rq=\u003coptimized out\u003e) at linux/kernel/sched/core.c:2706\n  4    [kthreadd] (TGID:2) context_switch (next=\u003coptimized out\u003e, prev=\u003coptimized out\u003e, rq=\u003coptimized out\u003e) at linux/kernel/sched/core.c:2706\n```\n\nAnd you can select a thread, and backtrace it in the expected way:\n```\n(gdb) thread 47\n[Switching to thread 47 ([kworker/1:1])]\n#0  context_switch (next=\u003coptimized out\u003e, prev=\u003coptimized out\u003e, rq=\u003coptimized out\u003e)\n    at /home/kbingham/qemu-kernel/sources/linux/kernel/sched/core.c:2706\n2706            return finish_task_switch(prev);\n(gdb) bt\n#0  context_switch (next=\u003coptimized out\u003e, prev=\u003coptimized out\u003e, rq=\u003coptimized out\u003e) at linux/kernel/sched/core.c:2706\n#1  __schedule (preempt=\u003coptimized out\u003e) at linux/kernel/sched/core.c:3180\n#2  0xc09c7268 in schedule () at linux/kernel/sched/core.c:3209\n#3  0xc025ef1c in worker_thread (__worker=0xee89a000) at linux/kernel/workqueue.c:2183\n#4  0xc0263fe8 in kthread (_create=0xee83dac0) at linux/kernel/kthread.c:209\n#5  0xc0210c38 in ret_from_fork () at linux/arch/arm/kernel/entry-common.S:118\nBacktrace stopped: previous frame identical to this frame (corrupt stack?)\n(gdb) \n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkbingham%2Fqemu-kernel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkbingham%2Fqemu-kernel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkbingham%2Fqemu-kernel/lists"}