<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://miosix.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Alessandro.Pappalardo</id>
	<title>Miosix Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://miosix.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Alessandro.Pappalardo"/>
	<link rel="alternate" type="text/html" href="https://miosix.org/wiki/index.php?title=Special:Contributions/Alessandro.Pappalardo"/>
	<updated>2026-04-14T21:48:58Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.3</generator>
	<entry>
		<id>https://miosix.org/wiki/index.php?title=MacOS_Quick_Start&amp;diff=215</id>
		<title>MacOS Quick Start</title>
		<link rel="alternate" type="text/html" href="https://miosix.org/wiki/index.php?title=MacOS_Quick_Start&amp;diff=215"/>
		<updated>2015-11-22T00:24:09Z</updated>

		<summary type="html">&lt;p&gt;Alessandro.Pappalardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ATTENTION: This page is still a WIP. Usual disclaimers about not taking responsibility for your system disruption applies.&lt;br /&gt;
&lt;br /&gt;
=== Before you begin ===&lt;br /&gt;
&lt;br /&gt;
This procedure has been tested on OS X El Capitain 10.11. The Miosix toolchain has been successfully compiled using GCC 4.9.3, which can be installed using the Homebrew package manager.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Xcode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Install Xcode by downloading it from the Mac App Store [https://itunes.apple.com/au/app/xcode/id497799835?mt=12 here]. This is needed for installing the XCode command line tools which in turn is needed by Homebrew. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Xcode Command Line Tools&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Install the Command Line Tools by running the following command in terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is recommended to run the command even if Xcode and the Command Line Tools were already installed on your system, since the Command Line Tools installation may have been messed up by upgrading to 10.11 from a previous release.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Homebrew&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Grab a copy of Homebrew and run the install script in one step using this command in terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ruby -e &amp;quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it complains about permission issues, then you have to fix it before you can continue. In Mac OS X El Capitan 10.11, Apple introduced a new feature called System Integrity Protector (SIP), which prevents from writing to many system directories such as /usr, /System, /bin, regardless of whether or not you are root. Apple is leaving /usr/local open for developers to use, so Homebrew can still be used as expected; however, performing a few steps may be required depending on you system, as outlined in the official Homebrew documentation [https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/El_Capitan_and_Homebrew.md here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System dependencies installation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install GNU tar&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Running the Miosix toolchain compilation script may give you an error related to extracting a file. Therefore, using GNU tar instead of Apple tar is suggested.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to add the repository containing GNU tar to Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew tap homebrew/dupes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to grab the most recent packages list from Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew update&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command to install GNU tar:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install gnu-tar&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install GCC 4.9.3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Running the Miosix toolchain compilation script using Apple GCC has proven unsuccessful. That&#039;s why we need to install GCC 4.9.3 from Homebrew. Perform the steps below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to add the repository containing GCC 4.9.3 to Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew tap homebrew/versions&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to grab the most recent packages list from Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew update&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command to install GCC 4.9.3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install gcc49&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Symlink GCC 4.9.3 executables&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First, you need to create appropriate symlinks within /usr/local/bin from the versioned name of gcc executables to generic ones. Run these commands from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s /usr/local/bin/gcc-4.9 /usr/local/bin/gcc&lt;br /&gt;
ln -s /usr/local/bin/gcc-4.9 /usr/local/bin/cc&lt;br /&gt;
ln -s /usr/local/bin/g++-4.9 /usr/local/bin/g++&lt;br /&gt;
ln -s /usr/local/bin/cpp-4.9 /usr/local/bin/cpp&lt;br /&gt;
ln -s /usr/local/bin/c++-4.9 /usr/local/bin/c++&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please notice that gcc-4.9 has not been symlinked to ld has someone may expect, since it has proven prone to errors during the Miosix toolchain compilation. Instead, we are gonna use Apple own Clang ld as a linker.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Edit $PATH variable&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now you need to make sure that /usr/local/bin gets inspected before /usr/bin when looking for gcc, so that Homebrew GCC 4.9.3 will be called instead of Apple GCC. In order to do so, we are gonna modify the $PATH terminal variable. Run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get into your home folder.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
edit .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To edit the bash profile script. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need to add the following lines as they are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#homebrew gcc&lt;br /&gt;
export PATH=/usr/local/bin:$PATH&lt;br /&gt;
#gnu-tar&lt;br /&gt;
export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save and close the file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check the installed packages&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If everything went as supposed, running from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gcc -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gcc version 4.9.3 (Homebrew gcc49 4.9.3)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While running from terminal: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ld -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
LTO support using: Apple LLVM 7.0.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And finally running from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar --version&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar (GNU tar)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Toolchain compilation and installation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain sources download&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to download the kernel and toolchains sources, you need git. If you don&#039;t have it already, you can install it using Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From terminal, cd to a folder of your choice, making sure that the path from root to it doesn&#039;t contain spaces or special characters. Then run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://miosix.org/git-public/miosix-kernel.git&lt;br /&gt;
cd miosix-kernel&lt;br /&gt;
git fetch origin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain dependencies download&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You need to fix a link in the Miosix toolchain dependencies download script, located at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
miosix-kernel/miosix/_tools/compiler/download.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Replace the following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget http://www.mpfr.org/mpfr-current/mpfr-3.1.2.tar.xz&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget http://www.mpfr.org/mpfr-3.1.2/mpfr-3.1.2.tar.xz&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you need to run the dependencies download script. From terminal, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh miosix-kernel/miosix/_tools/compiler/download.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
from the folder where you performed the git clone command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain compilation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
System-wide installation of the toolchain is currently untested. It is then suggested to install it locally and then add its location the the $PATH.&lt;br /&gt;
First, edit the install script located at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
miosix-kernel/miosix/_tools/compiler/install-script.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
such that at the end the first few lines looks as follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Uncomment if installing globally on the system&lt;br /&gt;
#INSTALL_DIR=/opt&lt;br /&gt;
#SUDO=sudo&lt;br /&gt;
# Uncomment if installing locally, sudo isn&#039;t necessary&lt;br /&gt;
INSTALL_DIR=`pwd`/gcc&lt;br /&gt;
SUDO=&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can now finally run the compilation script. From terminal, run: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh miosix-kernel/miosix/_tools/compiler/install-script.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the end, if everything worked correctly, you&#039;ll find the toolchain at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
miosix-kernel/miosix/_tools/compiler/gcc/arm-miosix-eabi/bin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain compilation and installation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now you need to add the toolchain to your path. Edit the bash profile script and add the following lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#arm-miosix-eabi&lt;br /&gt;
export PATH={my-folder-of-choice-path}/miosix-kernel/miosix/_tools/compiler/gcc/arm-miosix-eabi/bin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where you have to replace {my-folder-of-choice-path} with the path of the folder where you run the git clone command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Cleanup&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You are now free to go back to Apple tar and GCC. In order to do so, edit the bash profile script and remove the following lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#homebrew gcc&lt;br /&gt;
export PATH=/usr/local/bin:$PATH&lt;br /&gt;
#gnu-tar&lt;br /&gt;
export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Kernel compilation ===&lt;br /&gt;
&lt;br /&gt;
In order to configure and compile the kernel, please follow the steps outlined in the [[Linux Quick Start|Linux Quick Start]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Flash and debug an STM32F4DISCOVERY board ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tools installation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to be able to flash and debug an STM32F4DISCOVERY board, you need the stlink tools suite. You can grab it from Homebrew running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install stlink&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Alessandro.Pappalardo</name></author>
	</entry>
	<entry>
		<id>https://miosix.org/wiki/index.php?title=MacOS_Quick_Start&amp;diff=214</id>
		<title>MacOS Quick Start</title>
		<link rel="alternate" type="text/html" href="https://miosix.org/wiki/index.php?title=MacOS_Quick_Start&amp;diff=214"/>
		<updated>2015-11-22T00:17:51Z</updated>

		<summary type="html">&lt;p&gt;Alessandro.Pappalardo: /* Toolchain compilation and installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ATTENTION: This page is still a WIP. Usual disclaimers about not taking responsibility for your system disruption applies.&lt;br /&gt;
&lt;br /&gt;
=== Before you begin ===&lt;br /&gt;
&lt;br /&gt;
This procedure has been tested on OS X El Capitain 10.11. The Miosix toolchain has been successfully compiled using GCC 4.9.3, which can be installed using the Homebrew package manager.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Xcode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Install Xcode by downloading it from the Mac App Store [https://itunes.apple.com/au/app/xcode/id497799835?mt=12 here]. This is needed for installing the XCode command line tools which in turn is needed by Homebrew. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Xcode Command Line Tools&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Install the Command Line Tools by running the following command in terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is recommended to run the command even if Xcode and the Command Line Tools were already installed on your system, since the Command Line Tools installation may have been messed up by upgrading to 10.11 from a previous release.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Homebrew&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Grab a copy of Homebrew and run the install script in one step using this command in terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ruby -e &amp;quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it complains about permission issues, then you have to fix it before you can continue. In Mac OS X El Capitan 10.11, Apple introduced a new feature called System Integrity Protector (SIP), which prevents from writing to many system directories such as /usr, /System, /bin, regardless of whether or not you are root. Apple is leaving /usr/local open for developers to use, so Homebrew can still be used as expected; however, performing a few steps may be required depending on you system, as outlined in the official Homebrew documentation [https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/El_Capitan_and_Homebrew.md here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System dependencies installation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install GNU tar&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Running the Miosix toolchain compilation script may give you an error related to extracting a file. Therefore, using GNU tar instead of Apple tar is suggested.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to add the repository containing GNU tar to Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew tap homebrew/dupes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to grab the most recent packages list from Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew update&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command to install GNU tar:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install gnu-tar&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install GCC 4.9.3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Running the Miosix toolchain compilation script using Apple GCC has proven unsuccessful. That&#039;s why we need to install GCC 4.9.3 from Homebrew. Perform the steps below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to add the repository containing GCC 4.9.3 to Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew tap homebrew/versions&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to grab the most recent packages list from Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew update&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command to install GCC 4.9.3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install gcc49&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Symlink GCC 4.9.3 executables&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First, you need to create appropriate symlinks within /usr/local/bin from the versioned name of gcc executables to generic ones. Run these commands from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s /usr/local/bin/gcc-4.9 /usr/local/bin/gcc&lt;br /&gt;
ln -s /usr/local/bin/gcc-4.9 /usr/local/bin/cc&lt;br /&gt;
ln -s /usr/local/bin/g++-4.9 /usr/local/bin/g++&lt;br /&gt;
ln -s /usr/local/bin/cpp-4.9 /usr/local/bin/cpp&lt;br /&gt;
ln -s /usr/local/bin/c++-4.9 /usr/local/bin/c++&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please notice that gcc-4.9 has not been symlinked to ld has someone may expect, since it has proven prone to errors during the Miosix toolchain compilation. Instead, we are gonna use Apple own Clang ld as a linker.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Edit $PATH variable&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now you need to make sure that /usr/local/bin gets inspected before /usr/bin when looking for gcc, so that Homebrew GCC 4.9.3 will be called instead of Apple GCC. In order to do so, we are gonna modify the $PATH terminal variable. Run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get into your home folder.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
edit .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To edit the bash profile script. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need to add the following lines as they are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#homebrew gcc&lt;br /&gt;
export PATH=/usr/local/bin:$PATH&lt;br /&gt;
#gnu-tar&lt;br /&gt;
export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save and close the file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check the installed packages&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If everything went as supposed, running from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gcc -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gcc version 4.9.3 (Homebrew gcc49 4.9.3)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While running from terminal: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ld -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
LTO support using: Apple LLVM 7.0.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And finally running from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar --version&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar (GNU tar)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Toolchain compilation and installation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain sources download&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to download the kernel and toolchains sources, you need git. If you don&#039;t have it already, you can install it using Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From terminal, cd to a folder of your choice, making sure that the path from root to it doesn&#039;t contain spaces or special characters. Then run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://miosix.org/git-public/miosix-kernel.git&lt;br /&gt;
cd miosix-kernel&lt;br /&gt;
git fetch origin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain dependencies download&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You need to fix a link in the Miosix toolchain dependencies download script, located at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
miosix-kernel/miosix/_tools/compiler/download.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Replace the following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget http://www.mpfr.org/mpfr-current/mpfr-3.1.2.tar.xz&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget http://www.mpfr.org/mpfr-3.1.2/mpfr-3.1.2.tar.xz&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you need to run the dependencies download script. From terminal, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh miosix-kernel/miosix/_tools/compiler/download.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
from the folder where you performed the git clone command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain compilation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
System-wide installation of the toolchain is currently untested. It is then suggested to install it locally and then add its location the the $PATH.&lt;br /&gt;
First, edit the install script located at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
miosix-kernel/miosix/_tools/compiler/install-script.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
such that at the end the first few lines looks as follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Uncomment if installing globally on the system&lt;br /&gt;
#INSTALL_DIR=/opt&lt;br /&gt;
#SUDO=sudo&lt;br /&gt;
# Uncomment if installing locally, sudo isn&#039;t necessary&lt;br /&gt;
INSTALL_DIR=`pwd`/gcc&lt;br /&gt;
SUDO=&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can now finally run the compilation script. From terminal, run: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh miosix-kernel/miosix/_tools/compiler/install-script.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the end, if everything worked correctly, you&#039;ll find the toolchain at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
miosix-kernel/miosix/_tools/compiler/gcc/arm-miosix-eabi/bin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain compilation and installation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now you need to add the toolchain to your path. Edit the bash profile script and add the following lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#arm-miosix-eabi&lt;br /&gt;
export PATH={my-folder-of-choice-path}/miosix-kernel/miosix/_tools/compiler/gcc/arm-miosix-eabi/bin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where you have to replace {my-folder-of-choice-path} with the path of the folder where you run the git clone command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Cleanup&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You are now free to go back to Apple tar and GCC. In order to do so, edit the bash profile script and remove the following lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#homebrew gcc&lt;br /&gt;
export PATH=/usr/local/bin:$PATH&lt;br /&gt;
#gnu-tar&lt;br /&gt;
export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
=== Kernel compilation ===&lt;br /&gt;
&lt;br /&gt;
In order to configure and compile the kernel, please follow the steps outlined in the [[Linux Quick Start|Linux Quick Start]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Flash and debug an STM32F4DISCOVERY board ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tools installation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to be able to flash and debug an STM32F4DISCOVERY board, you need the stlink tools suite. You can grab it from Homebrew running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install stlink&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Alessandro.Pappalardo</name></author>
	</entry>
	<entry>
		<id>https://miosix.org/wiki/index.php?title=MacOS_Quick_Start&amp;diff=213</id>
		<title>MacOS Quick Start</title>
		<link rel="alternate" type="text/html" href="https://miosix.org/wiki/index.php?title=MacOS_Quick_Start&amp;diff=213"/>
		<updated>2015-11-22T00:16:57Z</updated>

		<summary type="html">&lt;p&gt;Alessandro.Pappalardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ATTENTION: This page is still a WIP. Usual disclaimers about not taking responsibility for your system disruption applies.&lt;br /&gt;
&lt;br /&gt;
=== Before you begin ===&lt;br /&gt;
&lt;br /&gt;
This procedure has been tested on OS X El Capitain 10.11. The Miosix toolchain has been successfully compiled using GCC 4.9.3, which can be installed using the Homebrew package manager.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Xcode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Install Xcode by downloading it from the Mac App Store [https://itunes.apple.com/au/app/xcode/id497799835?mt=12 here]. This is needed for installing the XCode command line tools which in turn is needed by Homebrew. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Xcode Command Line Tools&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Install the Command Line Tools by running the following command in terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is recommended to run the command even if Xcode and the Command Line Tools were already installed on your system, since the Command Line Tools installation may have been messed up by upgrading to 10.11 from a previous release.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Homebrew&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Grab a copy of Homebrew and run the install script in one step using this command in terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ruby -e &amp;quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it complains about permission issues, then you have to fix it before you can continue. In Mac OS X El Capitan 10.11, Apple introduced a new feature called System Integrity Protector (SIP), which prevents from writing to many system directories such as /usr, /System, /bin, regardless of whether or not you are root. Apple is leaving /usr/local open for developers to use, so Homebrew can still be used as expected; however, performing a few steps may be required depending on you system, as outlined in the official Homebrew documentation [https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/El_Capitan_and_Homebrew.md here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System dependencies installation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install GNU tar&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Running the Miosix toolchain compilation script may give you an error related to extracting a file. Therefore, using GNU tar instead of Apple tar is suggested.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to add the repository containing GNU tar to Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew tap homebrew/dupes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to grab the most recent packages list from Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew update&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command to install GNU tar:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install gnu-tar&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install GCC 4.9.3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Running the Miosix toolchain compilation script using Apple GCC has proven unsuccessful. That&#039;s why we need to install GCC 4.9.3 from Homebrew. Perform the steps below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to add the repository containing GCC 4.9.3 to Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew tap homebrew/versions&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to grab the most recent packages list from Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew update&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command to install GCC 4.9.3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install gcc49&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Symlink GCC 4.9.3 executables&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First, you need to create appropriate symlinks within /usr/local/bin from the versioned name of gcc executables to generic ones. Run these commands from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s /usr/local/bin/gcc-4.9 /usr/local/bin/gcc&lt;br /&gt;
ln -s /usr/local/bin/gcc-4.9 /usr/local/bin/cc&lt;br /&gt;
ln -s /usr/local/bin/g++-4.9 /usr/local/bin/g++&lt;br /&gt;
ln -s /usr/local/bin/cpp-4.9 /usr/local/bin/cpp&lt;br /&gt;
ln -s /usr/local/bin/c++-4.9 /usr/local/bin/c++&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please notice that gcc-4.9 has not been symlinked to ld has someone may expect, since it has proven prone to errors during the Miosix toolchain compilation. Instead, we are gonna use Apple own Clang ld as a linker.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Edit $PATH variable&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now you need to make sure that /usr/local/bin gets inspected before /usr/bin when looking for gcc, so that Homebrew GCC 4.9.3 will be called instead of Apple GCC. In order to do so, we are gonna modify the $PATH terminal variable. Run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get into your home folder.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
edit .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To edit the bash profile script. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need to add the following lines as they are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#homebrew gcc&lt;br /&gt;
export PATH=/usr/local/bin:$PATH&lt;br /&gt;
#gnu-tar&lt;br /&gt;
export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save and close the file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check the installed packages&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If everything went as supposed, running from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gcc -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gcc version 4.9.3 (Homebrew gcc49 4.9.3)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While running from terminal: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ld -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
LTO support using: Apple LLVM 7.0.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And finally running from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar --version&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar (GNU tar)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Toolchain compilation and installation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain sources download&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to download the kernel and toolchains sources, you need git. If you don&#039;t have it already, you can install it using Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From terminal, cd to a folder of your choice, making sure that the path from root to it doesn&#039;t contain spaces or special characters). Then run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://miosix.org/git-public/miosix-kernel.git&lt;br /&gt;
cd miosix-kernel&lt;br /&gt;
git fetch origin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain dependencies download&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You need to fix a link in the Miosix toolchain dependencies download script, located at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
miosix-kernel/miosix/_tools/compiler/download.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Replace the following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget http://www.mpfr.org/mpfr-current/mpfr-3.1.2.tar.xz&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget http://www.mpfr.org/mpfr-3.1.2/mpfr-3.1.2.tar.xz&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you need to run the dependencies download script. From terminal, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh miosix-kernel/miosix/_tools/compiler/download.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
from the folder where you performed the git clone command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain compilation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
System-wide installation of the toolchain is currently untested. It is then suggested to install it locally and then add its location the the $PATH.&lt;br /&gt;
First, edit the install script located at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
miosix-kernel/miosix/_tools/compiler/install-script.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
such that at the end the first few lines looks as follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Uncomment if installing globally on the system&lt;br /&gt;
#INSTALL_DIR=/opt&lt;br /&gt;
#SUDO=sudo&lt;br /&gt;
# Uncomment if installing locally, sudo isn&#039;t necessary&lt;br /&gt;
INSTALL_DIR=`pwd`/gcc&lt;br /&gt;
SUDO=&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can now finally run the compilation script. From terminal, run: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh miosix-kernel/miosix/_tools/compiler/install-script.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the end, if everything worked correctly, you&#039;ll find the toolchain at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
miosix-kernel/miosix/_tools/compiler/gcc/arm-miosix-eabi/bin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain compilation and installation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now you need to add the toolchain to your path. Edit the bash profile script and add the following lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#arm-miosix-eabi&lt;br /&gt;
export PATH={my-folder-of-choice-path}/miosix-kernel/miosix/_tools/compiler/gcc/arm-miosix-eabi/bin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where you have to replace {my-folder-of-choice-path} with the path of the folder where you run the git clone command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Cleanup&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You are now free to go back to Apple tar and GCC. In order to do so, edit the bash profile script and remove the following lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#homebrew gcc&lt;br /&gt;
export PATH=/usr/local/bin:$PATH&lt;br /&gt;
#gnu-tar&lt;br /&gt;
export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Kernel compilation ===&lt;br /&gt;
&lt;br /&gt;
In order to configure and compile the kernel, please follow the steps outlined in the [[Linux Quick Start|Linux Quick Start]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Flash and debug an STM32F4DISCOVERY board ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tools installation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to be able to flash and debug an STM32F4DISCOVERY board, you need the stlink tools suite. You can grab it from Homebrew running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install stlink&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Alessandro.Pappalardo</name></author>
	</entry>
	<entry>
		<id>https://miosix.org/wiki/index.php?title=MacOS_Quick_Start&amp;diff=212</id>
		<title>MacOS Quick Start</title>
		<link rel="alternate" type="text/html" href="https://miosix.org/wiki/index.php?title=MacOS_Quick_Start&amp;diff=212"/>
		<updated>2015-11-22T00:15:28Z</updated>

		<summary type="html">&lt;p&gt;Alessandro.Pappalardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ATTENTION: This page is still a WIP. Usual disclaimers about not taking responsibility for your system disruption applies.&lt;br /&gt;
&lt;br /&gt;
=== Before you begin ===&lt;br /&gt;
&lt;br /&gt;
This procedure has been tested on OS X El Capitain 10.11. The Miosix toolchain has been successfully compiled using GCC 4.9.3, which can be installed using the Homebrew package manager.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Xcode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Install Xcode by downloading it from the Mac App Store [https://itunes.apple.com/au/app/xcode/id497799835?mt=12 here]. This is needed for installing the XCode command line tools which in turn is needed by Homebrew. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Xcode Command Line Tools&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Install the Command Line Tools by running the following command in terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is recommended to run the command even if Xcode and the Command Line Tools were already installed on your system, since the Command Line Tools installation may have been messed up by upgrading to 10.11 from a previous release.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Homebrew&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Grab a copy of Homebrew and run the install script in one step using this command in terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ruby -e &amp;quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it complains about permission issues, then you have to fix it before you can continue. In Mac OS X El Capitan 10.11, Apple introduced a new feature called System Integrity Protector (SIP), which prevents from writing to many system directories such as /usr, /System, /bin, regardless of whether or not you are root. Apple is leaving /usr/local open for developers to use, so Homebrew can still be used as expected; however, performing a few steps may be required depending on you system, as outlined in the official Homebrew documentation [https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/El_Capitan_and_Homebrew.md here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System dependencies installation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install GNU tar&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Running the Miosix toolchain compilation script may give you an error related to extracting a file. Therefore, using GNU tar instead of Apple tar is suggested.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to add the repository containing GNU tar to Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew tap homebrew/dupes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to grab the most recent packages list from Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew update&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command to install GNU tar:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install gnu-tar&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install GCC 4.9.3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Running the Miosix toolchain compilation script using Apple GCC has proven unsuccessful. That&#039;s why we need to install GCC 4.9.3 from Homebrew. Perform the steps below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to add the repository containing GCC 4.9.3 to Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew tap homebrew/versions&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to grab the most recent packages list from Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew update&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command to install GCC 4.9.3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install gcc49&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Symlink GCC 4.9.3 executables&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First, you need to create appropriate symlinks within /usr/local/bin from the versioned name of gcc executables to generic ones. Run these commands from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s /usr/local/bin/gcc-4.9 /usr/local/bin/gcc&lt;br /&gt;
ln -s /usr/local/bin/gcc-4.9 /usr/local/bin/cc&lt;br /&gt;
ln -s /usr/local/bin/g++-4.9 /usr/local/bin/g++&lt;br /&gt;
ln -s /usr/local/bin/cpp-4.9 /usr/local/bin/cpp&lt;br /&gt;
ln -s /usr/local/bin/c++-4.9 /usr/local/bin/c++&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please notice that gcc-4.9 has not been symlinked to ld has someone may expect, since it has proven prone to errors during the Miosix toolchain compilation. Instead, we are gonna use Apple own Clang ld as a linker.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Edit PATH variable&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now you need to make sure that /usr/local/bin gets inspected before /usr/bin when looking for gcc, so that Homebrew GCC 4.9.3 will be called instead of Apple GCC. In order to do so, we are gonna modify the $PATH terminal variable. Run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get into your home folder.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
edit .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To edit the bash profile script. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need to add the following lines as they are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#homebrew gcc&lt;br /&gt;
export PATH=/usr/local/bin:$PATH&lt;br /&gt;
#gnu-tar&lt;br /&gt;
export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save and close the file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check the installed packages&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If everything went as supposed, running from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gcc -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gcc version 4.9.3 (Homebrew gcc49 4.9.3)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While running from terminal: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ld -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
LTO support using: Apple LLVM 7.0.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And finally running from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar --version&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar (GNU tar)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Toolchain compilation and installation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain sources download&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to download the kernel and toolchains sources, you need git. If you don&#039;t have it already, you can install it using Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From terminal, cd to a folder of your choice, making sure that the path from root to it doesn&#039;t contain spaces or special characters). Then run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://miosix.org/git-public/miosix-kernel.git&lt;br /&gt;
cd miosix-kernel&lt;br /&gt;
git fetch origin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain dependencies download&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You need to fix a link in the Miosix toolchain dependencies download script, located at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
miosix-kernel/miosix/_tools/compiler/download.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Replace the following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget http://www.mpfr.org/mpfr-current/mpfr-3.1.2.tar.xz&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget http://www.mpfr.org/mpfr-3.1.2/mpfr-3.1.2.tar.xz&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you need to run the dependencies download script. From terminal, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh miosix-kernel/miosix/_tools/compiler/download.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
from the folder where you performed the git clone command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain compilation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
System-wide installation of the toolchain is currently untested. It is then suggested to install it locally and then add its location the the $PATH.&lt;br /&gt;
First, edit the install script located at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
miosix-kernel/miosix/_tools/compiler/install-script.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
such that at the end the first few lines looks as follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Uncomment if installing globally on the system&lt;br /&gt;
#INSTALL_DIR=/opt&lt;br /&gt;
#SUDO=sudo&lt;br /&gt;
# Uncomment if installing locally, sudo isn&#039;t necessary&lt;br /&gt;
INSTALL_DIR=`pwd`/gcc&lt;br /&gt;
SUDO=&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can now finally run the compilation script. From terminal, run: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh miosix-kernel/miosix/_tools/compiler/install-script.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the end, if everything worked correctly, you&#039;ll find the toolchain at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
miosix-kernel/miosix/_tools/compiler/gcc/arm-miosix-eabi/bin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain compilation and installation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now you need to add the toolchain to your path. Edit the bash profile script and add the following lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#arm-miosix-eabi&lt;br /&gt;
export PATH={my-folder-of-choice-path}/miosix-kernel/miosix/_tools/compiler/gcc/arm-miosix-eabi/bin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where you have to replace {my-folder-of-choice-path} with the path of the folder where you run the git clone command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Cleanup&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You are now free to go back to Apple tar and GCC. In order to do so, edit the bash profile script and remove the following lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#homebrew gcc&lt;br /&gt;
export PATH=/usr/local/bin:$PATH&lt;br /&gt;
#gnu-tar&lt;br /&gt;
export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Kernel compilation ===&lt;br /&gt;
&lt;br /&gt;
In order to configure and compile the kernel, please follow the steps outlined in the [[Linux Quick Start|Linux Quick Start]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Flash and debug an STM32F4DISCOVERY board ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tools installation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to be able to flash and debug an STM32F4DISCOVERY board, you need the stlink tools suite. You can grab it from Homebrew running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install stlink&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Alessandro.Pappalardo</name></author>
	</entry>
	<entry>
		<id>https://miosix.org/wiki/index.php?title=MacOS_Quick_Start&amp;diff=211</id>
		<title>MacOS Quick Start</title>
		<link rel="alternate" type="text/html" href="https://miosix.org/wiki/index.php?title=MacOS_Quick_Start&amp;diff=211"/>
		<updated>2015-11-22T00:11:48Z</updated>

		<summary type="html">&lt;p&gt;Alessandro.Pappalardo: /* Toolchain compilation and installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ATTENTION: This page is still a WIP. Usual disclaimers about not taking responsibility for your system disruption applies.&lt;br /&gt;
&lt;br /&gt;
=== Before you begin ===&lt;br /&gt;
&lt;br /&gt;
This procedure has been tested on OS X El Capitain 10.11. The Miosix toolchain has been successfully compiled using GCC 4.9.3, which can be installed using the Homebrew package manager.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Xcode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Install Xcode by downloading it from the Mac App Store [https://itunes.apple.com/au/app/xcode/id497799835?mt=12 here]. This is needed for installing the XCode command line tools which in turn is needed by Homebrew. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Xcode command line tools&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 Install Command Line tools by running the following command in terminal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is recommended to run the command even if Xcode and the Command Line tools were already installed on your system, since the Command Line tools installation may have been messed up by upgrading to 10.11 from a previous release.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Homebrew&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Grab a copy of Homebrew and run the install script in one step using this command in terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ruby -e &amp;quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If it complains about permission issues, then you have to fix it before you can continue. In Mac OS X El Capitan 10.11, Apple introduced a new feature called System Integrity Protector (SIP), which prevents from writing to many system directories such as /usr, /System, /bin, regardless of whether or not you are root. Apple is leaving /usr/local open for developers to use, so Homebrew can still be used as expected; however, performing a few steps may be required depending on you system, as outlined in the official Homebrew documentation [https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/El_Capitan_and_Homebrew.md here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System dependencies installation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install GNU tar&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Running the Miosix toolchain compilation script may give you an error related to extracting a file. Therefore, using GNU tar instead of Apple tar is suggested.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to add the repository containing GNU tar to Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew tap homebrew/dupes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to grab the most recent packages list from Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew update&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command to install GNU tar:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install gnu-tar&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install GCC 4.9.3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Running the Miosix toolchain compilation script using Apple GCC has proven unsuccessful. That&#039;s why we need to install GCC 4.9.3 from Homebrew. Perform the steps below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to add the repository containing GCC 4.9.3 to Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew tap homebrew/versions&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to grab the most recent packages list from Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew update&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command to install GCC 4.9.3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install gcc49&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Symlink GCC 4.9.3 executables&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First, you need to create appropriate symlinks within /usr/local/bin from the versioned name of gcc executables to generic ones. Run these commands from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s /usr/local/bin/gcc-4.9 /usr/local/bin/gcc&lt;br /&gt;
ln -s /usr/local/bin/gcc-4.9 /usr/local/bin/cc&lt;br /&gt;
ln -s /usr/local/bin/g++-4.9 /usr/local/bin/g++&lt;br /&gt;
ln -s /usr/local/bin/cpp-4.9 /usr/local/bin/cpp&lt;br /&gt;
ln -s /usr/local/bin/c++-4.9 /usr/local/bin/c++&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please notice that gcc-4.9 has not been symlinked to ld has someone may expect, since it has proven prone to errors during the Miosix toolchain compilation. Instead, we are gonna use Apple own Clang ld as a linker.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Edit PATH variable&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now you need to make sure that /usr/local/bin gets inspected before /usr/bin when looking for gcc, so that Homebrew GCC 4.9.3 will be called instead of Apple GCC. In order to do so, we are gonna modify the $PATH terminal variable. Run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get into your home folder.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
edit .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To edit the bash profile script. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need to add the following lines as they are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#homebrew gcc&lt;br /&gt;
export PATH=/usr/local/bin:$PATH&lt;br /&gt;
#gnu-tar&lt;br /&gt;
export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save and close the file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check the installed packages&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If everything went as supposed, running from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gcc -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gcc version 4.9.3 (Homebrew gcc49 4.9.3)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While running from terminal: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ld -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
LTO support using: Apple LLVM 7.0.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And finally running from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar --version&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar (GNU tar)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Toolchain compilation and installation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain sources download&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to download the kernel and toolchains sources, you need git. If you don&#039;t have it already, you can install it using Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From terminal, cd to a folder of your choice, making sure that the path from root to it doesn&#039;t contain spaces or special characters). Then run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://miosix.org/git-public/miosix-kernel.git&lt;br /&gt;
cd miosix-kernel&lt;br /&gt;
git fetch origin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain dependencies download&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You need to fix a link in the Miosix toolchain dependencies download script, located at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
miosix-kernel/miosix/_tools/compiler/download.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Replace the following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget http://www.mpfr.org/mpfr-current/mpfr-3.1.2.tar.xz&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget http://www.mpfr.org/mpfr-3.1.2/mpfr-3.1.2.tar.xz&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you need to run the dependencies download script. From terminal, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh miosix-kernel/miosix/_tools/compiler/download.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
from the folder where you performed the git clone command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain compilation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
System-wide installation of the toolchain is currently untested. It is then suggested to install it locally and then add its location the the $PATH.&lt;br /&gt;
First, edit the install script located at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
miosix-kernel/miosix/_tools/compiler/install-script.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
such that at the end the first few lines looks as follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Uncomment if installing globally on the system&lt;br /&gt;
#INSTALL_DIR=/opt&lt;br /&gt;
#SUDO=sudo&lt;br /&gt;
# Uncomment if installing locally, sudo isn&#039;t necessary&lt;br /&gt;
INSTALL_DIR=`pwd`/gcc&lt;br /&gt;
SUDO=&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can now finally run the compilation script. From terminal, run: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh miosix-kernel/miosix/_tools/compiler/install-script.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the end, if everything worked correctly, you&#039;ll find the toolchain at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
miosix-kernel/miosix/_tools/compiler/gcc/arm-miosix-eabi/bin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain compilation and installation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now you need to add the toolchain to your path. Edit the bash profile script and add the following lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#arm-miosix-eabi&lt;br /&gt;
export PATH={my-folder-of-choice-path}/miosix-kernel/miosix/_tools/compiler/gcc/arm-miosix-eabi/bin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where you have to replace {my-folder-of-choice-path} with the path of the folder where you run the git clone command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Cleanup&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You are now free to go back to Apple tar and GCC. In order to do so, edit the bash profile script and remove the following lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#homebrew gcc&lt;br /&gt;
export PATH=/usr/local/bin:$PATH&lt;br /&gt;
#gnu-tar&lt;br /&gt;
export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
=== Kernel compilation ===&lt;br /&gt;
&lt;br /&gt;
In order to configure and compile the kernel, please follow the steps outlined in the [[Linux Quick Start|Linux Quick Start]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Flash and debug an STM32F4DISCOVERY board ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tools installation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to be able to flash and debug an STM32F4DISCOVERY board, you need the stlink tools suite. You can grab it from Homebrew running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install stlink&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Alessandro.Pappalardo</name></author>
	</entry>
	<entry>
		<id>https://miosix.org/wiki/index.php?title=MacOS_Quick_Start&amp;diff=210</id>
		<title>MacOS Quick Start</title>
		<link rel="alternate" type="text/html" href="https://miosix.org/wiki/index.php?title=MacOS_Quick_Start&amp;diff=210"/>
		<updated>2015-11-22T00:10:29Z</updated>

		<summary type="html">&lt;p&gt;Alessandro.Pappalardo: /* Toolchain installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ATTENTION: This page is still a WIP. Usual disclaimers about not taking responsibility for your system disruption applies.&lt;br /&gt;
&lt;br /&gt;
=== Before you begin ===&lt;br /&gt;
&lt;br /&gt;
This procedure has been tested on OS X El Capitain 10.11. The Miosix toolchain has been successfully compiled using GCC 4.9.3, which can be installed using the Homebrew package manager.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Xcode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Install Xcode by downloading it from the Mac App Store [https://itunes.apple.com/au/app/xcode/id497799835?mt=12 here]. This is needed for installing the XCode command line tools which in turn is needed by Homebrew. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Xcode command line tools&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 Install Command Line tools by running the following command in terminal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is recommended to run the command even if Xcode and the Command Line tools were already installed on your system, since the Command Line tools installation may have been messed up by upgrading to 10.11 from a previous release.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Homebrew&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Grab a copy of Homebrew and run the install script in one step using this command in terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ruby -e &amp;quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If it complains about permission issues, then you have to fix it before you can continue. In Mac OS X El Capitan 10.11, Apple introduced a new feature called System Integrity Protector (SIP), which prevents from writing to many system directories such as /usr, /System, /bin, regardless of whether or not you are root. Apple is leaving /usr/local open for developers to use, so Homebrew can still be used as expected; however, performing a few steps may be required depending on you system, as outlined in the official Homebrew documentation [https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/El_Capitan_and_Homebrew.md here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System dependencies installation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install GNU tar&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Running the Miosix toolchain compilation script may give you an error related to extracting a file. Therefore, using GNU tar instead of Apple tar is suggested.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to add the repository containing GNU tar to Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew tap homebrew/dupes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to grab the most recent packages list from Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew update&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command to install GNU tar:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install gnu-tar&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install GCC 4.9.3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Running the Miosix toolchain compilation script using Apple GCC has proven unsuccessful. That&#039;s why we need to install GCC 4.9.3 from Homebrew. Perform the steps below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to add the repository containing GCC 4.9.3 to Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew tap homebrew/versions&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to grab the most recent packages list from Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew update&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command to install GCC 4.9.3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install gcc49&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Symlink GCC 4.9.3 executables&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First, you need to create appropriate symlinks within /usr/local/bin from the versioned name of gcc executables to generic ones. Run these commands from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s /usr/local/bin/gcc-4.9 /usr/local/bin/gcc&lt;br /&gt;
ln -s /usr/local/bin/gcc-4.9 /usr/local/bin/cc&lt;br /&gt;
ln -s /usr/local/bin/g++-4.9 /usr/local/bin/g++&lt;br /&gt;
ln -s /usr/local/bin/cpp-4.9 /usr/local/bin/cpp&lt;br /&gt;
ln -s /usr/local/bin/c++-4.9 /usr/local/bin/c++&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please notice that gcc-4.9 has not been symlinked to ld has someone may expect, since it has proven prone to errors during the Miosix toolchain compilation. Instead, we are gonna use Apple own Clang ld as a linker.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Edit PATH variable&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now you need to make sure that /usr/local/bin gets inspected before /usr/bin when looking for gcc, so that Homebrew GCC 4.9.3 will be called instead of Apple GCC. In order to do so, we are gonna modify the $PATH terminal variable. Run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get into your home folder.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
edit .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To edit the bash profile script. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need to add the following lines as they are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#homebrew gcc&lt;br /&gt;
export PATH=/usr/local/bin:$PATH&lt;br /&gt;
#gnu-tar&lt;br /&gt;
export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save and close the file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check the installed packages&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If everything went as supposed, running from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gcc -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gcc version 4.9.3 (Homebrew gcc49 4.9.3)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While running from terminal: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ld -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
LTO support using: Apple LLVM 7.0.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And finally running from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar --version&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar (GNU tar)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Toolchain compilation and installation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain sources download&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to download the kernel and toolchains sources, you need git. If you don&#039;t have it already, you can install it using Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From terminal, cd to a folder of your choice, making sure that the path from root to it doesn&#039;t contain spaces or special characters). Then run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://miosix.org/git-public/miosix-kernel.git&lt;br /&gt;
cd miosix-kernel&lt;br /&gt;
git fetch origin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain dependencies download&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You need to fix a link in the Miosix toolchain dependencies download script, located at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
miosix-kernel/miosix/_tools/compiler/download.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Replace the following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget http://www.mpfr.org/mpfr-current/mpfr-3.1.2.tar.xz&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget http://www.mpfr.org/mpfr-3.1.2/mpfr-3.1.2.tar.xz&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you need to run the dependencies download script. From terminal, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh miosix-kernel/miosix/_tools/compiler/download.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
from the folder where you performed the git clone command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain compilation and installation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
System-wide installation of the toolchain is currently untested. It is then suggested to install it locally and then add its location the the $PATH.&lt;br /&gt;
First, edit the install script located at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
miosix-kernel/miosix/_tools/compiler/install-script.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
such that at the end the first few lines looks as follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Uncomment if installing globally on the system&lt;br /&gt;
#INSTALL_DIR=/opt&lt;br /&gt;
#SUDO=sudo&lt;br /&gt;
# Uncomment if installing locally, sudo isn&#039;t necessary&lt;br /&gt;
INSTALL_DIR=`pwd`/gcc&lt;br /&gt;
SUDO=&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can now finally run the compilation script. From terminal, run: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh miosix-kernel/miosix/_tools/compiler/install-script.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the end, if everything worked correctly, you&#039;ll find the toolchain at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
miosix-kernel/miosix/_tools/compiler/gcc/arm-miosix-eabi/bin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you need to add it to your path. Edit the bash profile script and add the following lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#arm-miosix-eabi&lt;br /&gt;
export PATH={my-folder-of-choice-path}/miosix-kernel/miosix/_tools/compiler/gcc/arm-miosix-eabi/bin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where you have to replace {my-folder-of-choice-path} with the path of the folder where you run the git clone command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Cleanup&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You are now free to go back to Apple tar and GCC. In order to do so, edit the bash profile script and remove the following lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#homebrew gcc&lt;br /&gt;
export PATH=/usr/local/bin:$PATH&lt;br /&gt;
#gnu-tar&lt;br /&gt;
export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
=== Kernel compilation ===&lt;br /&gt;
&lt;br /&gt;
In order to configure and compile the kernel, please follow the steps outlined in the [[Linux Quick Start|Linux Quick Start]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Flash and debug an STM32F4DISCOVERY board ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tools installation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to be able to flash and debug an STM32F4DISCOVERY board, you need the stlink tools suite. You can grab it from Homebrew running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install stlink&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Alessandro.Pappalardo</name></author>
	</entry>
	<entry>
		<id>https://miosix.org/wiki/index.php?title=MacOS_Quick_Start&amp;diff=209</id>
		<title>MacOS Quick Start</title>
		<link rel="alternate" type="text/html" href="https://miosix.org/wiki/index.php?title=MacOS_Quick_Start&amp;diff=209"/>
		<updated>2015-11-22T00:09:44Z</updated>

		<summary type="html">&lt;p&gt;Alessandro.Pappalardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ATTENTION: This page is still a WIP. Usual disclaimers about not taking responsibility for your system disruption applies.&lt;br /&gt;
&lt;br /&gt;
=== Before you begin ===&lt;br /&gt;
&lt;br /&gt;
This procedure has been tested on OS X El Capitain 10.11. The Miosix toolchain has been successfully compiled using GCC 4.9.3, which can be installed using the Homebrew package manager.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Xcode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Install Xcode by downloading it from the Mac App Store [https://itunes.apple.com/au/app/xcode/id497799835?mt=12 here]. This is needed for installing the XCode command line tools which in turn is needed by Homebrew. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Xcode command line tools&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 Install Command Line tools by running the following command in terminal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is recommended to run the command even if Xcode and the Command Line tools were already installed on your system, since the Command Line tools installation may have been messed up by upgrading to 10.11 from a previous release.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Homebrew&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Grab a copy of Homebrew and run the install script in one step using this command in terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ruby -e &amp;quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If it complains about permission issues, then you have to fix it before you can continue. In Mac OS X El Capitan 10.11, Apple introduced a new feature called System Integrity Protector (SIP), which prevents from writing to many system directories such as /usr, /System, /bin, regardless of whether or not you are root. Apple is leaving /usr/local open for developers to use, so Homebrew can still be used as expected; however, performing a few steps may be required depending on you system, as outlined in the official Homebrew documentation [https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/El_Capitan_and_Homebrew.md here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System dependencies installation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install GNU tar&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Running the Miosix toolchain compilation script may give you an error related to extracting a file. Therefore, using GNU tar instead of Apple tar is suggested.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to add the repository containing GNU tar to Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew tap homebrew/dupes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to grab the most recent packages list from Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew update&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command to install GNU tar:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install gnu-tar&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install GCC 4.9.3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Running the Miosix toolchain compilation script using Apple GCC has proven unsuccessful. That&#039;s why we need to install GCC 4.9.3 from Homebrew. Perform the steps below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to add the repository containing GCC 4.9.3 to Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew tap homebrew/versions&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to grab the most recent packages list from Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew update&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command to install GCC 4.9.3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install gcc49&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Symlink GCC 4.9.3 executables&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First, you need to create appropriate symlinks within /usr/local/bin from the versioned name of gcc executables to generic ones. Run these commands from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s /usr/local/bin/gcc-4.9 /usr/local/bin/gcc&lt;br /&gt;
ln -s /usr/local/bin/gcc-4.9 /usr/local/bin/cc&lt;br /&gt;
ln -s /usr/local/bin/g++-4.9 /usr/local/bin/g++&lt;br /&gt;
ln -s /usr/local/bin/cpp-4.9 /usr/local/bin/cpp&lt;br /&gt;
ln -s /usr/local/bin/c++-4.9 /usr/local/bin/c++&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please notice that gcc-4.9 has not been symlinked to ld has someone may expect, since it has proven prone to errors during the Miosix toolchain compilation. Instead, we are gonna use Apple own Clang ld as a linker.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Edit PATH variable&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now you need to make sure that /usr/local/bin gets inspected before /usr/bin when looking for gcc, so that Homebrew GCC 4.9.3 will be called instead of Apple GCC. In order to do so, we are gonna modify the $PATH terminal variable. Run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get into your home folder.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
edit .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To edit the bash profile script. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need to add the following lines as they are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#homebrew gcc&lt;br /&gt;
export PATH=/usr/local/bin:$PATH&lt;br /&gt;
#gnu-tar&lt;br /&gt;
export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save and close the file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check the installed packages&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If everything went as supposed, running from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gcc -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gcc version 4.9.3 (Homebrew gcc49 4.9.3)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While running from terminal: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ld -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
LTO support using: Apple LLVM 7.0.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And finally running from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar --version&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar (GNU tar)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Toolchain installation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain sources download&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to download the kernel and toolchains sources, you need git. If you don&#039;t have it already, you can install it using Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From terminal, cd to a folder of your choice, making sure that the path from root to it doesn&#039;t contain spaces or special characters). Then run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://miosix.org/git-public/miosix-kernel.git&lt;br /&gt;
cd miosix-kernel&lt;br /&gt;
git fetch origin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain dependencies download&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You need to fix a link in the Miosix toolchain dependencies download script, located at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
miosix-kernel/miosix/_tools/compiler/download.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Replace the following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget http://www.mpfr.org/mpfr-current/mpfr-3.1.2.tar.xz&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget http://www.mpfr.org/mpfr-3.1.2/mpfr-3.1.2.tar.xz&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you need to run the dependencies download script. From terminal, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh miosix-kernel/miosix/_tools/compiler/download.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
from the folder where you performed the git clone command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toolchain compilation and installation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
System-wide installation of the toolchain is currently untested. It is then suggested to install it locally and then add its location the the $PATH.&lt;br /&gt;
First, edit the install script located at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
miosix-kernel/miosix/_tools/compiler/install-script.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
such that at the end the first few lines looks as follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Uncomment if installing globally on the system&lt;br /&gt;
#INSTALL_DIR=/opt&lt;br /&gt;
#SUDO=sudo&lt;br /&gt;
# Uncomment if installing locally, sudo isn&#039;t necessary&lt;br /&gt;
INSTALL_DIR=`pwd`/gcc&lt;br /&gt;
SUDO=&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can now finally run the compilation script. From terminal, run: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sh miosix-kernel/miosix/_tools/compiler/install-script.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the end, if everything worked correctly, you&#039;ll find the toolchain at:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
miosix-kernel/miosix/_tools/compiler/gcc/arm-miosix-eabi/bin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you need to add it to your path. Edit the bash profile script and add the following lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#arm-miosix-eabi&lt;br /&gt;
export PATH={my-folder-of-choice-path}/miosix-kernel/miosix/_tools/compiler/gcc/arm-miosix-eabi/bin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where you have to replace {my-folder-of-choice-path} with the path of the folder where you run the git clone command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Cleanup&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You are now free to go back to Apple tar and GCC. In order to do so, edit the bash profile script and remove the following lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#homebrew gcc&lt;br /&gt;
export PATH=/usr/local/bin:$PATH&lt;br /&gt;
#gnu-tar&lt;br /&gt;
export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Kernel compilation ===&lt;br /&gt;
&lt;br /&gt;
In order to configure and compile the kernel, please follow the steps outlined in the [[Linux Quick Start|Linux Quick Start]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Flash and debug an STM32F4DISCOVERY board ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tools installation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to be able to flash and debug an STM32F4DISCOVERY board, you need the stlink tools suite. You can grab it from Homebrew running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install stlink&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Alessandro.Pappalardo</name></author>
	</entry>
	<entry>
		<id>https://miosix.org/wiki/index.php?title=MacOS_Quick_Start&amp;diff=208</id>
		<title>MacOS Quick Start</title>
		<link rel="alternate" type="text/html" href="https://miosix.org/wiki/index.php?title=MacOS_Quick_Start&amp;diff=208"/>
		<updated>2015-11-21T23:17:53Z</updated>

		<summary type="html">&lt;p&gt;Alessandro.Pappalardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ATTENTION: This page is still a WIP. Usual disclaimers about not taking responsibility for your system disruption applies.&lt;br /&gt;
&lt;br /&gt;
=== Before you begin ===&lt;br /&gt;
&lt;br /&gt;
This procedure has been tested on OS X El Capitain 10.11. The Miosix toolchain has been successfully compiled using GCC 4.9.3, which can be installed using the Homebrew package manager.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Xcode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Install Xcode by downloading it from the Mac App Store [https://itunes.apple.com/au/app/xcode/id497799835?mt=12 here]. This is needed for installing the XCode command line tools which in turn is needed by Homebrew. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Xcode command line tools&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 Install Command Line tools by running the following command in terminal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is recommended to run the command even if Xcode and the Command Line tools were already installed on your system, since the Command Line tools installation may have been messed up by upgrading to 10.11 from a previous release.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Homebrew&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Grab a copy of Homebrew and run the install script in one step using this command in terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ruby -e &amp;quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If it complains about permission issues, then you have to fix it before you can continue. In Mac OS X El Capitan 10.11, Apple introduced a new feature called System Integrity Protector (SIP), which prevents from writing to many system directories such as /usr, /System, /bin, regardless of whether or not you are root. Apple is leaving /usr/local open for developers to use, so Homebrew can still be used as expected; however, performing a few steps may be required depending on you system, as outlined in the official Homebrew documentation [https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/El_Capitan_and_Homebrew.md here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Packages installation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install GNU tar&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Running the Miosix toolchain compilation script may give you an error related to extracting a file. Therefore, using GNU tar instead of Apple tar is suggested.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to add the repository containing GNU tar to Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew tap homebrew/dupes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to grab the most recent packages list from Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew update&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command to install GNU tar:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install gnu-tar&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install GCC 4.9.3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Running the Miosix toolchain compilation script using Apple GCC has proven unsuccessful. That&#039;s why we need to install GCC 4.9.3 from Homebrew. Perform the steps below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to add the repository containing GCC 4.9.3 to Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew tap homebrew/versions&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to grab the most recent packages list from Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew update&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command to install GCC 4.9.3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install gcc49&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Symlink GCC 4.9.3 executables&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First, you need to create appropriate symlinks within /usr/local/bin from the versioned name of gcc executables to generic ones. Run these commands from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s /usr/local/bin/gcc-4.9 /usr/local/bin/gcc&lt;br /&gt;
ln -s /usr/local/bin/gcc-4.9 /usr/local/bin/cc&lt;br /&gt;
ln -s /usr/local/bin/g++-4.9 /usr/local/bin/g++&lt;br /&gt;
ln -s /usr/local/bin/cpp-4.9 /usr/local/bin/cpp&lt;br /&gt;
ln -s /usr/local/bin/c++-4.9 /usr/local/bin/c++&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please notice that gcc-4.9 has not been symlinked to ld has someone may expect, since it has proven prone to errors during the Miosix toolchain compilation. Instead, we are gonna use Apple own Clang ld as a linker.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Edit PATH variable&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now you need to make sure that /usr/local/bin gets inspected before /usr/bin when looking for gcc, so that Homebrew GCC 4.9.3 will be called instead of Apple GCC. In order to do so, we are gonna modify the $PATH terminal variable. Run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get into your home folder.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
edit .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To edit the bash profile script. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need to add the following lines as they are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#homebrew gcc&lt;br /&gt;
export PATH=/usr/local/bin:$PATH&lt;br /&gt;
#gnu-tar&lt;br /&gt;
export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save and close the file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then run from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source .bash_profile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to reload the bash profile script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check the installed packages&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If everything went as supposed, running from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gcc -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gcc version 4.9.3 (Homebrew gcc49 4.9.3)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While running from terminal: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ld -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
LTO support using: Apple LLVM 7.0.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And finally running from terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar --version&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should return some text including:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar (GNU tar)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Alessandro.Pappalardo</name></author>
	</entry>
	<entry>
		<id>https://miosix.org/wiki/index.php?title=MacOS_Quick_Start&amp;diff=207</id>
		<title>MacOS Quick Start</title>
		<link rel="alternate" type="text/html" href="https://miosix.org/wiki/index.php?title=MacOS_Quick_Start&amp;diff=207"/>
		<updated>2015-11-21T22:23:05Z</updated>

		<summary type="html">&lt;p&gt;Alessandro.Pappalardo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ATTENTION: This page is still a WIP. Usual disclaimers about not taking responsibility for your system disruption applies.&lt;br /&gt;
&lt;br /&gt;
=== Before you begin ===&lt;br /&gt;
&lt;br /&gt;
This procedure has been tested on OS X El Capitain 10.11. The Miosix toolchain has been successfully compiled using GCC 4.9.3, which can be installed using the Homebrew package manager.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Xcode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Install Xcode by downloading it from the Mac App Store [https://itunes.apple.com/au/app/xcode/id497799835?mt=12 here]. This is needed for installing the XCode command line tools which in turn is needed by Homebrew. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Xcode command line tools&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 Install Command Line tools by running the following command in terminal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is recommended to run the command even if Xcode and the Command Line tools were already installed on your system, since the Command Line tools installation may have been messed up by upgrading to 10.11 from a previous release.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Homebrew&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Grab a copy of Homebrew and run the install script in one step using this command in terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ruby -e &amp;quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If it complains about permission issues, then you have to fix it before you can continue. In Mac OS X El Capitan 10.11, Apple introduced a new feature called System Integrity Protector (SIP), which prevents from writing to many system directories such as /usr, /System, /bin, regardless of whether or not you are root. Apple is leaving /usr/local open for developers to use, so Homebrew can still be used as expected; however, performing a few steps may be required depending on you system, as outlined in the official Homebrew documentation [https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/El_Capitan_and_Homebrew.md here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== GCC 4.9.3 installation ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install GCC 4.9.3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Running the Miosix toolchain compilation script using Apple GCC has proven unsuccessful. That&#039;s why we need to install GCC 4.9.3 from Homebrew. Perform the steps below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to grab the most recent packages list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew update&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to add the repository containing GCC 4.9.3 to Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew tap homebrew/versions&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command to install GCC 4.9.3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install gcc49&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Alessandro.Pappalardo</name></author>
	</entry>
	<entry>
		<id>https://miosix.org/wiki/index.php?title=MacOS_Quick_Start&amp;diff=206</id>
		<title>MacOS Quick Start</title>
		<link rel="alternate" type="text/html" href="https://miosix.org/wiki/index.php?title=MacOS_Quick_Start&amp;diff=206"/>
		<updated>2015-11-21T22:21:18Z</updated>

		<summary type="html">&lt;p&gt;Alessandro.Pappalardo: Created page with &amp;quot;=== Before you begin ===  This procedure has been tested on OS X El Capitain 10.11. The Miosix toolchain has been successfully compiled using GCC 4.9.3, which can be installed...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Before you begin ===&lt;br /&gt;
&lt;br /&gt;
This procedure has been tested on OS X El Capitain 10.11. The Miosix toolchain has been successfully compiled using GCC 4.9.3, which can be installed using the Homebrew package manager.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Xcode&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Install Xcode by downloading it from the Mac App Store [https://itunes.apple.com/au/app/xcode/id497799835?mt=12 here]. This is needed for installing the XCode command line tools which in turn is needed by Homebrew. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Xcode command line tools&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 Install Command Line tools by running the following command in terminal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is recommended to run the command even if Xcode and the Command Line tools were already installed on your system, since the Command Line tools installation may have been messed up by upgrading to 10.11 from a previous release.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install Homebrew&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Grab a copy of Homebrew and run the install script in one step using this command in terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ruby -e &amp;quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If it complains about permission issues, then you have to fix it before you can continue. In Mac OS X El Capitan 10.11, Apple introduced a new feature called System Integrity Protector (SIP), which prevents from writing to many system directories such as /usr, /System, /bin, regardless of whether or not you are root. Apple is leaving /usr/local open for developers to use, so Homebrew can still be used as expected; however, performing a few steps may be required depending on you system, as outlined in the official Homebrew documentation [https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/El_Capitan_and_Homebrew.md here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== GCC 4.9.3 installation ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install GCC 4.9.3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Running the Miosix toolchain compilation script using Apple GCC has proven unsuccessful. That&#039;s why we need to install GCC 4.9.3 from Homebrew. Perform the steps below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to grab the most recent packages list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew update&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command in terminal to add the repository containing GCC 4.9.3 to Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew tap homebrew/versions&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run this command to install GCC 4.9.3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew install gcc49&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Alessandro.Pappalardo</name></author>
	</entry>
	<entry>
		<id>https://miosix.org/wiki/index.php?title=Quick_start&amp;diff=205</id>
		<title>Quick start</title>
		<link rel="alternate" type="text/html" href="https://miosix.org/wiki/index.php?title=Quick_start&amp;diff=205"/>
		<updated>2015-11-19T23:01:19Z</updated>

		<summary type="html">&lt;p&gt;Alessandro.Pappalardo: Add OS X &amp;quot;Getting Started&amp;quot; and &amp;quot;Netbeans configuration&amp;quot; page references.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To start using Miosix you need a patched version of the GCC compiler called [[Miosix Toolchain]] and git to download the kernel sources. Optionally you can also use an IDE to simplify code development, and an in-circuit debugger to speed up bug fixing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Changes with respect to Miosix 1.x &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A word of warning if you are a long-time user of Miosix: please note that in Miosix 2.0 there were significant changes.&lt;br /&gt;
First of all, Miosix 2.0 uses GCC 4.7.3 and is no longer compatible with the old GCC 4.5.2 used in Miosix 1.x, so you need to upgrade your compiler.&lt;br /&gt;
Second, the preferred way to install the compiler is through a precompiled installer available for both Linux and Windows. If you want, though, you can still build the compiler from sources.&lt;br /&gt;
Last, keep in mind that the compiler patches are still a work in progress. When doing a &#039;git pull&#039; you may need to upgrade the compiler too.&lt;br /&gt;
&lt;br /&gt;
=== Getting started ===&lt;br /&gt;
&lt;br /&gt;
This section will guide you through the installation of the minimum requirements to start using Miosix: installing the compiler, and downloading the kernel.&lt;br /&gt;
&lt;br /&gt;
* [[Linux Quick Start|Getting Started on Linux]]&lt;br /&gt;
* [[Windows Quick Start|Getting Started on Windows]]&lt;br /&gt;
* [[OSX Quick Start|Getting Started on OSX]]&lt;br /&gt;
&lt;br /&gt;
=== IDE Configuration ===&lt;br /&gt;
&lt;br /&gt;
The default IDE to develop for Miosix is [https://netbeans.org/ Netbeans]. However, it does not come with Miosix support out of the box, so you have to configure it first.&lt;br /&gt;
&lt;br /&gt;
* [[Linux Netbeans configuration]]&lt;br /&gt;
* [[Windows Netbeans configuration]]&lt;br /&gt;
* [[OSX Netbeans configuration]]&lt;br /&gt;
&lt;br /&gt;
Another alternative is [[Linux Eclipse configuration|Eclipse]], which has the added feature to allow in-circuit debugging directly from the IDE.&lt;br /&gt;
&lt;br /&gt;
You can also use [http://www.qt.io QtCreator].&lt;br /&gt;
&lt;br /&gt;
* [[Linux QtCreator configuration]]&lt;br /&gt;
* [[Windows QtCreator configuration]]&lt;br /&gt;
&lt;br /&gt;
=== Miosix and git workflow ===&lt;br /&gt;
&lt;br /&gt;
See [[Miosix and git workflow]] to understand how to manage the Miosix git repository.&lt;br /&gt;
&lt;br /&gt;
=== In-circuit debugger ===&lt;br /&gt;
&lt;br /&gt;
An in-circuit debugger allows to physically halt the CPU inside a microcontroller, single-step it and view all the variables at any given time. It is a powerful tool to debug software running on a microcontroller. Miosix uses GDB and [http://openocd.sourceforge.net openocd] for in-circuit debugging.&lt;br /&gt;
&lt;br /&gt;
* [[Linux Debugger configuration]]&lt;br /&gt;
* [[Windows Debugger configuration]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation and Configuration]]&lt;/div&gt;</summary>
		<author><name>Alessandro.Pappalardo</name></author>
	</entry>
</feed>