-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Welcome to the OS161 Devcontainer wiki! The development of this repository began during my teaching assistantship at UBC for the course CPEN 331 (Operating Systems).
The development of this repository has been inspired by Sailbot Workspace, which is a development environment used by UBC Sailbot to develop their software. Much of the configuration used in the devcontainer comes from the instructions from OS161 at UBC.
Check out the setup instructions to get started.
Devcontainer architecture
The devcontainer uses Ubuntu 22.04 as the base image. From there, additional dependencies are installed as part of the docker image. It is almost like having the Ubuntu 22.04 distro installed on your machine.
Docker containers by themselves are incapable of having persisting storage.
The devcontainer handles this issue by utilizing a bind mount.
The bind mount is mapped between the location of the os161_devcontainer
clone on your host machine and the directory
specified by the environment variable $WORKSPACE_DIR
inside the devcontainer (which is /workspace
by default).
The changes made in the mounted directory are observed both in the local host and the devcontainer.
Warning
Any data that is not stored in $WORKSPACE_DIR
or any of its subdirectories will be wiped out upon
stopping the container. If you want to store data in another location inside the devcontainer,
you will need to edit the docker-compose.yml
file to add another volume and rebuild the container.
Consult the docker documentation.
Check out the VS Code documentation on developing inside containers. The devcontainer is able to take advantage of many VS Code configuration options, so feel free to play around with it yourself!
Multi-root workspaces essentially
pin multiple root directories to the VS Code project while enabling workspace-specific configuration. Workspace configuration is handled by
os161.code-workspace
.
Intellisense is supported by utilizing Clangd and Bear. Syntax highlighting for
source and header files for C code, makefiles, and OS161 files (i.e. sys161.conf
) are supported through various VS Code extensions, configured as part of the devcontainer.
Custom tasks and launch configurations are leveraged to automate various tasks. Such tasks mainly consist of building, running, and debugging OS161. Check out
os161.code-workspace
to see what is available. OS161
can be built using the hotkey ctrl + shift + b
.