{"id":13739732,"url":"https://github.com/PauloMigAlmeida/AlmeidaOS","last_synced_at":"2025-05-08T19:34:43.927Z","repository":{"id":40476126,"uuid":"328301927","full_name":"PauloMigAlmeida/AlmeidaOS","owner":"PauloMigAlmeida","description":"Simple, self-contained, clean code, well-documented, hobbyist 64-bit operating system for Intel and AMD processors. It's written in Assembly (Intel syntax) and C (GNU99 Standard) in which I strive for adding comments to the source code so it could be used as a reference for future OS developers","archived":false,"fork":false,"pushed_at":"2022-05-05T23:51:41.000Z","size":368,"stargazers_count":53,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-08-04T04:05:32.059Z","etag":null,"topics":["amd","amd64","bootloader","buddy","cmos","heap","hobby-os","hobbyist-os","intel","kernel","operating-system","operating-systems","os","osdev","paging","pic","pit","x86-64"],"latest_commit_sha":null,"homepage":"","language":"C","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/PauloMigAlmeida.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-10T04:22:04.000Z","updated_at":"2024-07-26T11:56:31.000Z","dependencies_parsed_at":"2022-08-09T21:31:20.117Z","dependency_job_id":null,"html_url":"https://github.com/PauloMigAlmeida/AlmeidaOS","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/PauloMigAlmeida%2FAlmeidaOS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PauloMigAlmeida%2FAlmeidaOS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PauloMigAlmeida%2FAlmeidaOS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PauloMigAlmeida%2FAlmeidaOS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PauloMigAlmeida","download_url":"https://codeload.github.com/PauloMigAlmeida/AlmeidaOS/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224758211,"owners_count":17364969,"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":["amd","amd64","bootloader","buddy","cmos","heap","hobby-os","hobbyist-os","intel","kernel","operating-system","operating-systems","os","osdev","paging","pic","pit","x86-64"],"created_at":"2024-08-03T04:00:36.950Z","updated_at":"2024-11-15T09:30:46.675Z","avatar_url":"https://github.com/PauloMigAlmeida.png","language":"C","funding_links":[],"categories":["Open Source Operating Systems"],"sub_categories":[],"readme":"# AlmeidaOS\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/1750dfde498946ba8fb8a113c49a5ac7)](https://www.codacy.com/gh/PauloMigAlmeida/AlmeidaOS/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=PauloMigAlmeida/AlmeidaOS\u0026amp;utm_campaign=Badge_Grade)\n\n\nSimple, self-contained, clean code, well-documented, hobbyist 64-bit operating system for Intel and AMD processors. It's written in Assembly (Intel syntax) and C (GNU99 Standard) in which I strive for adding comments to the source code as much as possible so it could be used as a reference for future OS developers.\n\nIt contains the following components written from scratch:\n\n## BIOS\n| Component | Description | Source code |\n| --- | ----------- | ----------- |\n| MBR | First stage bootloader | [code](src/boot/mbr.asm) |\n| Loader | Second stage bootloader | [code](src/boot/loader.asm) |\n\n\n## Kernel\n| Component | Description | Source code |\n| --- | ----------- | ----------- |\n| PML4 | Paging Structure | [code](src/kernel/mm/page.c) |\n| Buddy | Memory allocator System | [code](src/kernel/mm/buddy.c) |\n| PrintK | printf-like string format parsing utility | [code](src/kernel/lib/printk.c) |\n| Serial Driver | send printk msgs via RS232 to help debugging | [code](src/kernel/device/serial.c) |\n| Core Dump | Dump CPU registers for debugging purposes  | [code](src/kernel/debug/coredump.c) |\n| Syscall/Sysret | method chosen to jump to Ring 3 and back | [code](src/kernel/syscall) |\n| PIT | Programmable Interval Timer | [code](src/kernel/arch/pit.c) |\n| PIC | Programmable Interrupt Controller | [code](src/kernel/arch/pic.c) |\n| (x)delay | Based on tightloops given that I'm using PIT | [code](src/kernel/time/delay.c) |\n| CMOS RTC | Real-time clock | [code](src/kernel/arch/cmos.c) |\n| Scheduler | Simple Round-Robin scheduler | [code](src/kernel/task/scheduler.c) |\n\n## libc\nfunctions are being added on-demand:  [code](src/libc)\n\nMore to come! Star/Watch this repo to stay tuned!\n\n## Build\nIn order to build this app, you are expected to have `make` and `docker` installed in your machine. All of the other building dependencies should be taken care of automatically by the docker image created during this step.\n\nTo build it you have to run:\n\n```{shell}\nmake build\n```\n\n## Run\nIn order to run this app, you are expected to have `make` and `qemu-system-x86_64` installed in your machine.\n\n```{shell}\nmake test\n```\n\n## Wishlist\nTo make sure I won't lose focus on what I want this OS to be able to do, I decided to write a list of features\nthat I want to implement in the short to medium term.\n\n- [X] Serial port driver\n- [X] Early printk (contingent on serial port driver) -\u003e will help debugging in real computers\n- [X] limited libc -\u003e (It will always be \"Work in progress\" as I add functions as I need them)\n- [X] Userspace\n- [ ] Rudimentary Bash-like terminal\n\n## Stretch goals\nThings that would be fantastic to have but I am not sure if I have what it takes to do within my lifetime.\n\n- [ ] networking capabilities (I would be damn happy with UDP already..I wouldn't dare trying to implement TCP)\n- [ ] Filesystem\n- [X] Scheduler / Time-sharing OS\n\n## References\nThese are all the references that helped me a lot during the development of AlmeidaOS\n\nForums:\n- https://www.osdev.org/\n- https://www.reddit.com/r/osdev/\n\nBooks:\n- https://www.amazon.com/Understanding-Linux-Kernel-Third-Daniel/dp/0596005652\n- https://www.amazon.com/Linux-Device-Drivers-Jonathan-Corbet/dp/0596005903/\n- https://www.amazon.com/Hackers-Delight-2nd-Henry-Warren/dp/0321842685 - (thanks [@igorlg](https://github.com/igorlg))\n- https://www.amazon.com/Understanding-Using-Pointers-Techniques-Management/dp/1449344186 \n\nExisting OSes:\n- https://github.com/beevik/MonkOS\n- https://elixir.bootlin.com/linux/latest/source\n\nCourses:\n- https://www.udemy.com/course/writing-your-own-operating-system-from-scratch/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPauloMigAlmeida%2FAlmeidaOS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPauloMigAlmeida%2FAlmeidaOS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPauloMigAlmeida%2FAlmeidaOS/lists"}