{"id":26811781,"url":"https://github.com/elmazzun/krnl","last_synced_at":"2026-04-20T06:01:35.811Z","repository":{"id":158699237,"uuid":"625991082","full_name":"elmazzun/krnl","owner":"elmazzun","description":"Dockerized environment where to build and run a custom kernel","archived":false,"fork":false,"pushed_at":"2024-01-03T22:17:45.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-23T18:07:29.212Z","etag":null,"topics":["docker","gcc-cross-compiler","kernel","osdev-projects","qemu-kvm"],"latest_commit_sha":null,"homepage":"","language":"Assembly","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/elmazzun.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,"zenodo":null}},"created_at":"2023-04-10T15:05:01.000Z","updated_at":"2024-01-04T10:28:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"5f19ecc6-5de0-4459-afe1-e2692cde5649","html_url":"https://github.com/elmazzun/krnl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/elmazzun/krnl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elmazzun%2Fkrnl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elmazzun%2Fkrnl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elmazzun%2Fkrnl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elmazzun%2Fkrnl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elmazzun","download_url":"https://codeload.github.com/elmazzun/krnl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elmazzun%2Fkrnl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32035276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["docker","gcc-cross-compiler","kernel","osdev-projects","qemu-kvm"],"created_at":"2025-03-30T01:40:00.892Z","updated_at":"2026-04-20T06:01:33.758Z","avatar_url":"https://github.com/elmazzun.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"# krnl\n\n⚠️⚠️⚠️\n\n**This repo is under heavy refactoring: kindly wait to use it as long as you**\n**see this notice.**\n\n**I am currently moving QEMU installation inside a dedicated Docker container**\n**in order to not install QEMU locally.**\n\n⚠️⚠️⚠️\n\nCreating a k(e)rn(e)l for fun.\n\n## Building the krnl\n\nI use [Docker](https://www.docker.com/) to create the krnl build environment \nimage where I cross-compile the krnl.\n\n## Testing the krnl\n\nI use [QEMU](https://www.qemu.org/) to run the krnl on a i686 architecture and \n[GDB](https://www.sourceware.org/gdb/) to troubleshoot it.\n\n## Workflow\n\nAssuming this is the first time you work with this project.\n\n```bash\n# Clone this repo\n$ git clone ... \u0026\u0026 cd krnl\n\n# Install Docker, QEMU and GDB\n$ sudo apt install ...\n\n# Copy .my-gdbinit in your home and rename it ./gdbinit\n\n# Build the krnl build environment Docker image\n$ ./build-lab.sh\n[+] Building 17.1s (9/9) FINISHED                                                             \n =\u003e [internal] load build definition from Dockerfile                   0.0s\n ...\n =\u003e =\u003e naming to docker.io/library/krnl-development-lab:0.1.0          0.0s\n\n# Compile the krnl\n$ ./compile-krnl.sh                       \n\n# Test the krnl\n$ ./emulate-krnl.sh\n```\n\nThe Docker image will mount this current directory as a volume: this way, if \nyou want to edit the krnl sources, you don't have to re-build the Docker image \nin order to copy updated sources in lab Docker image; all you have to do is:\n\n- edit krnl sources;\n- `./compile-krnl.sh \u0026\u0026 ./emulate-krnl.sh`\n\n## Debugging\n\nWe will troubleshoot our krnl with GDB.\n\nIn `emulate-krnl.sh`, QEMU is started with `-s -S` command line switches:\n\n- `-S`: do not start CPU at startup\n\n- `-s`: shorthand for -gdb tcp::1234, i.e. open a gdbserver on TCP port 1234\n\nOur custom .gdbinit, `.my-gdbinit`, has the commands that connects GDB to QEMU.\n\nAfter running the emulated krnl with `emulate-krnl.sh`, copy the commands in \n`.my-gdbinit` in your `.gdbinit`; open another shell and just type `gdb`: \nyou should see:\n\n```\n$  gdb -q  \n0x00100018 in _start ()\n(gdb) info functions\nAll defined functions:\n\nFile krnl.c:\n61:\tint main(void);\n52:\tvoid print_string(char *, unsigned char);\n40:\tvoid term_init();\n36:\tuint16_t vga_entry(unsigned char, uint8_t);\n\nNon-debugging symbols:\n0x0010000c  _start\n(gdb) \n```\n\n## Resources and credits\n\n- https://www.linuxjournal.com/content/what-does-it-take-make-kernel-0\n- http://www.osdever.net/bkerndev/Docs/title.htm\n- https://wiki.osdev.org/Main_Page\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felmazzun%2Fkrnl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felmazzun%2Fkrnl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felmazzun%2Fkrnl/lists"}