Skip to content

dc‐kos‐toolchain Package

Andy Barajas edited this page Dec 9, 2024 · 4 revisions

The dc-kos-toolchain Docker image is a comprehensive development environment for Sega Dreamcast, pre-configured with toolchains and KallistiOS (KOS) to streamline Dreamcast software development.

Included Components

The image includes:

  • SH-ELF Toolchain: Targets the Dreamcast's main CPU (Hitachi SH-4). Location: /opt/toolchains/dc/sh-elf
  • ARM-EABI Toolchain: Targets the audio chip (ARM7-based). Location: /opt/toolchains/dc/arm-eabi
  • Host Toolchain: Used for compiling various development tools.
  • KallistiOS: Pre-installed open-source Dreamcast development library. Location: /opt/toolchains/dc/kos
  • kos-ports: Pre-installed kos-ports libraries. Location: /opt/toolchains/dc/kos/kos-ports

Usage

The dc-kos-toolchain image simplifies building Dreamcast applications with KallistiOS. The following examples demonstrate how to use the image in various scenarios.

Example 1: Building a Dreamcast Application (Single Command)

Building a Dreamcast application using KOS and a Makefile:

docker run --rm \
  -v $(path/to/your-project):/project \
  -w /project \
  ghcr.io/kallistiosunchained/dc-kos-toolchain:$(toolchain-tag) \
  make

Explanation of Flags and Arguments:

  • --rm: Automatically removes the container after the command completes.
  • -v $(path/to/...):...: Mounts your project directory into the container.
  • -w ...: Sets the working directory inside the container.
  • ghcr.io/kallistiosunchained/dc-kos-toolchain:$(toolchain-tag): Specifies the Docker image and tag to use. Replace $(toolchain-tag) with the appropriate version (e.g., latest, 13.3-legacy).
  • make: Builds the specified project.

Example 2: Running Multiple Commands

To execute multiple commands (e.g., creating a build directory, running kos-cmake, and then compiling), you can chain the commands:

docker run --rm \
  -v $(pwd):/bloom \
  -w /bloom \
  ghcr.io/kallistiosunchained/dc-kos-toolchain:$(toolchain-tag) \
  /bin/bash -c "mkdir -p build && cd build && kos-cmake .. && make"

Explanation:

  • /bin/bash -c "...": Invokes a Bash shell to interpret the multiple commands passed as a string. This allows for chaining commands like mkdir -p build && cd build && kos-cmake .. && make.

Example 3: Interactive Shell

To work interactively within the container:

docker run --rm --it \
  -v $(pwd):/project \
  -w /project \
  ghcr.io/kallistiosunchained/dc-kos-toolchain:$(toolchain-tag)

Once inside the container, you can run commands like:

  mkdir -p build
  cd build
  kos-cmake ..
  make

toolchain-tag

The following tags are available for this Docker image:

  • latest: Points to the latest stable release of KOS and toolchains.
  • 13.3-legacy: Legacy version for older toolchains and compatibility.
  • 14.2-stable: Recommended version for most users.
  • 15.0-dev: Development version with the latest features (may include breaking changes).