https://github.com/ReturnInfinity/BareMetal-OS Skip to content Navigation Menu Toggle navigation Sign in * Product + GitHub Copilot Write better code with AI + Security Find and fix vulnerabilities + Actions Automate any workflow + Codespaces Instant dev environments + Issues Plan and track work + Code Review Manage code changes + Discussions Collaborate outside of code + Code Search Find more, search less Explore + All features + Documentation + GitHub Skills + Blog * Solutions By company size + Enterprises + Small and medium teams + Startups By use case + DevSecOps + DevOps + CI/CD + View all use cases By industry + Healthcare + Financial services + Manufacturing + Government + View all industries View all solutions * Resources Topics + AI + DevOps + Security + Software Development + View all Explore + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners + Executive Insights * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Enterprise + Enterprise platform AI-powered developer platform Available add-ons + Advanced Security Enterprise-grade security features + GitHub Copilot Enterprise-grade AI features + Premium Support Enterprise-grade 24/7 support * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up Reseting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} ReturnInfinity / BareMetal-OS Public * Notifications You must be signed in to change notification settings * Fork 97 * Star 600 Build script for BareMetal OS and its related utilities License MIT license 600 stars 97 forks Branches Tags Activity Star Notifications You must be signed in to change notification settings * Code * Issues 0 * Pull requests 0 * Discussions * Actions * Projects 0 * Wiki * Security * Insights Additional navigation options * Code * Issues * Pull requests * Discussions * Actions * Projects * Wiki * Security * Insights ReturnInfinity/BareMetal-OS master BranchesTags [ ] Go to file Code Folders and files Name Name Last commit message Last commit date Latest commit History 475 Commits images images .editorconfig .editorconfig .gitignore .gitignore LICENSE LICENSE README.md README.md baremetal.sh baremetal.sh bochs.cfg bochs.cfg View all files Repository files navigation * README * MIT license [BareMetal] [BareMetal] [Screenshot] Discuss this project here BareMetal OS is an exokernel-based operating system crafted entirely in x86-64 assembly and is designed to provide unparalleled levels of flexibility and efficiency. By exposing hardware resources directly to applications, it empowers developers to finely tune and optimize their software for specific tasks. With the exokernel's minimalist design, it minimizes the overhead imposed by traditional operating systems, enabling applications to achieve peak performance. Its x86-64 assembly implementation speaks to its commitment to squeezing every ounce of performance from the hardware, making it a compelling choice for those who demand the utmost control and efficiency from their computing environments. Note BareMetal OS is under active development. Some physical hardware configurations may not work correctly. Table of Contents * Prerequisites * Components * Supported hardware * Initial configuration * Building the source code * Installing + Installing the system + Installing the demos * Running on a virtual system + QEMU + QEMU via UEFI + QEMU - Second Instance + VMware + VirtualBox + Bochs * Running on a physical system Prerequisites The script in this repo depends on a Debian-based Linux system like Ubuntu or Elementary. macOS is also supported to build and test the OS, as well as the Assembly applications, if you are using Homebrew. * NASM - Assembly compiler to build the loader and kernel, as well as the apps written in Assembly. * QEMU - Computer emulator if you plan on running the OS for quick testing. * GCC - C compiler for building C/C++ applications. * Git - Version control software for pulling the source code from GitHub. * mtools - Utilities to access DOS (FAT32) disk images in Unix. In Linux this can be completed with the following command: sudo apt install nasm qemu-system-x86 gcc git mtools In macOS via Homebrew this can be completed with the following command: brew install nasm qemu gcc git mtools Components BareMetal OS consists of several different projects: * Pure64 - The software loader. * BareMetal - The kernel. * Monitor - A simple command line interface. * BMFS - The BareMetal File System utility. * BareMetal-Demo - Various demo programs. Supported Hardware * CPU + Multi-core on 64-bit x86 systems (Intel/AMD) * Bus + PCIe + PCI * Network + Gigabit o Intel 8254x Gigabit (e1000) o Intel 8257x Gigabit (e1000e) o Realtek 816x/811x Gigabit (rtl8169) + Virtual o Virtio-Net * Storage + NVMe + AHCI (SATA) + IDE + Virtio-Blk Initial configuration git clone https://github.com/ReturnInfinity/BareMetal-OS.git cd BareMetal-OS ./baremetal.sh setup baremetal.sh setup automatically runs the build and install functions. Once the setup is complete you can execute baremetal.sh run to verify that everything installed correctly. Building ./baremetal.sh build This command builds the boot sector, loader (Pure64), kernel, and simple command line interface (Monitor) to the disk image. If you want to attach your own binary to the end of the kernel you can use . /baremetal.sh build mybinary.bin Installing Installing the system ./baremetal.sh install This command installs the software to the disk image. Installing the demos ./baremetal.sh demos This command installs the demo programs to the disk image. Running on a virtual system QEMU ./baremetal.sh run QEMU via UEFI ./baremetal.sh run-uefi QEMU - Second Instance ./baremetal.sh run-2 Running a cloned second instance is useful for testing network connectivity between QEMU systems. VMware ./baremetal.sh vmdk VirtualBox ./baremetal.sh vdi Notes: * The VDI script rewrites the disk ID of the VDI file to avoid the disk warning in VirtualBox. * The Chipset Type for the VirtualBox VM must be ICH9 * The Storage Controller should be ACHI (SATA) or NVMe (PCIe) Bochs bochs -f bochs.cfg Notes: * The bochs.cfg file may need to be adjusted for your usage. It was created for a Linux-based system. * display_libary is set to use x for X Windows with the GUI Debugger by default. On macOS or Windows you will need to use sdl2 with no additional options. * The file paths for romimage and vgaromimage will need to be updated if the Bochs BIOS files are in a different location. Running on a physical system Booting via BIOS and UEFI is supported. Secure boot in UEFI mode must be disabled since this software isn't signed. You may need to press DEL or F12 on the keyboard on power-up to select the boot drive. Debug logging is output via the serial port (115200 bps, 8 data bits, 1 stop bit, no parity, no flow control). The output should look similar to this: [ Pure64 ] boot bios pml4 ok acpi ok bsp ok pic ok smp ok kernel start [ BareMetal ] 64 bus storage network system ready Important Booting from a floppy or USB drive works. For BIOS-based floppy boot and UEFI-based USB drive booting there is a RAM drive image loaded that contains the demo programs. Caution Doublecheck that you are writing the disk image to the correct disk dd if=baremetal_os.img of=/dev/sdc Once the disk image is written you can install the disk in the system and boot from it. // EOF About Build script for BareMetal OS and its related utilities Topics baremetal-os Resources Readme License MIT license Activity Custom properties Stars 600 stars Watchers 43 watching Forks 97 forks Report repository Contributors 10 * @IanSeyler * @effbiae * @giulioz * @WEREMSOFT * @gil0mendes * @scherrey * @vilhelmgray * @coditva * @Not-Nik * @isoux Languages * Shell 100.0% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.