<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://dreamcast.wiki/wiki/index.php?action=history&amp;feed=atom&amp;title=Building_KOS_on_MinGW-w64%2FMSYS2</id>
	<title>Building KOS on MinGW-w64/MSYS2 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://dreamcast.wiki/wiki/index.php?action=history&amp;feed=atom&amp;title=Building_KOS_on_MinGW-w64%2FMSYS2"/>
	<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Building_KOS_on_MinGW-w64/MSYS2&amp;action=history"/>
	<updated>2026-05-28T00:24:40Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Building_KOS_on_MinGW-w64/MSYS2&amp;diff=3195&amp;oldid=prev</id>
		<title>BBHoodsta: /* Toolchain (cross-compiler and libraries) */</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Building_KOS_on_MinGW-w64/MSYS2&amp;diff=3195&amp;oldid=prev"/>
		<updated>2023-09-19T18:41:05Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Toolchain (cross-compiler and libraries)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:41, 19 September 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l40&quot;&gt;Line 40:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 40:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;==Toolchain (cross-compiler and libraries)==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;==Toolchain (cross-compiler and libraries)==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;After cloning the KOS repository, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;run the toolchain download+unpack+compile scripts&lt;/del&gt;:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;After cloning the KOS repository, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;navigate to dc-chain directory&lt;/ins&gt;:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;  $ cd /opt/toolchains/dc/kos/utils/dc-chain&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;  $ cd /opt/toolchains/dc/kos/utils/dc-chain&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>BBHoodsta</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Building_KOS_on_MinGW-w64/MSYS2&amp;diff=3194&amp;oldid=prev</id>
		<title>BBHoodsta: /* Toolchain (cross-compiler and libraries) */</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Building_KOS_on_MinGW-w64/MSYS2&amp;diff=3194&amp;oldid=prev"/>
		<updated>2023-09-19T18:39:20Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Toolchain (cross-compiler and libraries)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:39, 19 September 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l43&quot;&gt;Line 43:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 43:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;  $ cd /opt/toolchains/dc/kos/utils/dc-chain&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;  $ cd /opt/toolchains/dc/kos/utils/dc-chain&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; $ sh download.sh&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; $ sh unpack.sh&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;Then compile the cross-compiler and system libraries.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;Then compile the cross-compiler and system libraries.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>BBHoodsta</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Building_KOS_on_MinGW-w64/MSYS2&amp;diff=2173&amp;oldid=prev</id>
		<title>Unknown user: Created page with &quot;==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),...&quot;</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Building_KOS_on_MinGW-w64/MSYS2&amp;diff=2173&amp;oldid=prev"/>
		<updated>2023-03-02T03:01:47Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==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),...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Overview==&lt;br /&gt;
