{"id":17893353,"url":"https://github.com/techno-coder/example_os","last_synced_at":"2026-03-16T16:33:00.074Z","repository":{"id":118644743,"uuid":"135863841","full_name":"Techno-coder/example_os","owner":"Techno-coder","description":"A heavily commented OS in Rust for reference purposes","archived":false,"fork":false,"pushed_at":"2018-07-08T07:13:49.000Z","size":417,"stargazers_count":16,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T17:08:10.518Z","etag":null,"topics":["kernel","operating-system","osdev","rust","tutorial","x86-64"],"latest_commit_sha":null,"homepage":"https://techno-coder.github.io/example_os/","language":"Rust","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/Techno-coder.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-06-03T01:19:10.000Z","updated_at":"2024-01-18T11:23:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"de55f8e1-df46-43b2-9efd-55215932e509","html_url":"https://github.com/Techno-coder/example_os","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Techno-coder%2Fexample_os","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Techno-coder%2Fexample_os/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Techno-coder%2Fexample_os/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Techno-coder%2Fexample_os/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Techno-coder","download_url":"https://codeload.github.com/Techno-coder/example_os/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245052626,"owners_count":20553161,"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":["kernel","operating-system","osdev","rust","tutorial","x86-64"],"created_at":"2024-10-28T14:49:36.949Z","updated_at":"2026-03-16T16:32:55.051Z","avatar_url":"https://github.com/Techno-coder.png","language":"Rust","readme":"# example_os\nA heavily commented OS in Rust for reference purposes (documentation in progress).  \nCheck out the companion site here: [Tutorials](https://techno-coder.github.io/example_os/)\n\nThis OS is a hard fork of my private OS that I'm also working on. No more features will be added to this OS as it is for reference purposes only.  \nHuge thanks to [Phil-opp](https://os.phil-opp.com) and the [OSDev wiki](https://wiki.osdev.org)\n\n## License\nEverything in this repository is under the MIT license, excluding the _posts and assets folder (which contains data for the companion website), which is copyrighted. \n\n## Features\n- Preemptive Multitasking (including system calls)\n- System Calls (well, one of them)\n- Primitive filesystem (Tar archive ram disk)\n- Stack traces (with kernel symbols)\n- Huge page support\n- Huge frame allocation\n- Keyboard driver\n- Kernel shell (with tab completion)\n\n## Prerequisites\nYou can find most of the prerequisites needed in the `CMakeLists.txt` files located in the root and in `kernel` folder.\n\nBuild requirements:\n- NASM Assembler\n- Binutils\n- nm (Symbol table displayer)\n- Rust\n- Cargo\n- Xargo\n- LLVM linker\n- tar (for creating the boot disk)\n- grub-mkrescue (to generate the .iso file)\n- CMake (if you wish to compile with CMake)\n\nExecution requirements:\n- QEMU\n- Bochs\n\nA `bochsrc` file is located in the root.\n\n## Build instructions\nOnce you have installed the prerequisites, you can either compile everything manually or use CMake.\n\n### CMake\nChange `XARGO_TOOL` in the kernel CMake file from `xargo-m` to `xargo`. The -m suffix is to avoid Intellij-Rust from using Xargo to run tests.  \nChange `OBJECT_COPY_TOOL` from `gobjcopy` to `objcopy` or whatever the `objcopy` tool is aliased to.\n\nFinally, run this command:\n`cmake --build cmake-build-debug --target x86_64-example_os.iso`  \nThe .iso file will be located in the cmake-build-debug folder\n\n### CLion\nImport the project and then build the `.iso` target after making the changes in the CMake section.\n\n### Manually\n1. Use NASM to compile all the files in `kernel/assembly` with the command  \n`nasm -felf64 -w-number-overflow -Ikernel/assembly`  \n2. Use Xargo to compile the Rust binary with the command (execute in the `kernel` folder)  \n``RUST_FLAGS=-Cforce-frame-pointers=yes RUST_TARGET_PATH=`pwd` xargo build --target x86_64-example_os``  \nThe `RUST_TARGET_PATH` is needed to allow xargo to locate the target specification.\n3. Link all the files together  \n`ld.lld --gc-sections -Tlinker.ld \u003cAssembly object files\u003e \u003cGenerated Rust file\u003e`  \nThe Rust file is located in `kernel/target/x86_64-example_os/debug/libkernel.a`  \n4. Create a `boot_disk` folder, and a `kernel` folder inside of that\n5. Use `nm` against the linked binary and pipe it to a file `symbols.table`.  \nCopy this file into the `boot_disk/kernel` folder.\n6. Tar the `boot_disk` folder into `boot_disk.tar`\n7. Create a `iso_files` folder, and a `boot` folder inside of that, and a `grub` folder inside of that\n8. Copy the `grub.cfg` file into `iso_files/boot/grub`\n9. Copy the `boot_disk.tar` into `iso_files/boot`\n10. Create the .iso with the command  \n`grub-mkrescue -o \u003cISO file\u003e iso_files`\n\n## Execution\n### Bochs\nJust run `bochs` in the root directory. You may need to change the path to the iso file in the `bochsrc`.\n### QEMU\nRun the command  \n`qemu-system-x86_64 -cdrom x86_64-example_os.iso -monitor stdio -d int -no-reboot -no-shutdown`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechno-coder%2Fexample_os","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechno-coder%2Fexample_os","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechno-coder%2Fexample_os/lists"}