Skip to content
Snippets Groups Projects
Commit 986654e9 authored by Kenneth R Hancock's avatar Kenneth R Hancock
Browse files

README Clarifications and Fixup

* Clarified usage of gdb in README
* Addition of connect.sh script to help with gdb
* Fixup to move copying of kern directory to os161-1.99 directory to the
build_kernel function rather than unpack.
* Added git to the container
parent b7c18f16
No related branches found
No related tags found
No related merge requests found
assignments assignments
logs
...@@ -49,16 +49,43 @@ assignment number. ...@@ -49,16 +49,43 @@ assignment number.
Within the container you may run within the shell (these functions are preloaded in your shell): Within the container you may run within the shell (these functions are preloaded in your shell):
``` ```
build_kernel ASST0 # build_kernel ASST0
test_kernel ASST0 # test_kernel ASST0
``` ```
To build and run within the context of ASST0. Finally you may evaluate your assignment based off public test cases (there could be hidden ones not found within To build and run within the context of ASST0. Finally you may evaluate your assignment based off public test cases (there could be hidden ones not found within
the repo) the repo)
``` ```
/evalaute /logs/test_public.log /assignments/ASST0 # /evalaute /logs/test_public.log /assignments/ASST0
``` ```
## Running GDB
To run GDB, in a window with the container running and having built the kernel using the `build_kernel ASST0`:
```
# cd /os-compile/
# sys161 -w kernel
```
Now in another terminal, move to this project directory and use the `./connect.sh` script to connect to the running container:
```
# cd /os-compile/
# cs350-gdb kernel
# cd os-compile/
# cs350-gdb kernel
GNU gdb 6.6
Copyright (C) 2006 Free Software Foundation, Inc.
...
(gdb) dir /kernel/kern/compile/ASST0
...
```
You will need to use the command `dir /kernel/kern/compile/ASST#` where `#` is the assignment number. This will make sure to load the symbols
of the kernel. Symbols are the names we have given functions and variables, this allows gdb to convey what you are looking at (this is because
the kernel has been compiled WITH these symbols in mind), otherwise gdb will show just bare assembly!
Note: If `./connect.sh` does not work it may be because you have multiple running containers of os161-runner. Use `docker ps` to figure this out.
This script is not a smart script just an ease of use script.
## Running other assignments ## Running other assignments
You may point the `run.sh` to any directory as all this does is makes sure that the directory is shared between the container and you. Allowing you to You may point the `run.sh` to any directory as all this does is makes sure that the directory is shared between the container and you. Allowing you to
...@@ -72,6 +99,7 @@ When mounting other directories that are not os161 note that the `build_kernel` ...@@ -72,6 +99,7 @@ When mounting other directories that are not os161 note that the `build_kernel`
There are some noted directories within the container There are some noted directories within the container
* `/kernel` holds YOUR assignment code * `/kernel` holds YOUR assignment code
* `/os161-1.99` holds unchanged os161 kernel code * `/os161-1.99` holds unchanged os161 kernel code
* `/os-compile` holds the compiled version of the code
* `/assignments` holds testing and evaluation scripts used for each assignment * `/assignments` holds testing and evaluation scripts used for each assignment
Within the `/assignments` directory there are subdirectories for each assignment, to see the test cases we pass and use, looks to the `public` file, Within the `/assignments` directory there are subdirectories for each assignment, to see the test cases we pass and use, looks to the `public` file,
......
#/usr/bin/env bash
ID=`docker ps -aqf "ancestor=os161-runner"`
docker exec -it $ID /bin/bash
FROM ubuntu:18.04 FROM ubuntu:18.04
# Update gcc - ubuntu is used cause seems alpine gets upset # Update gcc - ubuntu is used cause seems alpine gets upset
RUN apt-get update && \ RUN apt-get update && \
apt-get install --no-install-recommends -y gcc make wget g++ python3 libncurses-dev python3-pip && \ apt-get install --no-install-recommends -y gcc make wget g++ python3 libncurses-dev python3-pip git && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
# Setup directories # Setup directories
......
...@@ -6,12 +6,12 @@ export PATH=$PATH:/os161/tools/bin ...@@ -6,12 +6,12 @@ export PATH=$PATH:/os161/tools/bin
unpack_kernel() { unpack_kernel() {
mkdir /kernel mkdir /kernel
tar -xf /assignment.tgz -C /kernel --strip-components 1 tar -xf /assignment.tgz -C /kernel --strip-components 1
cp -r /kernel/kern/* $OS161_DIR/kern/
} }
build_k_helper() { build_k_helper() {
cd $OS161_DIR cd $OS161_DIR
mkdir /os-compile mkdir /os-compile
cp -r /kernel/kern/* $OS161_DIR/kern/
set -e set -e
# Configure - step 1 # Configure - step 1
echo "[CS350] $1 Configuring Kernel..." echo "[CS350] $1 Configuring Kernel..."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment