{"id":16980220,"url":"https://github.com/danirod/nativeos","last_synced_at":"2025-03-22T15:30:33.905Z","repository":{"id":69427420,"uuid":"47002758","full_name":"danirod/nativeos","owner":"danirod","description":"Hobby operating system kernel currently targetting the i386 processor. Doesn't do anything useful yet. This is a read-only mirror, pull requests will be ignored.","archived":false,"fork":false,"pushed_at":"2022-10-21T20:22:08.000Z","size":570,"stargazers_count":53,"open_issues_count":0,"forks_count":6,"subscribers_count":8,"default_branch":"trunk","last_synced_at":"2025-03-18T12:26:15.678Z","etag":null,"topics":["assembly","c","hobby-os","i386","kernel","nativeos","osdev","x86"],"latest_commit_sha":null,"homepage":"https://redmine.danirod.es/projects/nativeos","language":"C","has_issues":false,"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/danirod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"COPYING","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2015-11-27T23:14:47.000Z","updated_at":"2024-10-08T15:48:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"cef4a8f4-0318-4666-bf95-6744e0545ea3","html_url":"https://github.com/danirod/nativeos","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danirod%2Fnativeos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danirod%2Fnativeos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danirod%2Fnativeos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danirod%2Fnativeos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danirod","download_url":"https://codeload.github.com/danirod/nativeos/tar.gz/refs/heads/trunk","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244978337,"owners_count":20541837,"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":["assembly","c","hobby-os","i386","kernel","nativeos","osdev","x86"],"created_at":"2024-10-14T01:50:26.996Z","updated_at":"2025-03-22T15:30:33.893Z","avatar_url":"https://github.com/danirod.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NativeOS\n\nNativeOS is a hobbyist kernel and operating system for the x86\nplatform. It is designed as a project to learn more about how the x86\nprocessor work and how operating systems work. My intention is purely\neducational. The source code is open in the hope that it helps other\npeople too.\n\n## Roadmap and contributing to the project\n\n**This project has no public roadmap**. This means that I'm not disclosing\nwhat I'm working on when I'm working on this project. This is intended at\nthis moment for this project because the project is not mature or stable\nenough and is still under development.\n\nMy issue and pull request policy is clarified on [CONTRIBUTING.md][1]. I'm not\naccepting pull requests at this moment. See the document to read why.\nIssues are still open and covered by the Code of Conduct. See\n[CODE\\_OF\\_CONDUCT.md][2] for details.\n\n## Building the NativeOS Kernel\n\nTo build the kernel image (in other words, the program that will run\nwhen the computer starts up), you will need to install the LLVM compiler\nif you don't have it already. NativeOS switched to LLVM because it has\nsupport for foreign ABIs (such as i386-elf in an x86-64 macOS) out of\nthe box without requiring to setup a cross-compiler.\n\nGNU Make is also required to run the Makefile file.\n\nPython 3 is also required to run the kcons tool, which is used to\ngenerate the Makefiles.\n\nWindows NT is not a supported platform and there may be bugs. Users\nof Windows NT are encouraged to setup a POSIX system such as MSYS or\nCygwin, or use the Windows Subsystem for Linux if available.\n\n### Picking a profile\n\nProfiles are kernel compilation settings. A profile causes a specific\nsubset of source code files to be compiled into the kernel image, and\nsome specific optional settings to be enabled.\n\nAt the moment, the repository provides the I386 profile, to build a\nbasic 32 bit kernel image for the i386 architecture. The settings file\nfor this profile is at conf/I386.\n\n### Building a profile\n\nTo build a profile, you can use the kcons script. kcons will parse the\nprofile and the associated files and generate a Makefile that can be\nused to build the kernel. Call `tools/kcons` providing the path to a\nprofile file as a parameter.\n\n    $ tools/kcons conf/I386\n\nThis will generate a subdirectory named after the profile name inside\nthe `compile/` directory. In this directory, a Makefile will be present.\nUse it to build the kernel image:\n\n    $ cd compile/I386\n\nGenerating a depfile is recommended in order to have the object files\nrecompiled whenever the imported source code changes:\n\n    $ make .depend\n\nThen, proceed to build the kernel.\n\n    $ make kernel\n\nOr, to make things faster,\n\n    $ make -C compile/I386 .depend kernel\n\nThe NativeOS kernel file is a binary in the ELF format. It supports the\nMultiboot specification, so it can be deployed in any machine using a\nbootloader capable of loading Multiboot binaries, such as GNU GRUB,\nSYSLINUX or Limine.\n\n### Running the profile in QEMU\n\nFor the i386 platform, QEMU supports a special flag called `-kernel`,\nwhere the path to a Multiboot executable file can be given. QEMU will\ntreat the given file as if it was booted via a CD-ROM. This allows to\nquickly test the executable file without having to build CD-ROMs:\n\n    $ make -C compile/I386 qemu\n    qemu-system-i386 -kernel kernel -serial stdio\n\n### Debugging the profile in QEMU\n\nQEMU also supports using the gdbserver protocol, so it is possible to\nconnect QEMU with GDB in order to debug the running processor. There\nis a gdbinit file in the conf directory to help with the process.\n\n    $ make -C compile/I386 qemu-gdb\n\n(In another terminal:)\n\n    $ gdb -x conf/gdbinit.I386\n    \u003e continue\n\n### Shortcut\n\nIt is also possible to configure and build a kernel image profile using\nthe root Makefile. Provide the profile name as the `PROFILE` parameter\nand it will run all the commands above.\n\n    $ make build-kernel PROFILE=I386\n\n## Creating a CD image\n\nYou can use some of the GRUB Command Line Tools to generate ISO files.\nThere is already a rule in the Makefile file to generate a CD-ROM using\nGRUB.\n\nYou need the GRUB Command Line Tools installed with support for the\ni386-elf platform. If you are using GNU/Linux, you probably already have\nsupport for that platform, but otherwise you might have to install it to\nyour system. Take protections to prevent GRUB to running on your host\nsystem if that is not practical for you. The `grub-mkrescue` program\nshould be able to run in your command line.\n\nGNU xorriso is additionally required to generate the ISO file.\n\nTo create a NativeOS ISO image, run the following command, specifying\nthe name of a **previously built** profile as the `PROFILE` variable:\n\n    $ make cdrom PROFILE=I386\n\nWindows NT, macOS and BSD users can install the GRUB Command Line tools\nby following the instructions given in the following address:\n\u003chttp://wiki.osdev.org/GRUB_2#Installing_GRUB2_on_Mac_OS_X\u003e.\n(Instructions are the same for Windows).\n\nNOTE: You'll be getting the GRUB Command Line Tools here. **This is\ndefinitely NOT the same as installing the GRUB Bootloader on your host\nPC**, although the command line tools allow you to do that, so care must\nbe taken in order to avoid running any dangerous command.\n\n## Running NativeOS\n\nA virtual machine is the safest way for running and testing NativeOS.\nI don't recommend running this on your host PC unless you know what\nyou are doing and you have inspected the source code. Also, take a\nlook at the disclaimer below before attempting to run anything that\nyou could regret later.\n\nThe Makefile already has some rules to run the NativeOS ISO file with\nQEMU. It is even possible to run QEMU in debug mode and to remotely\nattach GDB in order to debug the kernel image.\n\nRun the following commands:\n\n    $ make qemu PROFILE=I386      # Run qemu-system-i386\n    $ make qemu-gdb PROFILE=I386  # Run qemu-system-i386 in debug mode\n\nFor more information on GDB debugging with QEMU, see the QEMU\nmanual or the following article: \u003chttp://wiki.osdev.org/QEMU\u003e.\n\n## License and disclaimer\n\nCopyright (C) 2015-2021 Dani Rodríguez\n\nNativeOS is licensed under the terms of the GNU General Public License v3.\nSee the COPYING file for more information. Old NativeOS files will\nprobably not have the GPL header on it. I'm working on that.\n\nNativeOS is provided AS IS with no extra support. Working with kernels\nand OS and bootloaders is fun, but I'm not resposible for anything wrong\nyou do with it. If you break your hard drive or your computer because\nof using the wrong command, that is not my fault.\n\n[1]: https://github.com/danirod/nativeos/blob/master/CONTRIBUTING.md\n[2]: https://github.com/danirod/nativeos/blob/master/CODE_OF_CONDUCT.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanirod%2Fnativeos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanirod%2Fnativeos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanirod%2Fnativeos/lists"}