Getting Started with Dreamcast development: Difference between revisions
No edit summary |
No edit summary |
||
Line 21: | Line 21: | ||
=Setting up and compiling the toolchain with the dc-chain script= | =Setting up and compiling the toolchain with the dc-chain script= | ||
First, install dependencies (e.g. gawk patch bzip2 tar make libgmp-dev libmpfr-dev libmpc-dev gettext wget libelf-dev texinfo bison flex sed git build-essential diffutils curl libjpeg-dev libpng-dev) | First, install dependencies (e.g. gawk patch bzip2 tar make libgmp-dev libmpfr-dev libmpc-dev gettext wget libelf-dev texinfo bison flex sed git build-essential diffutils curl libjpeg-dev libpng-dev) using your system's package manager. | ||
sudo mkdir -p - | |||
Create the path where we'll install the toolchain and KOS: | |||
sudo mkdir -p /opt/toolchains/dc | |||
sudo chmod -R 755 /opt/toolchains/dc | |||
sudo chown -R $(id -u):$(id -g) /opt/toolchains/dc | sudo chown -R $(id -u):$(id -g) /opt/toolchains/dc | ||
Clone the KOS git repository to your system: | |||
git clone git://git.code.sf.net/p/cadcdev/kallistios /opt/toolchains/dc/kos | git clone git://git.code.sf.net/p/cadcdev/kallistios /opt/toolchains/dc/kos | ||
Enter the dc-chain directory: | |||
cd /opt/toolchains/dc/kos/utils/dc-chain | cd /opt/toolchains/dc/kos/utils/dc-chain | ||
Choose one of the following: | Choose one of the following pre-made toolchain configurations: | ||
mv config.mk.stable.sample config.mk | mv config.mk.stable.sample config.mk | ||
mv config.mk.testing.sample config.mk | mv config.mk.testing.sample config.mk | ||
Configure config.mk options | Configure config.mk options to your liking. | ||
Run the download and unpack scripts: | |||
./download.sh | ./download.sh | ||
./unpack.sh | ./unpack.sh | ||
Compile the toolchain: | |||
make erase=1 | make erase=1 | ||
Toolchain is now built. | Toolchain is now built. | ||
=Configuring and compiling KOS and kos-ports= | =Configuring and compiling KOS and kos-ports= | ||
Copy the pre-made environment script into place: | |||
cp /opt/toolchains/dc/kos/doc/environ.sh.sample /opt/toolchains/dc/kos/environ.sh | cp /opt/toolchains/dc/kos/doc/environ.sh.sample /opt/toolchains/dc/kos/environ.sh | ||
Edit the environ.sh to your liking. | Edit the environ.sh to your liking. | ||
Run the following whenever | Run the following in your terminal whenever working on your Dreamcast project: | ||
source /opt/toolchains/dc/kos/environ.sh | source /opt/toolchains/dc/kos/environ.sh | ||
Build KOS: | Build KOS: | ||
Line 44: | Line 55: | ||
make | make | ||
KOS is now built. | KOS is now built. | ||
Clone the kos-ports repository to your system: | |||
git clone --recursive git://git.code.sf.net/p/cadcdev/kos-ports /opt/toolchains/dc/kos-ports | git clone --recursive git://git.code.sf.net/p/cadcdev/kos-ports /opt/toolchains/dc/kos-ports | ||
Run the script to build all of the included ports: | |||
/opt/toolchains/dc/kos-ports/utils/build-all.sh | /opt/toolchains/dc/kos-ports/utils/build-all.sh | ||
kos-ports is now built. | kos-ports is now built. |
Revision as of 18:54, 8 December 2022
BEWARE: THIS ARTICLE IS CURRENTLY A WIP
Introduction
Explain the basic ideas behind the toolchain, KOS, KOS-ports, and a debug link.
This guide will cover:
- Steps required for Windows 10/WSL, macOS/Intel, macOS/Apple Silicon, Debian/Ubuntu Linux, and Fedora Linux
- Steps should be pretty similar for the *nix OSs besides package managers and dependencies
- Considering and choosing a Dreamcast debug link solution (serial, BBA, LAN)
- Include charts comparing the pros and cons of each solution
- Configuring and compiling the toolchain, KOS, and KOS ports
- Setting up KOS and compiling an example program
- Executing the sample program using a debug link
- Include up-to-date ready made CDIs for dcload-serial and dcload-ip
- Burning a project to CD and preparing for distribution
This guide aims to remain up to date and work on all of the above platforms, but keeping instructions for such a variety of platforms up-to-date can be difficult. If you run into any errors or other challenges while following this tutorial, or simply need clarification on any of the steps, feel free to ask for assistance on the message board and we would be happy to offer assistance and update the guide for the benefit of future readers and others in the community.
Choosing a debug link solution
Explain the differences (costs, performance, and other considerations) among the options.
Setting up and compiling the toolchain with the dc-chain script
First, install dependencies (e.g. gawk patch bzip2 tar make libgmp-dev libmpfr-dev libmpc-dev gettext wget libelf-dev texinfo bison flex sed git build-essential diffutils curl libjpeg-dev libpng-dev) using your system's package manager.
Create the path where we'll install the toolchain and KOS:
sudo mkdir -p /opt/toolchains/dc sudo chmod -R 755 /opt/toolchains/dc sudo chown -R $(id -u):$(id -g) /opt/toolchains/dc
Clone the KOS git repository to your system:
git clone git://git.code.sf.net/p/cadcdev/kallistios /opt/toolchains/dc/kos
Enter the dc-chain directory:
cd /opt/toolchains/dc/kos/utils/dc-chain
Choose one of the following pre-made toolchain configurations:
mv config.mk.stable.sample config.mk mv config.mk.testing.sample config.mk
Configure config.mk options to your liking.
Run the download and unpack scripts:
./download.sh ./unpack.sh
Compile the toolchain:
make erase=1
Toolchain is now built.
Configuring and compiling KOS and kos-ports
Copy the pre-made environment script into place:
cp /opt/toolchains/dc/kos/doc/environ.sh.sample /opt/toolchains/dc/kos/environ.sh
Edit the environ.sh to your liking. Run the following in your terminal whenever working on your Dreamcast project:
source /opt/toolchains/dc/kos/environ.sh
Build KOS:
cd /opt/toolchains/dc/kos make
KOS is now built.
Clone the kos-ports repository to your system:
git clone --recursive git://git.code.sf.net/p/cadcdev/kos-ports /opt/toolchains/dc/kos-ports
Run the script to build all of the included ports:
/opt/toolchains/dc/kos-ports/utils/build-all.sh
kos-ports is now built.
Compiling and running an example program
Give a tutorial on writing and compiling very basic helloworld-style C program, configuring serial or IP link, and running the example
Burning your project to CD and distributing
Explain how to compile a CD project using mkdcdisc or similar tools, and how to package it for distribution.