{"id":13439227,"url":"https://github.com/cfenollosa/os-tutorial","last_synced_at":"2025-05-12T13:20:18.547Z","repository":{"id":21270539,"uuid":"24586308","full_name":"cfenollosa/os-tutorial","owner":"cfenollosa","description":"How to create an OS from scratch","archived":false,"fork":false,"pushed_at":"2024-07-25T10:57:29.000Z","size":152,"stargazers_count":28262,"open_issues_count":122,"forks_count":3387,"subscribers_count":798,"default_branch":"master","last_synced_at":"2025-05-12T13:19:41.870Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cfenollosa.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":"2014-09-29T08:39:34.000Z","updated_at":"2025-05-12T09:29:24.000Z","dependencies_parsed_at":"2022-07-11T03:00:33.148Z","dependency_job_id":"76119fae-15a1-429c-9d8a-6c842eda0185","html_url":"https://github.com/cfenollosa/os-tutorial","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/cfenollosa%2Fos-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfenollosa%2Fos-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfenollosa%2Fos-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfenollosa%2Fos-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cfenollosa","download_url":"https://codeload.github.com/cfenollosa/os-tutorial/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253745196,"owners_count":21957319,"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":[],"created_at":"2024-07-31T03:01:12.136Z","updated_at":"2025-05-12T13:20:18.528Z","avatar_url":"https://github.com/cfenollosa.png","language":"C","readme":"os-tutorial\n===========\n\n_⚠️ Hey! This is an old, abandoned project, with both technical and design issues [listed here](https://github.com/cfenollosa/os-tutorial/issues/269). Please have fun with this tutorial but do look for more modern and authoritative sources if you want to learn about OS design. ⚠️_\n\nHow to create an OS from scratch!\n\nI have always wanted to learn how to make an OS from scratch. In college I was taught\nhow to implement advanced features (pagination, semaphores, memory management, etc)\nbut:\n\n- I never got to start from my own boot sector\n- College is hard so I don't remember most of it.\n- I'm fed up with people who think that reading an already existing kernel, even if small, is \na good idea to learn operating systems.\n\nInspired by [this document](http://www.cs.bham.ac.uk/~exr/lectures/opsys/10_11/lectures/os-dev.pdf)\nand the [OSDev wiki](http://wiki.osdev.org/), I'll try to make short step-by-step READMEs and\ncode samples for anybody to follow. Honestly, this tutorial is basically the first document but\nsplit into smaller pieces and without the theory.\n\nUpdated: more sources: [the little book about OS development](https://littleosbook.github.io),\n[JamesM's kernel development tutorials](https://web.archive.org/web/20160412174753/http://www.jamesmolloy.co.uk/tutorial_html/index.html)\n\n\nFeatures\n--------\n\n- This course is a code tutorial aimed at people who are comfortable with low level computing. For example,\nprogrammers who have curiosity on how an OS works but don't have the time or willpower to start reading the Linux kernel\ntop to bottom.\n- There is little theory. Yes, this is a feature. Google is your theory lecturer. Once you pass college, \nexcessive theory is worse than no theory because it makes things seem more difficult than they really are.\n- The lessons are tiny and may take 5-15 minutes to complete. Trust me and trust yourself. You can do it!\n\n\nHow to use this tutorial\n------------------------\n\n1. Start with the first folder and go down in order. They build on previous code, so if \nyou jump right to folder 05 and don't know why there is a `mov ah, 0x0e`, it's because you missed lecture 02.\nReally, just go in order. You can always skip stuff you already know.\n\n2. Open the README and read the first line, which details the concepts you should be familiar with\nbefore reading the code. Google concepts you are not familiar with. The second line states the goals for each lesson. \nRead them, because they explain why we do what we do. The \"why\" is as important as the \"how\".\n \n3. Read the rest of the README. It is **very concise**.\n\n4. (Optional) Try to write the code files by yourself after reading the README.\n\n5. Look at the code examples. They are extremely well commented.\n\n6. (Optional) Experiment with them and try to break things. The only way to make sure you understood something is\ntrying to break it or replicate it with different commands.\n\n\nTL;DR: First read the README on each folder, then the code files. If you're brave, try to code them yourself.\n\n\nStrategy\n--------\n\nWe will want to do many things with our OS:\n\n- Boot from scratch, without GRUB - DONE!\n- Enter 32-bit mode - DONE\n- Jump from Assembly to C - DONE!\n- Interrupt handling - DONE!\n- Screen output and keyboard input - DONE!\n- A tiny, basic `libc` which grows to suit our needs - DONE!\n- Memory management\n- Write a filesystem to store files\n- Create a very simple shell\n- User mode\n- Maybe we will write a simple text editor\n- Multiple processes and scheduling\n\nProbably we will go through them in that order, however it's soon to tell.\n\nIf we feel brave enough:\n\n- A BASIC interpreter, like in the 70s!\n- A GUI\n- Networking\n\n\n\nContributing\n------------\n\nThis is a personal learning project, and even though it hasn't been updated for a long time, I still have hopes to get into it at some point.\n\nI'm thankful to all those who have pointed out bugs and submitted pull requests. I will need some time to review everything and I cannot guarantee that at this moment.\n\nPlease feel free to fork this repo. If many of you are interested in continuing the project, let me know and I'll link the \"main fork\" from here.\n","funding_links":[],"categories":["C","RTOS","Utilities","System","Uncategorized","etc","Books and Guides","Tutorials","Resources"],"sub_categories":["ESP8266","Uncategorized","Tutorials"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfenollosa%2Fos-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcfenollosa%2Fos-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfenollosa%2Fos-tutorial/lists"}