Toolchain Installation for rosco_m68k
The rosco_m68k toolchain can be installed globally or used as a Docker container. I recommend using Docker or installing globally on a WSL virtual machine. Installing directly on your main machine is not recommended, as it replaces the C compiler with the m68k version and makes other changes that are difficult to revert.
Using Docker
Prerequisites
- Installed Docker Desktop (for Windows/macOS) or Docker Engine (for Linux)
Running the Container
To work with your project, you need to mount your working directory to the Docker container:
docker run -v "$(pwd)/rosco_m68k:/rosco_m68k" -it roscopeco/rosco_m68k
Parameter explanation:
$(pwd)/rosco_m68k- directory on your PC (host)/rosco_m68k- directory that will appear in the container's root-v- mounts directory from host to container-it- interactive mode with terminal
For Windows
If you're using Windows PowerShell or Command Prompt, replace $(pwd) with the absolute path:
docker run -v "C:/Users/YourUsername/Projects/rosco_m68k:/rosco_m68k" -it roscopeco/rosco_m68k
Working with the Project
After starting the container, navigate to your project directory, compile the necessary libraries and the program itself. All changes in the container are automatically reflected on your host.
Using WSL or Global Installation on Linux
This method is convenient for VS Code integration - the IDE will pull all necessary components and display code hints correctly.
Prerequisites
- WSL 2 (for Windows) or Linux system
- Internet access for downloading packages
Installing Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
After installation, follow the terminal instructions to add Homebrew to PATH.
Installing the Toolchain
Execute the following command to install all necessary components:
brew install python && \
brew tap rosco-m68k/toolchain && \
brew install gcc-cross-m68k@13 vasm-all srecord && \
brew unlink binutils-cross-m68k && \
brew unlink gcc-cross-m68k@13 && \
brew unlink vasm-all && \
brew install rosco-m68k-toolchain@13 && \
brew link --overwrite binutils-cross-m68k && \
brew link --overwrite gcc-cross-m68k@13 && \
brew link --overwrite vasm-all
Verifying Installation
Check if the toolchain is installed correctly:
m68k-elf-gcc --version
You should see information about the compiler version.
Configuring VS Code for WSL
Install the "WSL" extension in VS Code, open the project folder through WSL: Ctrl+Shift+P → "WSL: Open Folder in WSL". VS Code will automatically pull settings from the WSL environment.
Compiling the Project
After installing the toolchain using either method, you can compile projects for rosco_m68k:
cd /path/to/your/project
make
Tips
- Docker: Simplest method, doesn't require system changes
- WSL/Linux: Better IDE integration, faster compilation
- Don't install globally: This may lead to conflicts with other development tools
Common Issues
Docker: Directory Mounting Error
Make sure the directory path is written correctly and the directory exists.
WSL/Linux: brew Command Not Found
After installing Homebrew, add it to PATH according to the terminal instructions.
Compilation Error: compiler not found
Make sure the toolchain is installed correctly by running m68k-elf-gcc --version.