{"id":30722700,"url":"https://github.com/coderarjob/meghaos-x86","last_synced_at":"2025-09-03T11:11:06.083Z","repository":{"id":149633591,"uuid":"289518234","full_name":"coderarjob/meghaos-x86","owner":"coderarjob","description":"MeghaOS is a 32 bit, protected mode Operating System for the Intel x86 architecture.","archived":false,"fork":false,"pushed_at":"2025-08-21T09:30:49.000Z","size":13619,"stargazers_count":26,"open_issues_count":5,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-21T11:48:10.695Z","etag":null,"topics":["c","ia32-assembly","kernel","osdev","x86-assembly"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coderarjob.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,"zenodo":null}},"created_at":"2020-08-22T15:49:07.000Z","updated_at":"2025-08-21T09:30:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"98335f57-ea98-41be-be9e-4acbb6e9da1b","html_url":"https://github.com/coderarjob/meghaos-x86","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/coderarjob/meghaos-x86","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderarjob%2Fmeghaos-x86","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderarjob%2Fmeghaos-x86/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderarjob%2Fmeghaos-x86/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderarjob%2Fmeghaos-x86/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderarjob","download_url":"https://codeload.github.com/coderarjob/meghaos-x86/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderarjob%2Fmeghaos-x86/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273431576,"owners_count":25104529,"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","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["c","ia32-assembly","kernel","osdev","x86-assembly"],"created_at":"2025-09-03T11:11:02.675Z","updated_at":"2025-09-03T11:11:06.074Z","avatar_url":"https://github.com/coderarjob.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"/docs/images/moslogo.svg\"/\u003e\n    \u003cbr/\u003e\n    \u003cbr/\u003e\n    \u003cimg src=\"https://github.com/coderarjob/meghaos-x86/actions/workflows/utbuild.yaml/badge.svg\"/\u003e\n    \u003cimg src=\"https://github.com/coderarjob/meghaos-x86/actions/workflows/osbuild.yaml/badge.svg\"/\u003e\n    \u003cbr/\u003e\n    \u003cbr/\u003e\n    MeghaOS is a 32-bit, graphical, multitasking, operating system for Intel i686 (Pentium) and later processors.\n\u003c/p\u003e\n\n## About\n\nMeghaOS is written completely from scratch and is primarily a educational project. It does not\nadhere to any particular operating system or philosophy, but includes ideas old and new from many\nsources.\n\nI want a system that is stable yet not totally locked down to the programmer. I want to give users\nthe ability to play around and explore their computers.\n\n## Screenshots\n\nMeghaOS is primarily a graphical operating system with text mode reserved for debugging \u0026\ndevelopment. It supports variety of graphics modes and has 8-bit, 24 \u0026 32-bit color suport.\n\n![MeghaOS Screenshot](/docs/images/meghaos_gui0.gif)\n\nMultitasking capabilities using Cooperative multitasking allows processes and threads to run\nsimultaneously. The choice of Cooperative multitasking was intentional as it provides a good base\nfor development of other multitasking features later and moreover its simple, requiring little to no\nsynchronization between threads and processes.\n\nThe OS runs in x86 Protected Mode with Virtual Memory to ensure that one process do not touch memory\nused by another.\n\n![MeghaOS Screenshot](/docs/images/meghaos_panic.png)\n\n## Roadmap\n\n- [X] 1st stage bootloader installing FAT12 Real mode routines and loading 2nd stage loader.\n- [X] 2nd stage bootloader loading the kernel and other modules.\n- [X] GDT and TSS setup and entering protected mode.\n- [X] Higher-Half page mapping.\n- [X] Jumping to User mode (Privilege Level 3) from Kernel mode.\n- [X] Handlers for CPU Exceptions and basic interrupts.\n- [X] Basic Kernel mode C functions for printing on screen etc.\n- [X] Unittesting framework to test parts of the OS on host computer.\n- [X] Memory management: Physical page allocation.\n- [ ] Memory management: Virtual page allocation. [*90% complete*]\n- [X] Memory management: Basic paging operations (map/unmap etc)\n- [X] Memory management: Kernel allocators (Static and Heap allocators)\n- [X] Processes and threads capable of doing system calls.\n- [X] Cooperative multitasking scheduling and basic process management.\n- [X] Enhancements to the process management.\n- [X] VESA VGA frame buffer.\n- [X] Basic graphics \u0026 fonts library\n- [ ] Basic drivers (PS2, PIT, PIC, Keyboard, Mouse, RTC)\n- [ ] CPIO based RAMDISK FS, for loading kernel modules and other programs.\n- [ ] Graphical shell.\n\n## Building and running MeghaOS\n\n### Prerequisites\n\n1. Requires Linux environment. May also be possible on WSL.\n2. gcc and binutils version 8.3 or higher, configured to target 1686-elf.\n   Use `tools/build_i686_gcc.sh` to configure and install gcc and binutils. Follow the following\n   steps:\n\n   * Install dependencies to build GCC and binutils:  `tools/build_i686_gcc.sh --install-dep`.\n   * Build and install GCC and binutils: `tools/build_i686_gcc.sh`.\n\n   Then either add the installation path to the $PATH variable or pass the path in\n   `CMAKE_PREFIX_PATH`.\n3. nasm assembler version 2.15.05 or higher.\n4. Cmake version \u003e= 3.15\n5. `dosfstools` for creation of disk image.\n\n### Building\n\n#### Cmake build options\n\n* `CMAKE_TOOLCHAIN_FILE` (Required) - Path to toolchain file.\n* `MOS_BUILD_MODE` (Defaults to DEBUG) - Valid values are DEBUG, NDEBUG.\n* `MOS_PORT_E9_ENABLED` (Defaults to 0) - Enables/disables debug printing using port 0xE9.\n* `CMAKE_PREFIX_PATH` - Path to where cross compiler is installed. Required if PATH environment\n    variable does not include it.\n* `MOS_GRAPHICS_ENABLED` (Defaults to No) - Enables/disables VESA graphics.\n* `MOS_GRAPHICS_BPP` (Defaults to 32) - Graphics bits per pixel. Valid values are 8, 24, 32.\n\nGenerate the build system and then start the build:\n```\n# Example 1: DEBUG build and cross compiler installation path passed explicitly.\n# NOTE: If full path was not provided the, Cross compiler path taken from $PATH variable.\n\n$ cmake -DCMAKE_TOOLCHAIN_FILE=./tools/toolchain-i686-elf-pc.cmake \\\n        -DCMAKE_PREFIX_PATH=~/.local/opt/i686-cross                \\\n        -B build-os\n\n# Example 2: DEBUG mode build with Graphics mode.\n\n$ cmake -DCMAKE_TOOLCHAIN_FILE=./tools/toolchain-i686-elf-pc.cmake \\\n        -DMOS_BUILD_MODE=DEBUG -DMOS_GRAPHICS_ENABLED='Yes' -B build-os\n```\n\n```\n$ cd build-os\n\n# Compiles the Kernel and user programs. Does not bulid disk image.\n$ make\n\n# Compiles and bulids disk image.\n$ make image\n```\n\n### Running\n\nTo run the disk image in Qemu use the following command:\n\n```\n$ cd build-os\n\n# Asuming your build system is `make`\n# Builds disk image and runs in Qemu\n$ make run\n\n# Pass arguments to Qemu\n$ make ARGS=\"\u003cqemu arguments\u003e run\n```\n## Building and running Unittests\n\n### Prerequisites:\n\n1. gcc and binutils 8.3 or higher.\n2. `gcc-multilib` if host computer processor is anything other than x86.\n3. nasm assembler version 2.15.05 or higher.\n4. Cmake version \u003e= 3.15\n\n### Building\n\nBuild unittests using the following command:\n```\n$ cmake -DARCH=\"x86\" -B build-ut\n$ cd build-ut\n$ make\n```\n### Running\n\nTo run every or any specific test use the following command:\n```\n$ cd build-ut\n\n# Asuming your build system is `make`\n# Run every unittests\n$ make run\n\n# Run specific test\n$ make ARGS=\"--name \u003ctest name\u003e run\n\n```\n### Prerequisites: Code coverage report\n\n1. `gcov` library 8.3 or higher.\n2. `lcov` and `genhtml` package.\n\nTo generate code coverage report run the following command:\n```\n$ cd build-ut\n\n# Asuming your build system is `make`\n$ make gen-cov\n```\n\nYou will find the report in `build-ut/reports/coverage/report/index.html`.\n\n# Feedback\n\nOpen a GitHub issue or drop a email at arjobmukherjee@gmail.com. I would love to hear your\nsuggestions and feedbacks.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderarjob%2Fmeghaos-x86","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderarjob%2Fmeghaos-x86","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderarjob%2Fmeghaos-x86/lists"}