{"id":15657832,"url":"https://github.com/willothy/goose","last_synced_at":"2025-03-30T02:21:55.407Z","repository":{"id":217740282,"uuid":"744710603","full_name":"willothy/goose","owner":"willothy","description":"Good ol' OS experiment. Probably bad. I have no idea what I'm doing, but the goal is to have some idea when I'm done.","archived":false,"fork":false,"pushed_at":"2024-09-14T07:04:12.000Z","size":148,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-05T04:46:14.953Z","etag":null,"topics":["hobby-os","kernel","operating-system","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/willothy.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":"2024-01-17T21:12:12.000Z","updated_at":"2024-09-14T07:04:15.000Z","dependencies_parsed_at":"2024-10-23T05:45:39.063Z","dependency_job_id":null,"html_url":"https://github.com/willothy/goose","commit_stats":null,"previous_names":["willothy/bruh_os","willothy/toss"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willothy%2Fgoose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willothy%2Fgoose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willothy%2Fgoose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willothy%2Fgoose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willothy","download_url":"https://codeload.github.com/willothy/goose/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246266589,"owners_count":20749819,"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":["hobby-os","kernel","operating-system","rust"],"created_at":"2024-10-03T13:09:56.654Z","updated_at":"2025-03-30T02:21:55.388Z","avatar_url":"https://github.com/willothy.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Goose (Good ol' OS experiment)\n\nHobby OS project. Probably very bad. I have no idea what I'm doing.\n\nInspired by [OSDev](https://wiki.osdev.org/Main_Page), [blog_os](https://os.phil-opp.com/),\nand [StreamOS](https://github.com/sphaerophoria/stream-os).\n\n## Goals\n\n- 64-bit, x86_64\n- Bootable by grub or similar (BIOS, UEFI is a non-goal for now)\n  - Multiboot2\n- Run on multiple CPU cores (SMP)\n- Support for simple graphics such as text and shapes\n- Preemptive, multicore scheduler (main goal, I want to learn about this)\n- Userland processes\n- Basic network stack (maybe a web server if I am lucky)\n- TUI environment with builtin multiplexer\n  - Vim bindings EVERYWHERE. Maybe I won't even support mouse at all.\n  - If I am able to get GUI, then build the GUI around the terminal.\n    Like tmux but you can have splits be GUI windows OR builtin terminals.\n\n## About\n\nI've followed the blog_os series before as well as the OSDev barebones tutorial, but I\nam attempting to learn by doing with this project. I will be sometimes indirectly\nfollowing tutorials or courses I find, but for the most part\nmy goal here is to really figure out how OS dev works and how to do it myself.\n\nI am writing it in Rust because I like Rust, but also because most of the available resources use\nC so I will not have the temptation to copy-paste. Also, there will be crates available for some\ntasks which is a nice improvement from c-land. I am already making use of the\n[multiboot2](https://github.com/rust-osdev/multiboot2) and [spin](https://github.com/mvdnes/spin-rs) crates for\nparsing multiboot info and sync primitives, respectively.\n\nWhile I will use crates for some things, I will be implementing as much as possible\nof the kernel myself. I really just didn't want to deal with multiboot or writing an elf parser.\n\n## Architecture\n\nMultiboot2 compatible.\n\nEverything can be compiled with a standard nightly Rust toolchain (target = x86_64-unknown-none); no special gcc cross-compiler is needed.\n\n`nasm` and a linker are required as well, to build the assembly files and construct the final executable.\n\nThe current build setup uses `grub-mkrescue` to construct a bootable image, but this could be adapted to other\nbootloaders / systems as long as multiboot2 is supported.\n\nBootstrap (/boot.asm, /boot64.asm):\n\n- This is where grub puts us initially\n- setup stack and do protected mode (32-bit) init stuff\n- setup basic paging so we can enter long mode\n- setup basic gdt so CPU lets us into long mode\n- setup long mode (64-bit)\n- jump to kernel entry point in long mode\n\nTODO: move some of this bootstrap code to 32-bit Rust. I tried to do this before\nwith *some* success, but found linking back and forth difficult so I went with full asm for now.\n\nKernel: (/kernel):\n\n- Parse multiboot info (using multiboot2 crate)\n- Setup VGA writer\n- Setup long mode GDT (WIP)\n- Setup IDT and interrupt handlers (WIP)\n- Setup and enable PICs and PIT\n\nWorking (sorta) but not enabled:\n\n- Jump to userland (WIP)\n  - Currently cannot get interrupts to re-enable when entering user mode due to general protection fault\n\nTODO:\n\n- Setup long mode 4-level paging\n- Memory allocator so I can use the `alloc` crate and the heap\n- Test harness\n- Serial driver\n- USB driver\n- Basic filesystem (FAT32?)\n- Scheduler + processes\n  - SMP boot / AP trampoline code\n- etc...\n\nRunner (/runner):\n\n- Builds and runs the kernel\n- I should look at how the bootloader / bootimage crates do things\n- Need to make framework for running tests / communicating via serial.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillothy%2Fgoose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillothy%2Fgoose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillothy%2Fgoose/lists"}