Skip to content
cjcliffe edited this page Sep 23, 2012 · 13 revisions

Installation of KallistiOS toolchain on Linux

Note you will need GIT installed to download/update the latest toolchain files.

Create the toolchains folder

This is the path used in the default Makefile you may need to make /opt too depending on system. Note sudo is used and you will have to provide your password for access.

$ sudo mkdir /opt/toolchains
[sudo] password for myusername: ....

Set permissions so your user can write

This ensure your user can read/write the files and folders during build appropriately. 'myusername' is the username you use to log-in to the system. Run whoami if you are unsure of your username.

$ sudo chown myusername:myusername /opt/toolchains

Check out the KallistiOS install files

Clone the KallistiOS and kos-ports repositories into the toolchains folder.

$ cd /opt/toolchains
toolchains$ git clone git://cadcdev.git.sourceforge.net/gitroot/cadcdev/KallistiOS
# ... download of KallistiOS here ...

toolchains$ git clone --recursive git://cadcdev.git.sourceforge.net/gitroot/cadcdev/kos-ports
# ... lots of downloading and submodule updates here ...

Download packages and prepare

Next download the dc-toolchain tools that will be built for the DC architecture.

toolchains$ cd KallistiOS/utils/dc-chain
dc-chain$ ./download.sh
# ... download of binutils, gcc, newlib ...

Unpacking and building

Next run the unpack.sh script to decompress all the source downloads.

dc-chain$ ./unpack.sh
# ... unpacks silently for awhile ...

Now build KallistiOS toolchain by running 'make'

This process can take awhile, you might want to go for a coffee.. :)

dc-chain$ make
# ... patching ...
# ... lots of compiling ...

Create KallistiOS build environment script.

To prepare the environ.sh file, create /opt/toolchains/KallistiOS/environ.sh and enter the following:

# Note: modified version of /opt/toolchains/KallistiOS/doc/environ.sh.sample, comments removed:

export KOS_ARCH="dreamcast" 
export KOS_SUBARCH="pristine" 
export KOS_BASE="/opt/toolchains/KallistiOS"
export KOS_PORTS="/opt/toolchains/kos-ports"   
export KOS_MAKE="make" 
export KOS_LOADER="dc-tool -x"   
export KOS_GENROMFS="${KOS_BASE}/utils/genromfs/genromfs" 
export KOS_CC_BASE="/opt/toolchains/dc/sh-elf" 
export KOS_CC_PREFIX="sh-elf" 
export DC_ARM_BASE="/opt/toolchains/dc/arm-eabi" 
export DC_ARM_PREFIX="arm-eabi" 
export PATH="${PATH}:${KOS_CC_BASE}/bin:/usr/local/dc/bin" 
export KOS_INC_PATHS="-I${KOS_PORTS}/include" 
export KOS_CFLAGS="" 
export KOS_CPPFLAGS="" 
export KOS_LDFLAGS="" 
export KOS_AFLAGS="" 
export KOS_CFLAGS="-O2 -fomit-frame-pointer" 
. ${KOS_BASE}/environ_base.sh

Build KallistiOS

Now that the toolchain is prepared KOS and KOS ports can be built.

Build KOS by sourcing the environ.sh file and building it with make.

$ cd /opt/toolchains/KallistiOS/
KallistiOS$ source ./environ.sh
KallistiOS$ make
# ... bunch of compiling ...

Build the kos-ports

Next change to the kos-ports directory build the source.

KallistiOS$ cd /opt/toolchains/kos-ports/
kos-ports$ make
# ... bunch of compiling ...

Add environ.sh to your .bashrc

To avoid having to source the envion.sh file for each new terminal, add it to your .bashrc file.

Edit (or create) your ~/.bashrc file and add the following at the end:

source /opt/toolchains/KallistiOS/environ.sh

At this point KOS and the KOS ports should be ready to use.

Building CubicVR for Dreamcast

Check-out out the CubicVR repository

Use GIT to fetch the KallistiOS and kos-ports repositories. Using example target directory of ~/Dreamcast, you can place it anywhere.

$ mkdir ~/Dreamcast
$ cd ~/Dreamcast

# Note: current DC activity is in the dreamcast-experimental branch, instructions will change

Dreamcast$ git clone git://github.com/cjcliffe/CubicVR.git -b dreamcast-experimental
... git checkout ...

Compile Bullet and CubicVR

Change to the CubicVR repository directory and build it.

$ cd ~/Dreamcast/CubicVR/dreamcast/
$ make
# ... bullet is compiled ...
# ... CubicVR is compiled ...

CubicVR is now built and ready for use.

For DC Network adapter users, see: Dreamcast: dc-load-ip

For DC Serial adapter users, see: Dreamcast: dc-load-serial

Next for compiling and running examples, see Dreamcast: examples