{"id":19341679,"url":"https://github.com/nexterot/develop-os-free","last_synced_at":"2025-04-23T03:32:00.555Z","repository":{"id":97701158,"uuid":"150449123","full_name":"nexterot/develop-os-free","owner":"nexterot","description":"Make C programs that run without OS","archived":false,"fork":false,"pushed_at":"2020-03-03T20:20:40.000Z","size":4114,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T07:11:33.057Z","etag":null,"topics":["asm","bmstu","c","gcc","grub","make","multiboot","os"],"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/nexterot.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-09-26T15:31:16.000Z","updated_at":"2025-03-17T07:22:16.000Z","dependencies_parsed_at":"2023-04-30T02:32:06.172Z","dependency_job_id":null,"html_url":"https://github.com/nexterot/develop-os-free","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexterot%2Fdevelop-os-free","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexterot%2Fdevelop-os-free/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexterot%2Fdevelop-os-free/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexterot%2Fdevelop-os-free/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nexterot","download_url":"https://codeload.github.com/nexterot/develop-os-free/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250365742,"owners_count":21418740,"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":["asm","bmstu","c","gcc","grub","make","multiboot","os"],"created_at":"2024-11-10T03:32:06.821Z","updated_at":"2025-04-23T03:32:00.549Z","avatar_url":"https://github.com/nexterot.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Description\nThis is my 5th term coursework on the \"Operating Systems\" subject at the [Department of Computer Science and Technologies](https://github.com/bmstu-iu9), [Bauman Moscow State Technical University](http://www.bmstu.ru/).\u003cbr\u003e\nThe main aim is to get acquainted with principle of OS kernel operation at low level. \nAs a sequence, develop minimal C libraries for I/O tasks (e.g., functions like putchat, printf, gets, scanf) and memory management (malloc, free, and so on).\nFinally, write an app demonstrating their efficiency. The coursework was evaluated in mark 5/5.\n### How it actually works\nProject building with [Make](https://www.gnu.org/software/make/) tool. [Makefile](https://github.com/nexterot/develop-os-free/blob/master/Makefile) contains all the logic. Here are main steps:\n1. Kernel compilation from C source (32 bit);\n2. Disk image creation and partitioning (using ext2 filesystem);\n3. Installing grub into image via grub-install tool;\n4. Embedding kernel into image.\n### What is done by far\n- A minimal OS kernel supporting [Multiboot](https://www.gnu.org/software/grub/manual/multiboot/multiboot.html) specification;\n- Embedding [grub2](https://www.gnu.org/software/grub/) bootloader;\n- Input functions: getchar, gets;\n- Output functions: putchar, puts; also printf function taken from other source;\n- Cursor functions: disable_cursor, enable_cursor, move_cursor, update_cursor;\n- Time functions: delay, sleeps;\n- Memory functions: malloc, free;\n- Random functions: rand, srand, rtc_seed;\n- Example application: the Tetris game.\n### How to test it without compiling kernel\nGet image file (disk.img) from latest [release](https://github.com/nexterot/develop-os-free/releases), then just write it to a USB or run with x86 emulator. For [QEMU](https://www.qemu.org/) it is the following command:\n```bash\nspam@eggs:~$ sudo qemu-system-i386 -hda disk.img\n```\n### How to compile kernel\n\u003cdetails\u003e\u003csummary\u003eGuide\u003c/summary\u003e\n  \n\u003cp\u003e\n\n#### Dependencies\n- make\n- gcc\n- as\n- ld\n- grub2\n- qemu\n#### Supported hosts\n**Linux**. Currently developing and testing on Ubuntu 18.04 LTS minimal.\n#### \nFirst make sure you have all tools listed in **Dependencies** block installed. Then do the following:\n```bash\nspam@eggs:~$ git clone https://github.com/nexterot/develop-os-free\nspam@eggs:~$ cd develop-os-free\nspam@eggs:~$ make\n```\nIn case of errors, or just to clean the directory:\n```bash\nspam@eggs:~$ make clean\n```\nAlso, the following command is an alias for ```make clean \u0026\u0026 make```:\n```bash\nspam@eggs:~$ make rebuild\n```\n#### Test with emulator\nTo test it with QEMU emulator, run:\n```bash\nspam@eggs:~$ make run\n```\n\n#### If you ran into some problem  \n#### Problem:\n```\nlosetup: bin/disk.img: failed to set up loop device: Device or resource busy\n```\n#### Solution:\u003cbr\u003e\nFind busy loop devices:\n```bash\nspam@eggs:~$ losetup -a\n```\nThen edit next lines in Makefile, changing '/dev/loop2' or\\and '/dev/loop3' to any free loop device:\n```\nloop_first  = /dev/loop2\nloop_second = /dev/loop3\n```\nFinally do:\n```bash\nspam@eggs:~$ make rebuild\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n### Screenshots\n![1.png](screenshots/1.png)\n![2.png](screenshots/2.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnexterot%2Fdevelop-os-free","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnexterot%2Fdevelop-os-free","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnexterot%2Fdevelop-os-free/lists"}