-
Notifications
You must be signed in to change notification settings - Fork 63
Getting Started
This guide will help you set up your development environment for MentOS.
MentOS is compatible with Unix-based operating systems. It has been tested on:
- Ubuntu (20.04+)
- WSL1 / WSL2 (Windows Subsystem for Linux)
- macOS (via cross-compilation using i686 toolchains)
- ARM-based Linux (Ubuntu ARM, Apple Silicon VMs)
Install the required development tools and QEMU:
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y git build-essential nasm make cmake cmake-curses-gui e2fsprogs gcc-multilib
sudo apt-get install -y qemu-system-x86
sudo apt-get install -y gdb cgdbNote: On some distributions, QEMU is exposed as qemu-system-i386 (installed by qemu-system-x86).
For ARM-based Linux, you need i686-elf-gcc (bare-metal cross-compiler). This is required because tools/toolchain-i686-elf.cmake specifically expects it.
Option 1: Check your distribution's package manager (easiest if available):
apt-cache search i686-elf-gcc
apt-get install gcc-i686-elfIf gcc-i686-elf is not in your repos, try:
Option 2: Use a pre-built toolchain (recommended):
Download pre-built i686-elf toolchains from:
Option 3: Build from source (complex):
See osdev.org's GCC Cross-Compiler guide for detailed instructions using crosstool-ng or source builds.
Once installed and in your $PATH, use the toolchain file when building (see Building MentOS).
For macOS, install the i686 bare-metal cross-compiler using Homebrew:
brew install i686-elf-gcc
brew install nasm
brew install cmake
brew install qemuWhen building MentOS on macOS, always use the provided toolchain file:
cd MentOS
mkdir build && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../tools/toolchain-i686-elf.cmake
makeThe toolchain file (tools/toolchain-i686-elf.cmake) configures CMake to use the i686-elf-gcc cross-compiler with the correct bare-metal compilation flags.
Check that all tools are installed correctly:
gcc --version
nasm --version
cmake --version
qemu-system-i386 --versiongit clone https://github.com/mentos-team/MentOS.git
cd MentOSIf you want to boot MentOS from GRUB in QEMU:
sudo apt-get install -y grub-common grub-pc-bin xorrisoWe recommend cgdb (curses-based GDB frontend):
sudo apt-get install -y cgdbNow that your environment is set up:
- Building MentOS - Compile the operating system
- Running MentOS - Launch in QEMU
- Architecture - Understand the project structure
If qemu-system-x86 is not found, try:
sudo apt-get install -y qemu-system-i386MentOS requires CMake 3.1+ (as specified in the root CMakeLists). Check your version:
cmake --versionIf it's too old, install from the official CMake website or use a PPA.
If you're on ARM and get compilation errors:
- Verify the cross-compiler is installed:
i686-elf-gcc --version - Ensure you're using the toolchain file:
cmake .. -DCMAKE_TOOLCHAIN_FILE=../tools/toolchain-i686-elf.cmake - Do NOT use manual
-DCMAKE_C_COMPILERflags - the toolchain file handles this
Next: Building MentOS →