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.
- Link to Wang’s Homebrew tap.
- How to adds more repositories to the list of formulae that brew tracks: Taps (third-party repositories).
- How to create one’s own package: Formula Cookbook.
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:
1 | $ brew tap zzhou612/jos |
It should be noticed that in the GNUmakefile
of jos
:
1 | gdb: |
Since we have compiled & installed i386-jos-elf-qemu
, the GNUmakefile
needs to be modified so that make gdb
command could work properly:
1 | gdb: |
Then you could start on the lab projects straight away.
1 | $ make qemu |
1 | $ make qemu-nox |
MIT 6.828 Toolchains Setup on macOS
https://blog.zzhou612.com/2019/03/09/mit-6-828-toolchains-setup-on-macos/