- Install Docker Desktop from https://www.docker.com/products/docker-desktop/
- Pull the pinto image
sajedalmorsy/pintos:1.0
from Docker Hub:
sudo docker pull sajedalmorsy/pintos:1.0
- Go to the place in where you would like to install the project
Note: You may install it in any place as per your preferences
ex:
cd ~
- Clone the repo:
git clone https://github.com/Elshaarawy-1/CSEx61-dockerized-pintos.git
- From the directory, in which the repo is cloned, run a container from the pulled image and attach the repo as a volume:
sudo docker run --platform linux/amd64 --rm -it -v "$(pwd)/CSEx61-dockerized-pintos:/root/pintos" a85bf0a348d6
Note: If you got an error which is related to specifying container image platform use this command instead:
sudo docker run --rm -it -v "$(pwd)/CSEx61-dockerized-pintos:/root/pintos" a85bf0a348d6
- You should now be inside of the running container. Navigate to:
cd ~/pintos
- Update the permissions and exclude it from git:
chmod -R 777 .
chown -R root:root /root/pintos
git config core.filemode false
- Build the utils:
cd ./src/utils
make clean
make
- Check out the branch of the current project phase.
For Phase 1 (Threads), checkoutthreads-dockerized
For Phase 1 (Userprog), checkoutuser-prog-dockerized
git checkout threads-dockerized
- Build the current phase code:
cd ~/pintos/src/threads/
make clean
make
pintos run alarm-multiple
Or, for phase 2
cd ~/pintos/src/userprog/
make clean
make
Finally, after making the required code changes, run the following to test you code and calculate your grade from the directory that corresponds to the current phase, ~/pintos/src/threads
or ~/pintos/src/userprog
:
make grade
Notes:
- If you see permission issue at any stage, run the following from the
~/pintos
directory inside the container:
chmod -R 777 .
- For phase 2 (Userprog), you may need to do the build steps of both phases as they do depend on each others in some areas.