xcode-select --install
In this article, we will walk you through getting your Mac machine ready to install KOS bootloaders for various embedded boards Or SD cards used in the KOS project.
The first step is installing Xcode, a development environment for Mac. Xcode is required to compile the software in the Mac system for some of the dependencies we need for the rest of the system setup process. To install Xcode, open the Terminal and enter the following command:
xcode-select --install
The above command will prompt a pop-up window where you can install Xcode.
Next, we need to install Homebrew, a Mac package manager. This will help us install the necessary dependencies for the rest of the installation process. To install Homebrew, enter the following command in the Terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
We also need to install libusb and pkgconfig, which are required dependencies for the 'usbboot' code base, which will be downloaded and compiled in the next step. To install these dependencies, enter the following homebrew command in the Terminal:
brew install pkgconfig libusb
Now that we have installed the necessary dependencies, we can download the 'usbboot' code base from Github. To download the 'usbboot' code base, enter the following command in the Terminal:
git clone --depth=1 https://github.com/raspberrypi/usbboot
This command will clone the code base to your local machine folder where the command is executed
To compile the 'usbboot' code base, navigate to the directory where the code base was downloaded and enter the following command in the Terminal:
cd usbboot
make
Finally, we need to install either Balena Etcher or Raspberry Pi Imager to flash the SD card.
To install Balena Etcher, enter the following command in the Terminal:
brew install --cask balenaetcher
To install Raspberry Pi Imager, enter the following command in the Terminal:
brew install --cask raspberry-pi-imager
Now your Mac is ready to flash the SD card Or a Raspberry pi