Got something we don't? Need a correction? Send it!

Step 1C - Setting Up SH4

Now that you have your Cygwin environment set up we shall move on to the next step. If you have UNIX or Linux then this guide won't apply to you. If you were running UNIX or Linux and wanted to set up the compilers to develop for Dreamcast, you probably wouldn't be reading this anyway.

First off you need to download the SH4 + ARM tools which are needed to compile code for use on the Dreamcast. These are in rar format so be sure to download WinRAR first:

sh4_arm_tools_win32.rar (39mb)
( Do not download these unless you are serious about developing to cut down on bandwidth we are trying to mirror these soon)

Installing them:
Once you download them, extract them using WinRAR into any directory on your hard drive. Done properly, this will result in a directory called "dc" being created. Copy that directory over your directory called "local" in your Cygwin directory (this will usually be 'c:\cygwin\usr\local\dc', it should have folders in it for example 'c:\cygwin\usr\local\dc\arm-elf' and 'c:\cygwin\usr\local\dc\sh-elf').

If you are using Unix or Linux then you can skip this part
Editing the Cygwin environment to use the SH4/ARM tools::
You need to create a batch file to setup the environment variables used by most makefiles to compile Dreamcast software. Create a new text file called "sh4.bat" and put it in your Cygwin directory (usually 'c:\cygwin').

Now edit the "sh4.bat" file and put the following information inside it:

@echo off

SET PATH=C:\CYGWIN\lib\gcc-lib\i686-pc-cygwin\2.95.3-5;%PATH%

Download the sh4.bat file here (Right click and save target as... extract in cygwin directory).

Now save it and run it. We need to test to make sure everything is working now.

If you are running Unix/Linux continue here

(If using Windows) run "sh4.bat" and ( or in Unix/Linux ) in the running window type "cd usr/local/kos"; this changes to the directory that kos is located in. You need to edit file, and place it in the kos directory, it must have exact paths to the Sh4/Arm Tool chain. Download an file here(right click and save target as... then extract file), but make sure the paths are set to KOS and Sh4/Arm Tool chain. Type '. ./' (without ' ) each time you want to use KOS when you get into your development environment. Now just type "make"and KOS should compile. If lots of lines are displayed then you are all set. If you run into an error however, you might need to double check your paths in the file, and don't forget to set your paths by typing '. ./' .

If you have problems with compiling genromfs in Windows, then download a fixed makefile here (right click and save target as... then extract file where its needed) and replace the old one in kos-1.x.x/utils/genromfs. Or simply change 'CFLAGS = -O2 -Wall #-g#' to 'CFLAGS = -O2 -Wall -D_WIN32 #-g#' (without ') in the makefile.

This banner below is OUR banner, the one that helps us pay bills. The one above is our host.

All names, logos, symbols, representations, and anything is copyright Sega and we aren't associated with nor are they associated with us.