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:

1
2
3
$ brew tap zzhou612/jos
$ brew install --HEAD i386-jos-elf-qemu
$ brew install i386-jos-elf-binutils i386-jos-elf-gcc i386-jos-elf-gdb

It should be noticed that in the GNUmakefile of jos:

1
2
gdb:
gdb -n -x .gdbinit

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

1
2
gdb:
i386-jos-elf-qemu -n -x .gdbinit

Then you could start on the lab projects straight away.

1
$ make qemu
1
$ make qemu-nox

Comments

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×