TurtleOS Set-up Guide

Document Created by MysticGalaxy
Category: Welcome to Turtle

This guide explains how to download, compile, and start TurtleOS on your computer. It also covers how to create a bootable image and test the operating system.

About Mystic: Mystic is a contributor to TurtleOS and other FreezeProject. He currently works for Dynix.

1. Introduction

Welcome to TurtleOS! This documentation will help you get started with the operating system and understand how to build and run it.

TurtleOS is an operating system / Kernel created by Freeze Software that includes its own kernel, boot assembly, linker script, console, VGA output, serial communication, and keyboard handling.

The recommended first step is to compile TurtleOS and run it inside an emulator. This allows you to test it without changing your computer's existing operating system.

2. Requirements

Before building TurtleOS, make sure your computer has the required development tools.

Software Purpose
GCC Compiles the C source files.
NASM Assembles the x86 assembly files.
GNU Make Runs the project's build instructions.
GNU Binutils / LD Links the compiled kernel.
GRUB utilities Creates the bootable ISO image.
QEMU Emulates an x86 computer to run TurtleOS.

Hardware considerations

TurtleOS currently targets 32-bit x86 architecture. QEMU's i386 system emulator is used by the official project build instructions.

The Makefile configures QEMU with 512 MB of memory when launching the operating system.

Important: Your compiler must support the 32-bit freestanding compilation flags used by the project. A normal 64-bit compiler installation may need additional 32-bit support.

3. Downloading TurtleOS

The official TurtleOS source code is hosted on GitHub. You will need to download the repository before compiling the operating system.

Step 1 - Open the repository

Visit the official TurtleOS GitHub repository:

https://github.com/Freeze-Software/TurtleOS

Step 2 - Download the source code

  1. Open the repository on GitHub.
  2. Click the green Code button.
  3. Select Download ZIP.
  4. Wait for the download to finish.
  5. Extract the ZIP file to a folder on your computer.

Step 3 - Open the project folder

After extracting the repository, open the TurtleOS folder. You should see files and directories similar to the following:

TurtleOS/
│
├── grub/
│   └── grub.cfg
│
├── src/
│   ├── boot.s
│   ├── linker.ld
│   ├── kernel.c
│   ├── console.c
│   ├── vga.c
│   ├── serial.c
│   └── keyboard.c
│
├── Makefile
├── README.md
└── LICENSE

These files contain the source code, bootloader configuration, and build instructions.

4. Preparing the Build Environment

TurtleOS needs a development environment capable of compiling and linking a freestanding 32-bit operating system kernel.

Linux

On Linux, install the required development tools using your distribution's package manager.

Make sure you have:

  • GCC with 32-bit compilation support.
  • NASM.
  • GNU Make.
  • GNU Binutils.
  • GRUB utilities, including grub-mkrescue.
  • QEMU with the i386 system emulator.

macOS

macOS users need a compatible compiler and assembler, GNU Make, GRUB utilities, and QEMU. The compiler must support the project's 32-bit freestanding target.

Apple Silicon computers can use QEMU's x86 emulation to test an i386 operating system. However, the build tools must still support the project's compilation flags.

Windows

Windows users need a Unix-like development environment with compatible GCC, NASM, Make, GRUB utilities, and QEMU tools.

The build system is based on a Unix-style Makefile, so a compatible environment is necessary.

Build note: Installing a compiler alone is not enough. The GRUB ISO creation tools and QEMU are also required for the complete run process.

5. Compiling TurtleOS

Once the source code and required development tools are ready, you can compile TurtleOS.

Step 1 - Open a terminal

Open your terminal and navigate to the extracted TurtleOS directory.

Make sure you are in the folder containing the project's Makefile.

Step 2 - Clean previous builds

Run the following command:

make clean

This removes the existing build directory and previously compiled object files.

Step 3 - Compile the kernel

Run:

make all

This compiles the C and assembly source files and links them into the TurtleOS kernel.

Step 4 - Understand the output

After a successful compilation, the kernel should be generated at:

build/kernel.elf

This is the compiled kernel executable that will be included in the bootable ISO.

Remember: Running make all only builds the kernel. It does not launch TurtleOS. You will need to run the next command.

