https://dreamcast.wiki/wiki/index.php?title=Building_KOS_on_MinGW-w64/MSYS2&feed=atom&action=historyBuilding KOS on MinGW-w64/MSYS2 - Revision history2024-03-29T06:41:33ZRevision history for this page on the wikiMediaWiki 1.39.3https://dreamcast.wiki/wiki/index.php?title=Building_KOS_on_MinGW-w64/MSYS2&diff=3195&oldid=prevBBHoodsta: /* Toolchain (cross-compiler and libraries) */2023-09-19T18:41:05Z<p><span dir="auto"><span class="autocomment">Toolchain (cross-compiler and libraries)</span></span></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 13:41, 19 September 2023</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l40">Line 40:</td>
<td colspan="2" class="diff-lineno">Line 40:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Toolchain (cross-compiler and libraries)==</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Toolchain (cross-compiler and libraries)==</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>After cloning the KOS repository, <del style="font-weight: bold; text-decoration: none;">run the toolchain download+unpack+compile scripts</del>:</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>After cloning the KOS repository, <ins style="font-weight: bold; text-decoration: none;">navigate to dc-chain directory</ins>:</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> $ cd /opt/toolchains/dc/kos/utils/dc-chain</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> $ cd /opt/toolchains/dc/kos/utils/dc-chain</div></td></tr>
</table>BBHoodstahttps://dreamcast.wiki/wiki/index.php?title=Building_KOS_on_MinGW-w64/MSYS2&diff=3194&oldid=prevBBHoodsta: /* Toolchain (cross-compiler and libraries) */2023-09-19T18:39:20Z<p><span dir="auto"><span class="autocomment">Toolchain (cross-compiler and libraries)</span></span></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 13:39, 19 September 2023</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l43">Line 43:</td>
<td colspan="2" class="diff-lineno">Line 43:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> $ cd /opt/toolchains/dc/kos/utils/dc-chain</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> $ cd /opt/toolchains/dc/kos/utils/dc-chain</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"> $ sh download.sh</del></div></td><td colspan="2" class="diff-side-added"></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"> $ sh unpack.sh</del></div></td><td colspan="2" class="diff-side-added"></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Then compile the cross-compiler and system libraries.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Then compile the cross-compiler and system libraries.</div></td></tr>
</table>BBHoodstahttps://dreamcast.wiki/wiki/index.php?title=Building_KOS_on_MinGW-w64/MSYS2&diff=2173&oldid=prevUnknown user: Created page with "==Overview== This tutorial is a step-by-step guide on how to setup a toolchain and KOS environment on your Windows system. The toolchain consists of a C/C++ compiler (GCC),..."2023-03-02T03:01:47Z<p>Created page with "==Overview== This tutorial is a step-by-step guide on how to setup a toolchain and KOS environment on your Windows system. The toolchain consists of a C/C++ compiler (GCC),..."</p>
<p><b>New page</b></p><div>==Overview==<br />
<br />
This tutorial is a step-by-step guide on how to setup a toolchain and KOS environment on your Windows system.<br />
<br />
The toolchain consists of a C/C++ compiler (GCC), assembler and linker (binutils), and C library (newlib). As the Dreamcast has two processors - the SH4 CPU and the AICA (ARM) sound processor - the toolchain includes compilers for both.<br />
<br />
KOS consists of the operating system core (kos) and a set of nicely integrated libraries (kos-ports).<br />
<br />
Since KOS was developed for Unix-compatible systems (like Linux, BSD, etc.), a Unix-compatible development environment must be installed. The available choices are Cygwin, MSYS and MSYS2. MSYS is unmaintained and out-dated. Cygwin and MSYS2 both work, but MSYS2 seems to be maintained more actively, work better and also offers a better package management system, so it is preferred.<br />
<br />
==Preparations==<br />
Install MSYS2 from http://repo.msys2.org/distrib/i686 (this tutorial used http://repo.msys2.org/distrib/i686/msys2-i686-20160205.exe).<br />
<br />
''Please make sure to use partition C:\''. A user reported issues of git, wget, etc. not working at all when installing to partition D:\. On the MSys2 website it's mentioned that FAT filesystems don't work, so that's an alternative explanation.<br />
<br />
As the setup completes, it will ask whether you want to open a shell. Don't. Open ''C:\msys32\mingw32_shell.bat'' instead (mingw shell instead of msys2 shell).<br />
<br />
==Install script==<br />
At this point, please consider trying the install script first. It will perform the remaining steps below automatically. <br />
<br />
Download the install script: [[File:Kos_setup_script.zip]].<br />
Then change to the directory of the script and execute it (uses Unix paths instead of Windows paths, ''C:\'' becomes ''/c/'')<br />
$ cd /c/Documents\ and\ Settings (''find your Download folder here..'')<br />
$ sh kos_setup.sh<br />
<br />
The script should perform all the remaining steps. If something goes wrong, you can try to continue the steps manually or ask for help on the forums/IRC.<br />
<br />
==Install required packages==<br />
MSYS2 uses the ''pacman'' package manager. The following command should download all required programs.<br />
<br />
$ pacman -Sy --needed mingw-w64-i686-binutils mingw-w64-i686-gcc mingw-w64-i686-pkg-config mingw-w64-i686-libpng mingw-w64-i686-libjpeg-turbo diffutils git make subversion patch python tar texinfo wget<br />
<br />
==Downloading KOS==<br />
<br />
KOS is available through a Git repository at SourceForge.<br />
The standard install directory assumed in the configuration files is /opt/toolchains/dc/{kos, kos-ports}.<br />
<br />
$ git clone git://git.code.sf.net/p/cadcdev/kallistios /opt/toolchains/dc/kos<br />
<br />
<br />
==Toolchain (cross-compiler and libraries)==<br />
After cloning the KOS repository, run the toolchain download+unpack+compile scripts:<br />
<br />
$ cd /opt/toolchains/dc/kos/utils/dc-chain<br />
$ sh download.sh<br />
$ sh unpack.sh<br />
<br />
Then compile the cross-compiler and system libraries.<br />
The erase=1 will delete temporary files after a successful build.<br />
<br />
$ make erase=1<br />
<br />
After this command completes successfully you have a working cross-compiler for Dreamcast and can compile KOS next.<br />
<br />
==Setting up KOS==<br />
<br />
You should read the documentation in the kos/doc directory for details, but here are the basic steps required to set up the KOS environment:<br />
<br />
Go into the kos directory and copy the template configuration: <br />
<br />
$ cp /opt/toolchains/dc/kos/doc/environ.sh.sample /opt/toolchains/dc/kos/environ.sh <br />
<br />
Now edit environ.sh to match your installation. If you use the default installation directory you don't need to change anything.<br />
<br />
Execute the following command to set the KOS environment variables:<br />
<br />
$ source /opt/toolchains/dc/kos/environ.sh<br />
<br />
Remember to do this every time you want to use the KOS environment in a newly opened shell.<br />
Dont't forget to run the above command again when editing environ.sh. <br />
<br />
Now we are finally ready to compile KOS itself. In the kos directory, run: <br />
<br />
$ cd /opt/toolchains/dc/kos <br />
$ make<br />
<br />
<br />
==KOS-Ports==<br />
KOS-Ports is a repository with commonly used libraries for development on the DC, like PNG or MP3 loading.<br />
<br />
Clone the repository:<br />
<br />
$ git clone git://git.code.sf.net/p/cadcdev/kos-ports /opt/toolchains/dc/kos-ports<br />
<br />
Compile all KOS-ports using the build-all script<br />
<br />
$ sh /opt/toolchains/dc/kos-ports/utils/build-all.sh<br />
<br />
Now you should have a working Dreamcast development environment :-) <br />
<br />
Check out the examples in the KallistiOS directory to find out how to use KOS in your own projects!</div>Unknown user