&lt;br /&gt;
This tutorial is a step-by-step guide on how to setup a toolchain and KOS environment on your Windows system.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
KOS consists of the operating system core (kos) and a set of nicely integrated libraries (kos-ports).&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==Preparations==&lt;br /&gt;
Install MSYS2 from http://repo.msys2.org/distrib/i686 (this tutorial used http://repo.msys2.org/distrib/i686/msys2-i686-20160205.exe).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Please make sure to use partition C:\&amp;#039;&amp;#039;. A user reported issues of git, wget, etc. not working at all when installing to partition D:\. On the MSys2 website it&amp;#039;s mentioned that FAT filesystems don&amp;#039;t work, so that&amp;#039;s an alternative explanation.&lt;br /&gt;
&lt;br /&gt;
As the setup completes, it will ask whether you want to open a shell. Don&amp;#039;t. Open &amp;#039;&amp;#039;C:\msys32\mingw32_shell.bat&amp;#039;&amp;#039; instead (mingw shell instead of msys2 shell).&lt;br /&gt;
&lt;br /&gt;
==Install script==&lt;br /&gt;
At this point, please consider trying the install script first. It will perform the remaining steps below automatically. &lt;br /&gt;
&lt;br /&gt;
Download the install script: [[File:Kos_setup_script.zip]].&lt;br /&gt;
Then change to the directory of the script and execute it (uses Unix paths instead of Windows paths, &amp;#039;&amp;#039;C:\&amp;#039;&amp;#039; becomes &amp;#039;&amp;#039;/c/&amp;#039;&amp;#039;)&lt;br /&gt;
 $ cd /c/Documents\ and\ Settings (&amp;#039;&amp;#039;find your Download folder here..&amp;#039;&amp;#039;)&lt;br /&gt;
 $ sh kos_setup.sh&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==Install required packages==&lt;br /&gt;
MSYS2 uses the &amp;#039;&amp;#039;pacman&amp;#039;&amp;#039; package manager. The following command should download all required programs.&lt;br /&gt;
&lt;br /&gt;
 $ 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&lt;br /&gt;
&lt;br /&gt;
==Downloading KOS==&lt;br /&gt;
&lt;br /&gt;
KOS is available through a Git repository at SourceForge.&lt;br /&gt;
The standard install directory assumed in the configuration files is /opt/toolchains/dc/{kos, kos-ports}.&lt;br /&gt;
&lt;br /&gt;
 $ git clone git://git.code.sf.net/p/cadcdev/kallistios /opt/toolchains/dc/kos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Toolchain (cross-compiler and libraries)==&lt;br /&gt;
After cloning the KOS repository, run the toolchain download+unpack+compile scripts:&lt;br /&gt;
&lt;br /&gt;
 $ cd /opt/toolchains/dc/kos/utils/dc-chain&lt;br /&gt;
 $ sh download.sh&lt;br /&gt;
 $ sh unpack.sh&lt;br /&gt;
&lt;br /&gt;
Then compile the cross-compiler and system libraries.&lt;br /&gt;
The erase=1 will delete temporary files after a successful build.&lt;br /&gt;
&lt;br /&gt;
 $ make erase=1&lt;br /&gt;
&lt;br /&gt;
After this command completes successfully you have a working cross-compiler for Dreamcast and can compile KOS next.&lt;br /&gt;
&lt;br /&gt;
==Setting up KOS==&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
Go into the kos directory and copy the template configuration: &lt;br /&gt;
&lt;br /&gt;
 $ cp /opt/toolchains/dc/kos/doc/environ.sh.sample /opt/toolchains/dc/kos/environ.sh &lt;br /&gt;
&lt;br /&gt;
Now edit environ.sh to match your installation. If you use the default installation directory you don&amp;#039;t need to change anything.&lt;br /&gt;
&lt;br /&gt;
Execute the following command to set the KOS environment variables:&lt;br /&gt;
&lt;br /&gt;
 $ source /opt/toolchains/dc/kos/environ.sh&lt;br /&gt;
&lt;br /&gt;
Remember to do this every time you want to use the KOS environment in a newly opened shell.&lt;br /&gt;
Dont&amp;#039;t forget to run the above command again when editing environ.sh. &lt;br /&gt;
&lt;br /&gt;
Now we are finally ready to compile KOS itself. In the kos directory, run: &lt;br /&gt;
 &lt;br /&gt;
 $ cd /opt/toolchains/dc/kos &lt;br /&gt;
 $ make&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==KOS-Ports==&lt;br /&gt;
KOS-Ports is a repository with commonly used libraries for development on the DC, like PNG or MP3 loading.&lt;br /&gt;
&lt;br /&gt;
Clone the repository:&lt;br /&gt;
&lt;br /&gt;
 $ git clone git://git.code.sf.net/p/cadcdev/kos-ports /opt/toolchains/dc/kos-ports&lt;br /&gt;
&lt;br /&gt;
Compile all KOS-ports using the build-all script&lt;br /&gt;
&lt;br /&gt;
 $ sh /opt/toolchains/dc/kos-ports/utils/build-all.sh&lt;br /&gt;
&lt;br /&gt;
Now you should have a working Dreamcast development environment :-) &lt;br /&gt;
&lt;br /&gt;
Check out the examples in the KallistiOS directory to find out how to use KOS in your own projects!&lt;/div&gt;</summary>
		<author><name>Unknown user</name></author>
	</entry>
</feed>