6. Running TurtleOS

The official TurtleOS Makefile provides a convenient command that builds the ISO, prepares a data disk, and launches QEMU.

Start TurtleOS

From the root of the TurtleOS repository, execute:

make run

This automatically performs several operations:

  1. Builds the bootable ISO if necessary.
  2. Creates the data disk if it does not exist.
  3. Starts the QEMU i386 emulator.
  4. Loads TurtleOS from the ISO.

Build output

The Makefile generates these important files:

File Description
build/kernel.elf The compiled TurtleOS kernel.
build/kernel.iso The bootable ISO image.
build/turtleos-data.img The emulator's separate data disk.

7. Using QEMU

QEMU is a computer emulator. It allows you to run TurtleOS inside a virtual x86 computer without replacing your existing operating system.

Graphical mode

When a graphical display is available, make run launches QEMU in a graphical window.

The virtual machine is configured with:

  • Machine architecture: i386.
  • Memory: 512 MB.
  • Boot media: TurtleOS ISO.
  • Additional storage: TurtleOS data image.

Terminal mode

If you do not have a graphical display, you can use:

make run-nographic

This starts QEMU without a graphical window and connects the serial console to your terminal.

The Makefile also automatically selects this mode when no graphical display is detected during make run.

Closing QEMU

If you are using graphical mode, close the emulator window when finished.

In QEMU's nographic mode, the standard QEMU monitor escape sequence is Ctrl + A, followed by X.

8. Booting from a USB Drive

If you want to test TurtleOS on a physical computer instead of using QEMU, you can investigate booting the generated ISO from removable media.

Warning: Writing an ISO to a USB drive erases the existing contents of that USB drive. Back up your files and carefully verify the selected drive before writing.

Step 1 - Generate the ISO

First, build TurtleOS and create its ISO. You can do this by running:

make run

The ISO is generated at:

build/kernel.iso

You can also create the ISO separately without launching QEMU:

make iso

Step 2 - Prepare removable media

Use a reputable USB imaging application that supports bootable ISO images.

  1. Connect a spare USB drive.
  2. Open your USB imaging application.
  3. Select build/kernel.iso.
  4. Select the intended USB drive.
  5. Double-check the selected device.
  6. Write the image and wait for completion.

Step 3 - Attempt to boot

Restart your computer and use its firmware boot menu to select the USB drive.

If the machine supports the ISO's boot configuration and the required hardware, GRUB should attempt to load TurtleOS.

Experimental: The project provides a GRUB ISO build target, but the repository does not document or guarantee compatibility with every physical computer. Test on suitable spare hardware rather than assuming all devices will boot it.

9. Physical Installation

TurtleOS currently provides a kernel build, GRUB configuration, ISO creation, and QEMU execution workflow.

However, the current repository does not provide a documented installer for permanently installing TurtleOS onto a computer's internal storage.

Booting from a USB image and permanently installing an operating system are two different processes.

Current capabilities

Feature Status
Compile kernel Supported
Create bootable ISO Supported by Makefile
Run in QEMU Supported
Run without graphical display Supported by Makefile
Permanent disk installer Not documented

Do not overwrite your computer's existing operating system or internal storage using the current ISO.

Future releases may introduce a dedicated installation process as TurtleOS development continues.

10. Troubleshooting

Command 'make' not found

GNU Make is either not installed or is not available in your terminal's PATH.

NASM not found

The assembler is required to compile the project's assembly files. Check that NASM is installed and accessible.

GCC compilation errors

Check that your GCC installation supports the required 32-bit compilation flags. TurtleOS uses freestanding compilation options and does not build as a normal desktop application.

grub-mkrescue not found

GRUB's ISO creation utility is required to generate the bootable ISO.

QEMU not found

Make sure the QEMU i386 system emulator is installed and accessible from your terminal.

QEMU opens without a graphical window

The Makefile automatically selects nographic mode when it cannot detect a graphical display. This is expected behavior in terminal-only environments.

Build from a clean state

If you encounter problems with previous build files, try cleaning the project and rebuilding it:

make clean
make all
make run

11. Credits and Resources

TurtleOS is developed by Freeze Software and its contributors.