# MIT 6.828 Toolchains Setup on macOS

There are many tutorials and posts introducing environment setup for the prominent operating system course MIT 6.828. However, most of them do not target at macOS. Even if some of them do, they often choose to directly compile and install the related tools without using any package management technique to keep everything clean.

After searching on the Internet for quite a while, I finally found a promising solution: By creating one’s own Homebrew tap, toolchains for 6.828 could be deployed swiftly & cleanly.

In the Lab Tools guide for CSE 451: Operating System in the University of Washington, Prof. Xi Wang shows how to install the toolchains on macOS using his Homebrew tap hosted on GitHub.

Give a man a fish, and you feed him for a day. Teach a man to fish, and you feed him for a lifetime.

I mirrored the repository, standardized the directory structure, and updated the versions of gcc, bintuils, qemu and gdb. So the up-to-date versions of the toolchains could be installed with the following command:

It should be noticed that in the GNUmakefile of jos:

Since we have compiled & installed i386-jos-elf-qemu, the GNUmakefile needs to be modified so that make gdb command could work properly:

Then you could start on the lab projects straight away.