Skip to content
adrw // Andrew Alexander
LinkedInGithub

Docker for CS350 OS161

Projects, Skill(Bash, ZSH, Shell), Skill(Docker), University-of-Waterloo2 min read

The university CS servers were down, so I built a Docker image and build-test script to let me keep working.

Check out the repo on GitHub.

University of Waterloo's third year curriculum for Computer Science holds one of the more challenging courses of the program: CS350 Operating Systems (known by students as 'OS').

The OS course has students add core functionality to an existing operating system, Harvard's os161, written in C in 2000.

Given the bare bones nature of the OS, it has very specific build version requirements for GDB, G++, and Make that makes it very difficult to run locally on macOS.

With the school servers down at the beginning of the summer semester I was in a tight bind since I couldn't do my work for the first assignment. This led me to @Uberi's uw-cs350-development-environment repo which inspired me to build my own local setup.

My docker-cs350-os161 repo contains a lean Docker container built on Debian with all of the specific requirements to build os161. It is 24% smaller than any other images on Docker Hub.

I also built a comprehensive build script that includes many useful options and built in tests.

build-and-run.sh options

  • default: builds from source, runs side by side with GDB in Tmux
  • -b - only build, don't run after
  • -c - continuous build loop
  • -d - set debug mode to output debug text
  • -m - only run, with gdb tmux panels
  • -r - only run, don't build, don't run with gdb
  • -t <opt> - run test test alias
  • -l <opt> - loop all following tests # times and log result in logs/ directory
  • -w - clear all logs

It was a fun project to keep adding in functionality that let me be more productive as I worked through assignments.

If you're going into CS350 soon, good luck! Feel free to use or fork my repo to get started faster.

Resources

© 2024 by adrw // Andrew Alexander. All rights reserved.
Theme by LekoArts