-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Infra: introduce dev-container with debugging support and refactor gr…
…ader (#22) * chore: update github badges Signed-off-by: Yiyang Wu <[email protected]> * CI: use self-maintained preprocessors Signed-off-by: Yiyang Wu <[email protected]> * infra: add devcontainer support Signed-off-by: Yiyang Wu <[email protected]> * refactor: refactor variable name and scripts Signed-off-by: Yiyang Wu <[email protected]> * infra: add py-based scores.json for grader Signed-off-by: Yiyang Wu <[email protected]> * infra: refactor out chbuild Signed-off-by: Yiyang Wu <[email protected]> * vcs: remove .vscode from .gitignore Signed-off-by: Yiyang Wu <[email protected]> * docs: update Getting-Started.md Signed-off-by: Yiyang Wu <[email protected]> * docs: update Contribute.md Signed-off-by: Yiyang Wu <[email protected]> * infra: introduce gdb 13.2 && qemu 9.1.0 Signed-off-by: Yiyang Wu <[email protected]> * infra: add chcore_target_precompile Include a new macro to select the object file to choose to use whether debug mode or release mode Signed-off-by: Yiyang Wu <[email protected]> * fix(lab1): fix linker to include debug symbols linker.tpl.ld does not include symbols for init objects. This commits fix it. * lab1: use split-mode precompiled objects Signed-off-by: Yiyang Wu <[email protected]> * lab1: move gdbinit Signed-off-by: Yiyang Wu <[email protected]> * infra: add clangd and cppdbg support Signed-off-by: Yiyang Wu <[email protected]> * lab1: fix procmgr binary Signed-off-by: Yiyang Wu <[email protected]> * infra: add additional comment to capturer.py Signed-off-by: Yiyang Wu <[email protected]> * infra: add qemu auto launch task Signed-off-by: Yiyang Wu <[email protected]> * infra: add arm highlight && hexeditor Signed-off-by: Yiyang Wu <[email protected]> * docs: add debugging.md Signed-off-by: Yiyang Wu <[email protected]> * docs(lab1): fix typo Signed-off-by: Yiyang Wu <[email protected]> * docs(lab0): fix fense Signed-off-by: Yiyang Wu <[email protected]> * docs: rearrange SUMMARY.md Signed-off-by: Yiyang Wu <[email protected]> * scripts: fix qemu and grade recipes Signed-off-by: Yiyang Wu <[email protected]> * scripts: fix gendeps.sh for customized ubuntu Signed-off-by: Yiyang Wu <[email protected]> * docs: enhance linker.md Signed-off-by: Yiyang Wu <[email protected]> * docs: update Contribute.md Signed-off-by: Yiyang Wu <[email protected]> * lab1: remove LICENSE Signed-off-by: Yiyang Wu <[email protected]> * docs: add Contribute lab assignment Signed-off-by: Yiyang Wu <[email protected]> * docs: fix mdbook guide Signed-off-by: Yiyang Wu <[email protected]> * docs(lab1): add RTFSC.md Signed-off-by: Yiyang Wu <[email protected]> --------- Signed-off-by: Yiyang Wu <[email protected]>
- Loading branch information
Showing
198 changed files
with
749 additions
and
369 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
FROM ipads/chcore_builder:v1.9.0 | ||
|
||
ARG USERNAME=stu | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
|
||
RUN sed -i "s/archive.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g" /etc/apt/sources.list | ||
RUN apt-get update && apt-get upgrade -y | ||
RUN apt-get install -y sudo \ | ||
binutils-dev \ | ||
libgmp-dev \ | ||
libmpfr-dev \ | ||
curl \ | ||
meson \ | ||
python3 \ | ||
python3-pip \ | ||
python3-psutil \ | ||
bear \ | ||
cmake \ | ||
git \ | ||
pkgconf \ | ||
clangd | ||
|
||
# We need to install a latest gdb to support cppdbg. | ||
RUN curl -SLO https://ftp.gnu.org/gnu/gdb/gdb-13.2.tar.xz && \ | ||
tar -xf gdb-13.2.tar.xz && \ | ||
cd gdb-13.2 && \ | ||
./configure --prefix=/usr/local \ | ||
--enable-targets=aarch64-linux-gnu,x86_64-linux-gnu \ | ||
--enable-tui \ | ||
--disable-sim \ | ||
&& \ | ||
make -j$(nproc) && \ | ||
make install && \ | ||
cd .. && \ | ||
rm -rf gdb-13.2 gdb-13.2.tar.xz | ||
|
||
# install tomli for .toml file required by qemu 9.1.x | ||
RUN pip install tomli | ||
|
||
# we need to install >=glib-2.66.8 to support qemu 9.1.x | ||
RUN curl -SLO https://download.gnome.org/sources/glib/2.66/glib-2.66.8.tar.xz && \ | ||
tar -xvf glib-2.66.8.tar.xz && \ | ||
cd glib-2.66.8 && \ | ||
meson build --prefix /usr/local && \ | ||
ninja -C build && \ | ||
ninja -C build install && \ | ||
cd .. && \ | ||
rm -rf glib-2.66.8 glib-2.66.8.tar.xz | ||
|
||
# install latest supported qemu supported by ubuntu-20.04. | ||
RUN curl -SLO https://download.qemu.org/qemu-9.1.0.tar.xz && \ | ||
tar -xf qemu-9.1.0.tar.xz && \ | ||
cd qemu-9.1.0 && \ | ||
./configure --prefix=/usr/local \ | ||
--target-list=aarch64-softmmu,aarch64-linux-user && \ | ||
make -j$(nproc) && \ | ||
make install && \ | ||
cd .. && \ | ||
rm -rf qemu-9.1.0 qemu-9.1.0.tar.xz | ||
|
||
RUN apt-get install -y libglib2.0-dev | ||
RUN apt-get clean | ||
|
||
RUN useradd -m -u $USER_UID -U -s /bin/bash stu | ||
RUN usermod -aG sudo stu | ||
RUN passwd -d stu | ||
USER $USERNAME | ||
CMD ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "OS-Course-Lab-Dev", | ||
"build": { "dockerfile": "Dockerfile" }, | ||
"remoteUser": "stu", | ||
"updateRemoteUserUID": true, | ||
"runArgs": ["--hostname", "Chcore"], | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-vscode.cpptools", | ||
"ms-vscode.hexeditor", | ||
"llvm-vs-code-extensions.vscode-clangd", | ||
"ms-vscode.makefile-tools", | ||
"dan-c-underwood.arm" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ cscope.* | |
!/**/firmware/*.elf | ||
|
||
build | ||
.vscode | ||
simulate.sh | ||
debug.sh | ||
.config | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[ | ||
{ | ||
"capture": "Congrats! You have defused all phases!", | ||
"msg": "Bomb Defused", | ||
"proposed": 100 | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
CompileFlags: | ||
CompilationDatabasePath: build/kernel/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "QEMU (cppdbg)", | ||
"type": "cppdbg", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/build/kernel.img", | ||
"args": [], | ||
"cwd": "${workspaceFolder}", | ||
"environment": [], | ||
"externalConsole": false, | ||
"stopAtEntry": true, | ||
"stopAtConnect": true, | ||
"setupCommands": [ | ||
{ | ||
"description": "Enable pretty-printing for gdb", | ||
"text": "-enable-pretty-printing", | ||
"ignoreFailures": true | ||
}, | ||
], | ||
"MIMode": "gdb", | ||
"targetArchitecture": "arm64", | ||
"miDebuggerServerAddress": "localhost:1234", | ||
"miDebuggerPath": "/usr/local/bin/gdb", | ||
"preLaunchTask": "Setup QEMU" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"clangd.arguments": [ | ||
"--compile-commands-dir=build/kernel" | ||
], | ||
"debug.allowBreakpointsEverywhere": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Setup QEMU", | ||
"type": "shell", | ||
"isBackground": true, | ||
"command": "make qemu-gdb", | ||
"problemMatcher": { | ||
"pattern": { | ||
"regexp": "^\\[QEMU\\] Waiting for GDB Connection" | ||
}, | ||
"background": { | ||
"activeOnStart": true, | ||
"beginsPattern": "^\\[QEMU\\] Waiting for GDB Connection", | ||
"endsPattern": "^\\[QEMU\\] Waiting for GDB Connection", | ||
} | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.